types

package
v0.0.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package types defines shared data structures and interfaces used across eos packages.

Index

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

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 GetServiceLogFilePathArgs

type GetServiceLogFilePathArgs struct {
	ServiceName string `json:"service_name"`
	ErrorLog    bool   `json:"error_log"`
}

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 RestartServiceArgs struct {
	Name         string `json:"name"`
	GracePeriod  string `json:"grace_period"`
	TickerPeriod string `json:"ticker_period"`
}

type RunningProcess

type RunningProcess struct {
	Cmd  *exec.Cmd `json:"-" yaml:"-"`
	PGID int       `json:"pgid" yaml:"pgid"`
}

type Runtime

type Runtime struct {
	Type string `json:"type" yaml:"type"`
	Path string `json:"path" yaml:"path"`
}

type Service

type Service struct {
	Instance ServiceInstance `json:"instance" yaml:"instance"`
	Config   ServiceConfig   `json:"config" yaml:"config"`
}

type ServiceCatalogEntry

type ServiceCatalogEntry struct {
	CreatedAt      time.Time `json:"created_at" yaml:"created_at"`
	Name           string    `json:"name" yaml:"name"`
	DirectoryPath  string    `json:"path" yaml:"path"`
	ConfigFileName string    `json:"config_file" yaml:"config_file"`
}

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

type StopServiceArgs struct {
	Name         string `json:"name"`
	GracePeriod  string `json:"grace_period"`
	TickerPeriod string `json:"ticker_period"`
}

type UpdateServiceCatalogEntryArgs

type UpdateServiceCatalogEntryArgs struct {
	Name              string `json:"name"`
	NewDirectoryPath  string `json:"new_directory_path"`
	NewConfigFileName string `json:"new_config_file_name"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL