Documentation
¶
Index ¶
Constants ¶
View Source
const (
PROFILE_SPLIT_CHAR = ":"
)
Variables ¶
This section is empty.
Functions ¶
func ProcessKeyName ¶ added in v0.0.51
func SanitizeCommand ¶ added in v0.0.5
Types ¶
type Config ¶
type Config struct {
HealthCheckTimeout int `yaml:"healthCheckTimeout"`
Models map[string]ModelConfig `yaml:"models"`
Profiles map[string][]string `yaml:"profiles"`
// contains filtered or unexported fields
}
func LoadConfig ¶
func (*Config) FindConfig ¶
func (c *Config) FindConfig(modelName string) (ModelConfig, string, bool)
type LogMonitor ¶ added in v0.0.7
type LogMonitor struct {
// contains filtered or unexported fields
}
func NewLogMonitor ¶ added in v0.0.7
func NewLogMonitor() *LogMonitor
func NewLogMonitorWriter ¶ added in v0.0.7
func NewLogMonitorWriter(stdout io.Writer) *LogMonitor
func (*LogMonitor) GetHistory ¶ added in v0.0.7
func (w *LogMonitor) GetHistory() []byte
func (*LogMonitor) Subscribe ¶ added in v0.0.7
func (w *LogMonitor) Subscribe() chan []byte
func (*LogMonitor) Unsubscribe ¶ added in v0.0.7
func (w *LogMonitor) Unsubscribe(ch chan []byte)
type ModelConfig ¶
type ModelConfig struct {
Cmd string `yaml:"cmd"`
Proxy string `yaml:"proxy"`
Aliases []string `yaml:"aliases"`
Env []string `yaml:"env"`
CheckEndpoint string `yaml:"checkEndpoint"`
UnloadAfter int `yaml:"ttl"`
}
func (*ModelConfig) SanitizedCommand ¶ added in v0.0.5
func (m *ModelConfig) SanitizedCommand() ([]string, error)
type Process ¶ added in v0.0.51
func NewProcess ¶ added in v0.0.51
func NewProcess(ID string, healthCheckTimeout int, config ModelConfig, logMonitor *LogMonitor) *Process
func (*Process) CurrentState ¶ added in v0.0.51
func (p *Process) CurrentState() ProcessState
func (*Process) ProxyRequest ¶ added in v0.0.51
func (p *Process) ProxyRequest(w http.ResponseWriter, r *http.Request)
type ProcessState ¶ added in v0.0.51
type ProcessState string
const ( StateStopped ProcessState = ProcessState("stopped") StateReady ProcessState = ProcessState("ready") StateFailed ProcessState = ProcessState("failed") )
type ProxyManager ¶
func New ¶
func New(config *Config) *ProxyManager
func (*ProxyManager) HandlerFunc ¶ added in v0.0.51
func (pm *ProxyManager) HandlerFunc(w http.ResponseWriter, r *http.Request)
func (*ProxyManager) Run ¶ added in v0.0.51
func (pm *ProxyManager) Run(addr ...string) error
func (*ProxyManager) StopProcesses ¶ added in v0.0.51
func (pm *ProxyManager) StopProcesses()
Click to show internal directories.
Click to hide internal directories.