Documentation
¶
Overview ¶
Package types defines shared data structures and interfaces used across eos packages.
Index ¶
- Constants
- Variables
- type AddServiceCatalogEntryArgs
- type DaemonRequest
- type DaemonResponse
- type ForceStopServiceArgs
- type GetAllServiceInstancesResponse
- type GetMostRecentProcessHistoryEntryArgs
- type GetMostRecentProcessHistoryEntryResponse
- type GetServiceCatalogEntryArgs
- type GetServiceInstanceArgs
- type GetServiceInstanceResponse
- type GetServiceLogFilePathArgs
- type IsServiceRegisteredArgs
- type LogSink
- type MethodName
- type NewServiceLogFilesArgs
- type ProcessHistory
- type ProcessState
- type RemoveServiceCatalogEntryArgs
- type RemoveServiceInstanceArgs
- type RestartServiceArgs
- type RunningProcess
- type Runtime
- type Service
- type ServiceCatalogEntry
- type ServiceConfig
- type ServiceInstance
- type ServiceStatus
- type StartServiceArgs
- type StopServiceArgs
- type UpdateServiceCatalogEntryArgs
Constants ¶
View Source
const ( // MethodGetServiceStatus = "GetServiceStatus" MethodGetServiceInstance = "GetServiceInstance" MethodGetAllServiceInstances = "GetAllServiceInstances" MethodRemoveServiceInstance = "RemoveServiceInstance" MethodForceStopService = "ForceStopService" MethodRestartService = "RestartService" MethodStartService = "StartService" MethodStopService = "StopService" MethodAddServiceCatalogEntry = "AddServiceCatalogEntry" MethodGetAllServiceCatalogEntries = "GetAllServiceCatalogEntries" MethodGetServiceCatalogEntry = "GetServiceCatalogEntry" MethodIsServiceRegistered = "IsServiceRegistered" MethodRemoveServiceCatalogEntry = "RemoveServiceCatalogEntry" MethodUpdateServiceCatalogEntry = "UpdateServiceCatalogEntry" MethodGetMostRecentProcessHistoryEntry = "GetMostRecentProcessHistoryEntry" MethodNewServiceLogFiles = "NewServiceLogFiles" MethodGetServiceLogFilePath = "GetServiceLogFilePath" )
Variables ¶
View Source
var ValidMethods = map[MethodName]bool{ MethodGetServiceInstance: true, MethodRemoveServiceInstance: true, MethodGetAllServiceInstances: true, MethodForceStopService: true, MethodRestartService: true, MethodStartService: true, MethodStopService: true, MethodAddServiceCatalogEntry: true, MethodGetAllServiceCatalogEntries: true, MethodGetServiceCatalogEntry: true, MethodIsServiceRegistered: true, MethodRemoveServiceCatalogEntry: true, MethodUpdateServiceCatalogEntry: true, MethodGetMostRecentProcessHistoryEntry: true, MethodNewServiceLogFiles: true, MethodGetServiceLogFilePath: true, }
Functions ¶
This section is empty.
Types ¶
type AddServiceCatalogEntryArgs ¶
type AddServiceCatalogEntryArgs struct {
Service *ServiceCatalogEntry `json:"service"`
}
type DaemonRequest ¶
type DaemonRequest struct {
Method MethodName `json:"method"`
Args json.RawMessage `json:"args"`
}
func (*DaemonRequest) Validate ¶
func (r *DaemonRequest) Validate() error
type DaemonResponse ¶
type DaemonResponse struct {
Error string `json:"error,omitempty"`
ErrorCode string `json:"error_code,omitempty"`
Data json.RawMessage `json:"data,omitempty"`
Success bool `json:"success"`
}
type ForceStopServiceArgs ¶
type ForceStopServiceArgs struct {
Name string `json:"name"`
}
type GetAllServiceInstancesResponse ¶
type GetAllServiceInstancesResponse struct {
Instances []ServiceInstance `json:"instances"`
}
type GetMostRecentProcessHistoryEntryArgs ¶
type GetMostRecentProcessHistoryEntryArgs struct {
Name string `json:"name"`
}
type GetMostRecentProcessHistoryEntryResponse ¶
type GetMostRecentProcessHistoryEntryResponse struct {
ProcessEntry ProcessHistory `json:"process_entry"`
}
type GetServiceCatalogEntryArgs ¶
type GetServiceCatalogEntryArgs struct {
Name string `json:"name"`
}
type GetServiceInstanceArgs ¶
type GetServiceInstanceArgs struct {
Name string `json:"name"`
}
type GetServiceInstanceResponse ¶
type GetServiceInstanceResponse struct {
Instance ServiceInstance `json:"instance"`
}
type IsServiceRegisteredArgs ¶
type IsServiceRegisteredArgs struct {
Name string `json:"name"`
}
type LogSink ¶
type LogSink struct {
Options map[string]any `json:"options,omitempty" yaml:"options,omitempty"`
Type string `json:"type" yaml:"type"`
Mode string `json:"mode" yaml:"mode"`
Address string `json:"address" yaml:"address"`
Exec string `json:"exec,omitempty" yaml:"exec,omitempty"`
Args []string `json:"args,omitempty" yaml:"args,omitempty"`
Streams []string `json:"streams,omitempty" yaml:"streams,omitempty"`
BufferSize int `json:"buffer_size,omitempty" yaml:"buffer_size,omitempty"`
RestartDelayMs int `json:"restart_delay_ms,omitempty" yaml:"restart_delay_ms,omitempty"`
}
LogSink declares an external log sink plugin for a service. eos manages Type, Exec, BufferSize, RestartDelayMs, and Streams. Options is an opaque blob passed to the plugin via EOS_SINK_OPTIONS env var. Mode and Address are required: mode is "push" or "serve"; address is the remote URL (push) or bind address (serve) passed to the plugin via EOS_SINK_ADDRESS.
type MethodName ¶
type MethodName string
type NewServiceLogFilesArgs ¶
type NewServiceLogFilesArgs struct {
ServiceName string `json:"service_name"`
}
type ProcessHistory ¶
type ProcessHistory struct {
CreatedAt time.Time `json:"created_at" yaml:"created_at"`
Error *string `json:"error,omitempty" yaml:"error,omitempty"`
StartedAt *time.Time `json:"started_at,omitempty" yaml:"started_at,omitempty"`
StoppedAt *time.Time `json:"stopped_at,omitempty" yaml:"stopped_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty" yaml:"updated_at,omitempty"`
ServiceName string `json:"service_name" yaml:"service_name"`
State ProcessState `json:"state" yaml:"state"`
RssMemoryKb int64 `json:"rss_memory_kb" yaml:"rss_memory_kb"`
PGID int `json:"pgid" yaml:"pgid"`
}
type ProcessState ¶
type ProcessState string
const ( ProcessStateUnknown ProcessState = "unknown" ProcessStateStopped ProcessState = "stopped" ProcessStateStarting ProcessState = "starting" ProcessStateRunning ProcessState = "running" ProcessStateFailed ProcessState = "failed" )
type RemoveServiceCatalogEntryArgs ¶
type RemoveServiceCatalogEntryArgs struct {
Name string `json:"name"`
}
type RemoveServiceInstanceArgs ¶
type RemoveServiceInstanceArgs struct {
Name string `json:"name"`
}
type RestartServiceArgs ¶
type RunningProcess ¶
type Service ¶
type Service struct {
Instance ServiceInstance `json:"instance" yaml:"instance"`
Config ServiceConfig `json:"config" yaml:"config"`
}
type ServiceCatalogEntry ¶
type ServiceConfig ¶
type ServiceConfig struct {
Runtime Runtime `json:"runtime" yaml:"runtime"`
Name string `json:"name" yaml:"name"`
Command string `json:"command" yaml:"command"`
EnvFile string `json:"env_file,omitempty" yaml:"env_file,omitempty"`
LogSinks []LogSink `json:"log_sinks,omitempty" yaml:"log_sinks,omitempty"`
Port int `json:"port,omitempty" yaml:"port,omitempty"`
MemoryLimitMb int `json:"memory_limit_mb,omitempty" yaml:"memory_limit_mb,omitempty"`
}
type ServiceInstance ¶
type ServiceInstance struct {
CreatedAt time.Time `json:"created_at" yaml:"created_at"`
LastHealthCheck *time.Time `json:"last_health_check,omitempty" yaml:"last_health_check,omitempty"`
StartedAt *time.Time `json:"started_at,omitempty" yaml:"started_at,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty" yaml:"updated_at,omitempty"`
Name string `json:"name" yaml:"name"`
RestartCount int `json:"restart_count,omitempty" yaml:"restart_count,omitempty"`
}
type ServiceStatus ¶
type ServiceStatus string
const ( ServiceStatusUnknown ServiceStatus = "unknown" ServiceStatusStopped ServiceStatus = "stopped" ServiceStatusStarting ServiceStatus = "starting" ServiceStatusRunning ServiceStatus = "running" ServiceStatusFailed ServiceStatus = "failed" )
type StartServiceArgs ¶
type StartServiceArgs struct {
Name string `json:"name"`
}
type StopServiceArgs ¶
Click to show internal directories.
Click to hide internal directories.