Documentation
¶
Index ¶
- Constants
- Variables
- func DisplayColumnEqual(v1, v2 DisplayColumn) bool
- func DisplayColumnIsEmpty(v DisplayColumn) bool
- func EvaluateConditions(conditions []ServiceCondition, verbose bool) (res bool, err error)
- func ServiceConfigUnit(path string) string
- func ServiceDirByName(name string) (string, error)
- func ServiceDirFromUnit(u string) string
- func ServiceFileByName(name string) (string, error)
- func ServiceNameFromFile(service_file string) (string, error)
- func ServiceRealpath(service_dir string) (string, error)
- func ServiceUnit(path string) string
- func ServiceUnitByName(name string) (string, error)
- type CaddyConfig
- type CommandRunnerDisplayCol
- type ConfigValue
- type ConfigValueKind
- type DisplayColumn
- type DisplayColumnData
- type HelpFlag
- type Hook
- type InheritFile
- type InheritFileBase
- type InheritedFile
- type InheritedFileSingle
- type Service
- func (service *Service) ComputeId(extra string) (string, error)
- func (service *Service) ComputeIdData(extra string) ([]byte, error)
- func (s *Service) EvaluateCondition(verbose bool) (condition bool, disable bool, err error)
- func (service *Service) FillDefaults() error
- func (s *Service) GetDisplayColumn(c DisplayColumn, runner CommandRunnerDisplayCol) (string, error)
- func (service *Service) PartId(part string) (string, error)
- func (service *Service) Parts() ([]string, error)
- func (service *Service) ProxyConfig() (caddy.ConfigItems, error)
- func (service *Service) UnitStatus(ctx context.Context) (dbus.UnitStatus, error)
- func (service *Service) Vars() []string
- type ServiceCommand
- type ServiceCondition
- type ServiceFunction
- func (f *ServiceFunction) CaddyConfig(service *Service, name string) (json.RawMessage, error)
- func (f *ServiceFunction) CaddyConfigName(service *Service, name string) string
- func (f *ServiceFunction) FillDefaults(service *Service) error
- func (f *ServiceFunction) IsSingle() bool
- func (f *ServiceFunction) ReverseProxy(service *Service) (res []ServiceFunctionProxyConfig, err error)
- func (f *ServiceFunction) ReverseProxyConfigs(service *Service) (configs caddy.ConfigItems, err error)
- type ServiceFunctionProxyConfig
- type ServiceFunctions
- func (functions *ServiceFunctions) FillDefaults(service *Service) error
- func (functions *ServiceFunctions) FindFunction(name string) *ServiceFunction
- func (functions *ServiceFunctions) FindMainFunction() *ServiceFunction
- func (functions *ServiceFunctions) FixPaths(dir string) error
- func (functions *ServiceFunctions) UnmarshalJSON(data []byte) error
- type ServicePod
- type ServicePodProxyConfig
- type ServicePods
Constants ¶
View Source
const ( ConfigValueNull = 0 ConfigValueString = iota ConfigValueTrue ConfigValueFalse )
View Source
const ConfigName = "conductor-service.json"
Variables ¶
View Source
var ServiceDirs = dirs.MultiJoin("services", append([]string{dirs.SelfRuntimeDir}, append(dirs.SelfConfigDirs, dirs.SelfDataDirs...)...)...)
Functions ¶
func DisplayColumnEqual ¶ added in v0.0.48
func DisplayColumnEqual(v1, v2 DisplayColumn) bool
func DisplayColumnIsEmpty ¶ added in v0.0.48
func DisplayColumnIsEmpty(v DisplayColumn) bool
func EvaluateConditions ¶ added in v0.0.48
func EvaluateConditions(conditions []ServiceCondition, verbose bool) (res bool, err error)
func ServiceConfigUnit ¶
func ServiceDirByName ¶
func ServiceDirFromUnit ¶
func ServiceFileByName ¶
func ServiceNameFromFile ¶
func ServiceRealpath ¶
func ServiceUnit ¶
func ServiceUnitByName ¶
Types ¶
type CaddyConfig ¶
type CaddyConfig struct {
ApiEndpoint string `json:"api_endpoint"`
}
type CommandRunnerDisplayCol ¶ added in v0.0.48
type CommandRunnerDisplayCol interface {
RunCommandGetValue(c *ServiceCommand, cmd_name string, args ...string) (string, error)
}
type ConfigValue ¶ added in v0.0.24
type ConfigValue struct {
Kind ConfigValueKind
Str string
}
func (*ConfigValue) MarshalJSON ¶ added in v0.0.24
func (v *ConfigValue) MarshalJSON() ([]byte, error)
func (*ConfigValue) String ¶ added in v0.0.24
func (v *ConfigValue) String() string
func (*ConfigValue) UnmarshalJSON ¶ added in v0.0.24
func (v *ConfigValue) UnmarshalJSON(data []byte) error
type ConfigValueKind ¶ added in v0.0.24
type ConfigValueKind int
type DisplayColumn ¶ added in v0.0.48
type DisplayColumn struct {
DisplayColumnData
}
func (*DisplayColumn) MarshalJSON ¶ added in v0.0.48
func (c *DisplayColumn) MarshalJSON() ([]byte, error)
func (*DisplayColumn) UnmarshalJSON ¶ added in v0.0.48
func (c *DisplayColumn) UnmarshalJSON(data []byte) error
type DisplayColumnData ¶ added in v0.0.48
type InheritFile ¶ added in v0.0.15
type InheritFile struct {
InheritFileBase
Inherit *InheritedFile
}
func (*InheritFile) UnmarshalJSON ¶ added in v0.0.15
func (f *InheritFile) UnmarshalJSON(data []byte) error
type InheritFileBase ¶ added in v0.0.15
type InheritedFile ¶ added in v0.0.15
type InheritedFile struct {
Inherit []*InheritFile `json:"inherit"`
}
func DecodeInherit ¶ added in v0.0.15
func DecodeInherit(data []byte, dir string) (*InheritedFile, error)
type InheritedFileSingle ¶ added in v0.0.15
type InheritedFileSingle struct {
Inherit *InheritFile `json:"inherit"`
}
type Service ¶
type Service struct {
BasePath string `json:"-"`
FileName string `json:"-"`
ConfigSetFile string `json:"-"`
Name string `json:"-"`
Id string `json:"-"`
Inherit *InheritedFile `json:"-"`
AppName string `json:"app_name,omitempty"` // my-app
InstanceName string `json:"instance_name,omitempty"` // staging
Disable *bool `json:"disable"`
Conditions []ServiceCondition `json:"conditions"`
Config map[string]*ConfigValue `json:"config,omitempty"` // key-value pairs for config and templating, CHANNEL=staging
ProxyConfigTemplate string `json:"proxy_config_template,omitempty"` // Template file for the load-balancer config
Pods ServicePods `json:"pods,omitempty"`
Functions ServiceFunctions `json:"functions,omitempty"`
Hooks []*Hook `json:"hooks,omitempty"`
CaddyLoadBalancer CaddyConfig `json:"caddy_load_balancer"`
DisplayServiceConfig []DisplayColumn `json:"display_service_config"`
DisplayServiceDepConfig *[]DisplayColumn `json:"display_service_deployment_config"`
DisplayDeploymentConfig []DisplayColumn `json:"display_deployment_config"`
Commands map[string]*ServiceCommand `json:"commands"`
}
func LoadServiceByName ¶
func LoadServiceDir ¶
func LoadServiceFile ¶
func (*Service) ComputeIdData ¶ added in v0.0.45
func (*Service) EvaluateCondition ¶ added in v0.0.48
func (*Service) FillDefaults ¶
func (*Service) GetDisplayColumn ¶ added in v0.0.48
func (s *Service) GetDisplayColumn(c DisplayColumn, runner CommandRunnerDisplayCol) (string, error)
func (*Service) ProxyConfig ¶ added in v0.0.45
func (service *Service) ProxyConfig() (caddy.ConfigItems, error)
func (*Service) UnitStatus ¶ added in v0.0.15
type ServiceCommand ¶ added in v0.0.15
type ServiceCommand struct {
Deployment bool `json:"deployment"`
Service bool `json:"service"`
ServiceAnyDeployment bool `json:"service_any_deployment"`
Description string `json:"description"`
Exec []string `json:"exec"`
HelpFlags [][]string `json:"help_flags"`
HelpArgs []string `json:"help_args"`
}
func (*ServiceCommand) GetHelpFlags ¶ added in v0.0.15
func (c *ServiceCommand) GetHelpFlags() []HelpFlag
func (*ServiceCommand) GetTabbedHelpFlags ¶ added in v0.0.15
func (c *ServiceCommand) GetTabbedHelpFlags() *utils.Tabbed
type ServiceCondition ¶ added in v0.0.48
type ServiceCondition struct {
Hostname *string `json:"hostname"`
}
type ServiceFunction ¶ added in v0.0.29
type ServiceFunction struct {
Name string `json:"name"`
ServiceDirectives []string `json:"service_directives,omitempty"`
Format string `json:"format,omitempty"` // Format: cgi, http-stdio, sdactivate
Exec []string `json:"exec,omitempty"`
StderrAsStdout bool `json:"stderr_as_stdout,omitempty"`
ResponseHeaders []string `json:"response_headers,omitempty"` // Additional response headers
NoResponseHeaders bool `json:"no_response_headers,omitempty"` // Function does not add response headers
PathInfoStrip int `json:"path_info_strip,omitempty"` // Strip this number of leading elements from PATH_INFO
Policies []string `json:"policies,omitempty"` // Policies to match
ProvidedReverseProxy []ServiceFunctionProxyConfig `json:"reverse_proxy"`
DefaultReverseProxy *bool `json:"default_reverse_proxy,omitempty"`
}
func (*ServiceFunction) CaddyConfig ¶ added in v0.0.45
func (f *ServiceFunction) CaddyConfig(service *Service, name string) (json.RawMessage, error)
func (*ServiceFunction) CaddyConfigName ¶ added in v0.0.45
func (f *ServiceFunction) CaddyConfigName(service *Service, name string) string
func (*ServiceFunction) FillDefaults ¶ added in v0.0.45
func (f *ServiceFunction) FillDefaults(service *Service) error
func (*ServiceFunction) IsSingle ¶ added in v0.0.45
func (f *ServiceFunction) IsSingle() bool
func (*ServiceFunction) ReverseProxy ¶ added in v0.0.45
func (f *ServiceFunction) ReverseProxy(service *Service) (res []ServiceFunctionProxyConfig, err error)
func (*ServiceFunction) ReverseProxyConfigs ¶ added in v0.0.45
func (f *ServiceFunction) ReverseProxyConfigs(service *Service) (configs caddy.ConfigItems, err error)
type ServiceFunctionProxyConfig ¶ added in v0.0.45
type ServiceFunctionProxyConfig struct {
Name string `json:"name"`
MountPoint string `json:"mount_point,omitempty"`
Route json.RawMessage `json:"route,omitempty"` // if unspecified, generate default, if false, do not generate Route
UpstreamsPath string `json:"upstreams_path"`
}
type ServiceFunctions ¶ added in v0.0.29
type ServiceFunctions []*ServiceFunction
func (*ServiceFunctions) FillDefaults ¶ added in v0.0.29
func (functions *ServiceFunctions) FillDefaults(service *Service) error
func (*ServiceFunctions) FindFunction ¶ added in v0.0.29
func (functions *ServiceFunctions) FindFunction(name string) *ServiceFunction
func (*ServiceFunctions) FindMainFunction ¶ added in v0.0.29
func (functions *ServiceFunctions) FindMainFunction() *ServiceFunction
func (*ServiceFunctions) FixPaths ¶ added in v0.0.29
func (functions *ServiceFunctions) FixPaths(dir string) error
func (*ServiceFunctions) UnmarshalJSON ¶ added in v0.0.29
func (functions *ServiceFunctions) UnmarshalJSON(data []byte) error
type ServicePod ¶ added in v0.0.20
type ServicePod struct {
Name string `json:"name"`
ServiceDirectives []string `json:"service_directives,omitempty"`
PodTemplate string `json:"pod_template,omitempty"` // Template file for pod
ConfigMapTemplate string `json:"config_map_template,omitempty"` // ConfigMap template file
ProvidedReverseProxy []ServicePodProxyConfig `json:"reverse_proxy"`
}
func (*ServicePod) CaddyConfigName ¶ added in v0.0.45
func (pod *ServicePod) CaddyConfigName(service *Service, name string) string
func (*ServicePod) ReverseProxy ¶ added in v0.0.45
func (pod *ServicePod) ReverseProxy(service *Service) (res []ServicePodProxyConfig, err error)
func (*ServicePod) ReverseProxyConfigs ¶ added in v0.0.45
func (pod *ServicePod) ReverseProxyConfigs(service *Service) (configs caddy.ConfigItems, err error)
type ServicePodProxyConfig ¶ added in v0.0.45
type ServicePods ¶ added in v0.0.20
type ServicePods []*ServicePod
func (*ServicePods) FillDefaults ¶ added in v0.0.20
func (pods *ServicePods) FillDefaults(service *Service) error
func (*ServicePods) FindMainPod ¶ added in v0.0.20
func (pods *ServicePods) FindMainPod() *ServicePod
func (*ServicePods) FindPod ¶ added in v0.0.20
func (pods *ServicePods) FindPod(name string) *ServicePod
func (*ServicePods) FixPaths ¶ added in v0.0.20
func (pods *ServicePods) FixPaths(dir string) error
func (*ServicePods) UnmarshalJSON ¶ added in v0.0.20
func (pods *ServicePods) UnmarshalJSON(data []byte) error
Click to show internal directories.
Click to hide internal directories.