Documentation
¶
Overview ¶
Package plan defines the various types to work with the Pebble plan and layers.
This is a subset of the types in github.com/canonical/pebble/internal/plan, copied directly from that repository.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Check ¶
type Check struct {
// Basic details
Name string `yaml:"-"`
Override Override `yaml:"override,omitempty"`
Level CheckLevel `yaml:"level,omitempty"`
// Common check settings
Period OptionalDuration `yaml:"period,omitempty"`
Timeout OptionalDuration `yaml:"timeout,omitempty"`
Threshold int `yaml:"threshold,omitempty"`
// Type-specific check settings (only one of these can be set)
HTTP *HTTPCheck `yaml:"http,omitempty"`
TCP *TCPCheck `yaml:"tcp,omitempty"`
Exec *ExecCheck `yaml:"exec,omitempty"`
}
Check specifies configuration for a single health check.
type CheckLevel ¶
type CheckLevel string
CheckLevel specifies the optional check level.
const ( UnsetLevel CheckLevel = "" AliveLevel CheckLevel = "alive" ReadyLevel CheckLevel = "ready" )
type ExecCheck ¶
type ExecCheck struct {
Command string `yaml:"command,omitempty"`
Environment map[string]string `yaml:"environment,omitempty"`
UserID *int `yaml:"user-id,omitempty"`
User string `yaml:"user,omitempty"`
GroupID *int `yaml:"group-id,omitempty"`
Group string `yaml:"group,omitempty"`
WorkingDir string `yaml:"working-dir,omitempty"`
}
ExecCheck holds the configuration for an exec health check.
type HTTPCheck ¶
type HTTPCheck struct {
URL string `yaml:"url,omitempty"`
Headers map[string]string `yaml:"headers,omitempty"`
}
HTTPCheck holds the configuration for an HTTP health check.
type OptionalDuration ¶
func (OptionalDuration) IsZero ¶
func (o OptionalDuration) IsZero() bool
func (OptionalDuration) MarshalYAML ¶
func (o OptionalDuration) MarshalYAML() (interface{}, error)
func (*OptionalDuration) UnmarshalYAML ¶
func (o *OptionalDuration) UnmarshalYAML(value *yaml.Node) error
type OptionalFloat ¶
func (OptionalFloat) IsZero ¶
func (o OptionalFloat) IsZero() bool
func (OptionalFloat) MarshalYAML ¶
func (o OptionalFloat) MarshalYAML() (interface{}, error)
func (*OptionalFloat) UnmarshalYAML ¶
func (o *OptionalFloat) UnmarshalYAML(value *yaml.Node) error
type Override ¶
type Override string
Override specifies the layer override mechanism (for services and checks).
type Service ¶
type Service struct {
// Basic details
Name string `yaml:"-"`
Summary string `yaml:"summary,omitempty"`
Description string `yaml:"description,omitempty"`
Startup ServiceStartup `yaml:"startup,omitempty"`
Override Override `yaml:"override,omitempty"`
Command string `yaml:"command,omitempty"`
// Service dependencies
After []string `yaml:"after,omitempty"`
Before []string `yaml:"before,omitempty"`
Requires []string `yaml:"requires,omitempty"`
// Options for command execution
Environment map[string]string `yaml:"environment,omitempty"`
UserID *int `yaml:"user-id,omitempty"`
User string `yaml:"user,omitempty"`
GroupID *int `yaml:"group-id,omitempty"`
Group string `yaml:"group,omitempty"`
// Auto-restart and backoff functionality
KillDelay OptionalDuration `yaml:"kill-delay,omitempty"`
OnSuccess ServiceAction `yaml:"on-success,omitempty"`
OnFailure ServiceAction `yaml:"on-failure,omitempty"`
OnCheckFailure map[string]ServiceAction `yaml:"on-check-failure,omitempty"`
BackoffDelay OptionalDuration `yaml:"backoff-delay,omitempty"`
BackoffFactor OptionalFloat `yaml:"backoff-factor,omitempty"`
BackoffLimit OptionalDuration `yaml:"backoff-limit,omitempty"`
}
type ServiceAction ¶
type ServiceAction string
const ( ActionUnset ServiceAction = "" ActionRestart ServiceAction = "restart" ActionShutdown ServiceAction = "shutdown" ActionIgnore ServiceAction = "ignore" )
type ServiceStartup ¶
type ServiceStartup string
const ( StartupUnknown ServiceStartup = "" StartupEnabled ServiceStartup = "enabled" StartupDisabled ServiceStartup = "disabled" )
Click to show internal directories.
Click to hide internal directories.