Documentation
¶
Index ¶
- type Inventa
- func (r *Inventa) CallSync(serviceChannel string, method string, args []string, timeout time.Duration) ([]string, error)
- func (r *Inventa) DiscoverServices()
- func (r *Inventa) GetAllActiveServices() ([]ServiceDescriptor, error)
- func (r *Inventa) IsServiceActive(serviceFullId string) bool
- func (r *Inventa) Start() (context.CancelFunc, error)
- func (r *Inventa) TryRegisterToOrchestrator(orchestratorFullId string, tryCount int, timeout time.Duration) error
- type InventaRole
- type RPCCallRequest
- type RPCCallResponse
- type RPCCommandFn
- type ServiceConsumer
- type ServiceDescriptor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Inventa ¶
type Inventa struct { sync.Mutex Ctx context.Context Client *redis.Client SelfDescriptor ServiceDescriptor InventaRole InventaRole RPCCommandFnRegistry map[string]RPCCommandFn OrchestratorDescriptor ServiceDescriptor IsOrchestratorActive bool IsRegistered bool OnServiceRegistering func(serviceDescriptor ServiceDescriptor) error OnServiceUnregistering func(serviceDescriptor ServiceDescriptor, isZombie bool) error // contains filtered or unexported fields }
func NewInventa ¶
func NewInventa(host string, port int, password string, serviceType string, serviceId string, inventaRole InventaRole, rpcCommandFnRegistry map[string]RPCCommandFn) *Inventa
func (*Inventa) DiscoverServices ¶
func (r *Inventa) DiscoverServices()
func (*Inventa) GetAllActiveServices ¶
func (r *Inventa) GetAllActiveServices() ([]ServiceDescriptor, error)
func (*Inventa) IsServiceActive ¶
type InventaRole ¶
type InventaRole byte
const ( InventaRoleOrchestrator InventaRole = 1 InventaRoleService InventaRole = 2 )
type RPCCallRequest ¶
type RPCCallRequest struct { CallId string FromService ServiceDescriptor Method string Args []string }
func (*RPCCallRequest) Decode ¶
func (r *RPCCallRequest) Decode(raw string) error
func (*RPCCallRequest) Encode ¶
func (r *RPCCallRequest) Encode() string
func (*RPCCallRequest) ErrorResponse ¶
func (r *RPCCallRequest) ErrorResponse(err error) []string
type RPCCallResponse ¶
type RPCCallResponse struct { CallId string FromService ServiceDescriptor Data []string }
func (*RPCCallResponse) Decode ¶
func (r *RPCCallResponse) Decode(raw string) error
func (*RPCCallResponse) Encode ¶
func (r *RPCCallResponse) Encode() string
type RPCCommandFn ¶
type RPCCommandFn func(req *RPCCallRequest) []string
type ServiceConsumer ¶
type ServiceConsumer struct { SelfDescriptor ServiceDescriptor Inventa *Inventa }
func (ServiceConsumer) IsActive ¶
func (s ServiceConsumer) IsActive() bool
type ServiceDescriptor ¶
func ParseServiceFullId ¶
func ParseServiceFullId(serviceFullId string) (ServiceDescriptor, error)
func (*ServiceDescriptor) Decode ¶
func (d *ServiceDescriptor) Decode(serviceFullId string) error
func (*ServiceDescriptor) Encode ¶
func (d *ServiceDescriptor) Encode() string
func (*ServiceDescriptor) GetPubSubChannelName ¶
func (d *ServiceDescriptor) GetPubSubChannelName() string
Click to show internal directories.
Click to hide internal directories.