service

package
v0.0.0-...-a2e018f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Executable

func Executable() (string, error)

Executable returns an absolute path that can be used to re-invoke the current program. It may not be valid after the current program exits.

func ExecutableFolder

func ExecutableFolder() (string, error)

Returns same path as Executable, returns just the folder path. Excludes the executable name and any trailing slash.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service struct

func NewService

func NewService(name string, displayName string, description string, start func(*Service, ...string),
	run func(*Service, ...string),
	stop func(*Service, ...string)) (svr *Service, err error)

NewService invoke new *Service name - ServiceName displayName - ServiceDisplayName description - ServiceDescription start - func(*Service, ...string) implementation, gets invoked when Service Start run - func(*Service, ...string) implementation, gets invoked when Service Run stop - func(*Service, ...string) implementation, gets invoked when Service Stop

func (*Service) Execute

func (svr *Service) Execute(args ...string) (err error)

Execute main Service Execute method when executing Service called in main() func of golang app, args - args from os gets passed into here

func (*Service) IsBroker

func (svr *Service) IsBroker() bool

IsBroker Service

func (*Service) IsConsole

func (svr *Service) IsConsole() bool

IsConsole Service

func (*Service) IsService

func (svr *Service) IsService() bool

IsService Service

func (*Service) ServiceDescription

func (svr *Service) ServiceDescription() string

ServiceDescription Service Description

func (*Service) ServiceDisplayName

func (svr *Service) ServiceDisplayName() string

ServiceDisplayName Service Display Name

func (*Service) ServiceExeFolder

func (svr *Service) ServiceExeFolder() string

ServiceExeFolder local folder where Service Executable resides

func (*Service) ServiceExeName

func (svr *Service) ServiceExeName() string

ServiceExeName Service Executable Name

func (*Service) ServiceName

func (svr *Service) ServiceName() string

ServiceName Service Name

func (*Service) Start

func (svr *Service) Start(s service.Service) error

Start Service

func (*Service) Stop

func (svr *Service) Stop(s service.Service) error

Stop Service

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL