Documentation ¶
Index ¶
- type OsServicer
- type ServiceAction
- type ServiceFunc
- type ServiceOption
- func WithDescription(Description string) ServiceOption
- func WithDisplayName(DisplayName string) ServiceOption
- func WithName(name string) ServiceOption
- func WithRestartFunc(f func(ctx context.Context) error) ServiceOption
- func WithStartFunc(f func(ctx context.Context) error) ServiceOption
- func WithStopFunc(f func(ctx context.Context) error) ServiceOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OsServicer ¶
type OsServicer interface { Start() error Stop() error Install() error Uninstall() error Status() (byte, error) Run() error Control(action ServiceAction) error }
func NewOsService ¶
func NewOsService(opts ...ServiceOption) OsServicer
type ServiceAction ¶
type ServiceAction uint16
const ( ActionRun ServiceAction = 1 << iota ActionStart ActionStop ActionInstall ActionUninstall ActionStatus ActionRestart )
type ServiceFunc ¶
type ServiceOption ¶
type ServiceOption func(opts *internal.ServiceOptions) error
func WithDescription ¶
func WithDescription(Description string) ServiceOption
func WithDisplayName ¶
func WithDisplayName(DisplayName string) ServiceOption
func WithName ¶
func WithName(name string) ServiceOption
func WithRestartFunc ¶
func WithRestartFunc(f func(ctx context.Context) error) ServiceOption
func WithStartFunc ¶
func WithStartFunc(f func(ctx context.Context) error) ServiceOption
func WithStopFunc ¶
func WithStopFunc(f func(ctx context.Context) error) ServiceOption
Click to show internal directories.
Click to hide internal directories.