Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandlePanic ¶
HandlePanic helper method to handle panics
func ParseKeyValuePairs ¶ added in v0.5.8
ParseKeyValuePairs get key-value map from "key=value,key1=value1" str, if value have , please use quotes
func URLStringToFilePath ¶
URLStringToFilePath convert fileURL to file path
Types ¶
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator represents a UUID generator that generates UUIDs in sequence from a random starting point.
func NewGenerator ¶
NewGenerator returns a new Generator. It can fail if the crypto/rand read fails.
func (*Generator) Next ¶
Next returns the next UUID from the generator. Only the first 8 bytes can differ from the previous UUID, so taking a slice of the first 16 bytes is sufficient to provide a somewhat less secure 128 bit UUID.
It is OK to call this method concurrently.
func (*Generator) NextAsString ¶
NextAsString returns the next UUID from the generator as a string.
type ServiceConfig ¶
type ServiceConfig struct { Name string `json:"name"` Enabled bool `json:"enabled"` Settings map[string]string `json:"settings,omitempty"` }
ServiceConfig is a simple service configuration object
type ServiceManager ¶
type ServiceManager struct {
// contains filtered or unexported fields
}
ServiceManager is a simple service manager
func GetDefaultServiceManager ¶
func GetDefaultServiceManager() *ServiceManager
func NewServiceManager ¶
func NewServiceManager() *ServiceManager
NewServiceManager creates a new ServiceManager
func (*ServiceManager) GetService ¶
func (sm *ServiceManager) GetService(name string) Service
GetService gets specified Service
func (*ServiceManager) RegisterService ¶
func (sm *ServiceManager) RegisterService(service Service) error
RegisterService registers the specified service
func (*ServiceManager) Services ¶
func (sm *ServiceManager) Services() []Service
Services gets all the registered Service Services
func (*ServiceManager) Start ¶
func (sm *ServiceManager) Start() error
Start implements util.Managed.Start()
func (*ServiceManager) Stop ¶
func (sm *ServiceManager) Stop() error
Stop implements util.Managed.Stop()