Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegistrationsMap ¶
func RegistrationsMap() map[Type][]*Registration
RegistrationsMap returns map with all service registrations
Types ¶
type GrpcServer ¶
GrpcServer manages start and stop opeerations of the gRPC server
type GrpcService ¶
GrpcService allows GRPC services to be registered with the underlying server
type Registration ¶
type Registration struct { ID string Type Type InitFunc func(registryCtx *ServiceRegistryContext) (interface{}, error) }
Registration holds service's information that will be added to the registry
func (*Registration) Init ¶
func (r *Registration) Init(rc *ServiceRegistryContext) *ServiceInfo
Init the registered plugin
type ServiceInfo ¶
type ServiceInfo struct { Config interface{} Registration *Registration // contains filtered or unexported fields }
ServiceInfo holds service information
func (*ServiceInfo) Err ¶
func (p *ServiceInfo) Err() error
Err returns the errors during initialization. returns nil if not error was encountered
func (*ServiceInfo) Instance ¶
func (p *ServiceInfo) Instance() (interface{}, error)
Instance returns the instance and any initialization error of the plugin
type ServiceRegistryContext ¶
type ServiceRegistryContext struct { Context context.Context Config interface{} Registration *Registration // contains filtered or unexported fields }
ServiceRegistryContext holds information for the service's registry context
func NewContext ¶
func NewContext(ctx context.Context, config interface{}, r *Registration, services *Set) *ServiceRegistryContext
NewContext returns a new registry ServiceRegistryContext
func (*ServiceRegistryContext) Get ¶
func (i *ServiceRegistryContext) Get(t Type) (interface{}, error)
Get returns the first service by its type
func (*ServiceRegistryContext) GetAll ¶
func (i *ServiceRegistryContext) GetAll() []*ServiceInfo
GetAll services in the set
func (*ServiceRegistryContext) GetByType ¶
func (i *ServiceRegistryContext) GetByType(t Type) (map[string]*ServiceInfo, error)
GetByType returns all services with the specific type.
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
Set defines a plugin collection, used with RegistryContext.
This maintains ordering and unique indexing over the set.
func NewServiceInfoSet ¶
func NewServiceInfoSet() *Set
NewServiceInfoSet returns an initialized service info set
func (*Set) GetAll ¶
func (ps *Set) GetAll(t Type) []*ServiceInfo
GetAll returns all service infos by a type
type Type ¶
type Type string
Type is the type of the service in the registry
const ( // EventsManagerService implements THE events manager service EventsManagerService Type = "container-management.service.events.manager.v1" // NetworkManagerService implements THE network manager service NetworkManagerService Type = "container-management.service.net.manager.v1" // ContainerClientService implements THE containers API client service ContainerClientService Type = "container-management.service.ctrs.client.v1" // ContainerManagerService implements THE container manager service ContainerManagerService Type = "container-management.service.ctrs.manager.v1" // SystemInfoService implements THE system information service SystemInfoService Type = "container-management.service.system.info.v1" // ThingsContainerManagerService implements THE container management via the IoT Rollouts and IoT Things services ThingsContainerManagerService Type = "container-management.service.things.ctrs.manager.v1" // GRPCService implements a grpc service GRPCService Type = "container-management.service.grpc.v1" // GRPCServer implements a grpc server GRPCServer Type = "container-management.server.grpc.v1" // DeploymentManagerService implements THE container deployment manager service DeploymentManagerService Type = "container-management.service.deployment.ctrs.manager.v1" // UpdateAgentService implements the UpdateAgent API for containers domain UpdateAgentService Type = "container-management.service.ctrs.updateagent.v1" )