Documentation
¶
Index ¶
Constants ¶
View Source
const ( ServiceTypeService = "service" ServiceTypeCron = "cron" )
View Source
const ( RestartPolicyAlways = "always" RestartPolicyOnFailure = "on-failure" RestartPolicyNever = "never" )
Variables ¶
View Source
var ErrInvalidConfig = errors.New("invalid config")
View Source
var PatternEnvName = regexp.MustCompile(`^[a-zA-Z_][a-zA-Z0-9_]*$`)
View Source
var PatternRestartPolicy = regexp.MustCompile(`^(always|on-failure|never|exponential)$`)
View Source
var PatternServiceName = regexp.MustCompile(`^[a-zA-Z0-9_-]+$`)
Functions ¶
func ResolveConfigPath ¶ added in v1.1.0
Types ¶
type AdminEntry ¶ added in v1.1.0
func (*AdminEntry) Serialize ¶ added in v1.1.0
func (ae *AdminEntry) Serialize() map[string]any
type Config ¶
type Config struct {
DefaultInitialDelay time.Duration
DefaultGracePeriod time.Duration
Admin *AdminEntry
Services map[string]*ServiceEntry
}
func DeserializeConfig ¶ added in v1.1.0
type RestartPolicy ¶
type RestartPolicy struct {
Mode string
Exponential bool
InitialDelay time.Duration
MaxDelay time.Duration
MaxRetries int
}
func (*RestartPolicy) Serialize ¶ added in v1.1.0
func (rp *RestartPolicy) Serialize() map[string]any
type ServiceEntry ¶ added in v1.1.0
type ServiceEntry struct {
Type string
Command []string
WorkingDir string
Optional bool
Env map[string]string
Restart *RestartPolicy
Cron string
Single bool
GracePeriod time.Duration
}
func (*ServiceEntry) Serialize ¶ added in v1.1.0
func (se *ServiceEntry) Serialize() map[string]any
Click to show internal directories.
Click to hide internal directories.