Documentation ¶
Index ¶
- Variables
- func CalcListLimit(size, services, serviceNumber int) int
- func CalcListOffset(size, services, serviceNumber int) int
- func GetServiceIdent(t Type, n int) (ident string)
- func GetServiceName(t Type) string
- func Start(t Type, instantiator func(serviceNumber int) Service, setups ...func(Service))
- type NumberHandler
- type Service
- type ServiceStatus
- type Tools
- type Type
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultServiceNumber = NumberHandler{ // contains filtered or unexported fields }
Functions ¶
func CalcListLimit ¶
CalcListLimit calculates the number of elements that a service may handle without entering in conflict with anothers services.
func CalcListOffset ¶
CalcListOffset calculates the offset of the elements that the service may start handling without entering in conflict with anothers services.
func GetServiceIdent ¶
GetServiceIdent returns the service string identification according to the service type and number.
func GetServiceName ¶
Types ¶
type NumberHandler ¶
type NumberHandler struct {
// contains filtered or unexported fields
}
func (*NumberHandler) Get ¶
func (s *NumberHandler) Get() (n int)
func (*NumberHandler) Release ¶
func (s *NumberHandler) Release(n int)
type Service ¶
type Service interface { Run() Done() <-chan error DispatchDone(error) GetServiceType() Type GetServiceNumber() int GetServiceIdent() string Close() error }
Service is the interface that represent a Nemesys service.
type ServiceStatus ¶
type ServiceStatus struct { // Name is the service name. Name string `json:"name"` // Ident is the service ident. Ident string `json:"-"` // Number is the service number. Number int `json:"number"` // Online is the online status; Online bool `json:"online"` // LastPing is the time of the last ping LastPing time.Time `json:"last-ping"` // LostConnectionTime is the time of the connection lost. LostConnectionTime time.Time `json:"lost-connection-time"` // Type is the service type. Type Type `json:"-"` }
type Tools ¶
type Tools struct { ServiceNumber int ServiceIdent string ServiceType Type // contains filtered or unexported fields }
func (*Tools) DispatchDone ¶
func (*Tools) GetServiceIdent ¶
func (*Tools) GetServiceNumber ¶
func (*Tools) GetServiceType ¶
Click to show internal directories.
Click to hide internal directories.