Documentation
¶
Overview ¶
Package service handles interfacing with systemd.
Index ¶
- Variables
- func LoadCred(dir, name string) ([]byte, error)
- func UnmarshalYAMLCred(dir, name string, dst interface{}) error
- type Service
- func (s Service) CredPath(name string) string
- func (s Service) Journal() logr.Logger
- func (s Service) Listeners() []net.Listener
- func (s Service) LoadCred(name string) ([]byte, error)
- func (s Service) MarkReady() error
- func (s Service) MarkStatus(status string) error
- func (s Service) MarkStopping() error
- func (s Service) RunNotify(ctx context.Context) error
- func (s Service) RuntimeDirectory() string
- func (s Service) StateDirectory() string
- func (s Service) UnmarshalYAMLCred(name string, dst interface{}) error
Constants ¶
This section is empty.
Variables ¶
var ErrEnvMissing = errors.New("env var unset")
ErrEnvMissing indicates a required environment variable is not set.
Functions ¶
func UnmarshalYAMLCred ¶ added in v0.0.7
UnmarshalYAMLCred unmarshals the YAML credential file called name into dst.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service allows interfacing with systemd.
func (Service) CredPath ¶ added in v0.0.5
CredPath returns the path credentials that contains systemd credentials.
func (Service) Journal ¶
Journal returns a logr.Logger that writes structured logs to the systemd journal.
func (Service) MarkStatus ¶
MarkStatus tells systemd that this service has the given status.
func (Service) MarkStopping ¶
MarkStopping tells systemd that this service is about to stop.
func (Service) RunNotify ¶ added in v0.0.3
RunNotify marks the service as running, blocks until the given context is cancelled and then marks the service as shutting down.
func (Service) RuntimeDirectory ¶ added in v0.0.5
RuntimeDirectory is the runtime directory set by systemd. Panics if not set by systemd.
func (Service) StateDirectory ¶ added in v0.0.5
StateDirectory is the state directory set by systemd. Panics if not set by systemd.
func (Service) UnmarshalYAMLCred ¶ added in v0.0.7
UnmarshalYAMLCred unmarshals the YAML credential file called name into dst.