Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseEvent ¶
type BaseEvent struct {
// contains filtered or unexported fields
}
BaseEvent is a base struct for creating an Event
func NewBaseEvent ¶
NewBaseEvent creates a new BaseEvent
type Client ¶
type Client interface { ErrorChannel() <-chan error EventChannel() <-chan Event Context() context.Context Close() }
Client is an unified interface for GRPC monitoring API client
func NewClient ¶
func NewClient(cc *grpc.ClientConn, eventFactory EventFactory, streamConstructor EventStreamConstructor) (Client, error)
NewClient creates a new Client on given GRPC connection with given EventFactory and EventStreamConstructor
type Event ¶
type Event interface { EventType() EventType Entities() map[string]Entity Message() (interface{}, error) // A caller context to use with opentracing. Context() context.Context }
Event is an unified interface for GRPC monitoring API event
type EventFactory ¶
type EventFactory interface { NewEvent(ctx context.Context, eventType EventType, entities map[string]Entity) Event EventFromMessage(ctx context.Context, message interface{}) (Event, error) FactoryName() string }
EventFactory is an interface for Event factory
type EventStream ¶
EventStream is an unified interface for blocking receiver
type EventStreamConstructor ¶
type EventStreamConstructor func(ctx context.Context, cc *grpc.ClientConn) (EventStream, error)
EventStreamConstructor is a type for EventStream constructor
type EventType ¶
type EventType string
EventType is an enum for event types
const ( // EventTypeInitialStateTransfer is a type of the event sent to recipient when it starts monitoring EventTypeInitialStateTransfer EventType = "INITIAL_STATE_TRANSFER" // EventTypeUpdate is a type of the event sent on entity update EventTypeUpdate EventType = "UPDATE" // EventTypeDelete is a type of the event sent on entity delete EventTypeDelete EventType = "DELETE" )
type Recipient ¶
type Recipient interface {
SendMsg(msg interface{}) error
}
Recipient is an unified interface for receiving stream
type Server ¶
type Server interface { Update(ctx context.Context, entity Entity) Delete(ctx context.Context, entity Entity) AddRecipient(recipient Recipient) DeleteRecipient(recipient Recipient) MonitorEntities(stream grpc.ServerStream) SendAll(event Event) Serve() Entities() map[string]Entity }
Server is an unified interface for GRPC monitoring API server
func NewServer ¶
func NewServer(eventFactory EventFactory) Server
NewServer creates a new Server with given EventFactory
Directories
¶
Path | Synopsis |
---|---|
Package connectionmonitor - implementation of connection monotor client and server
|
Package connectionmonitor - implementation of connection monotor client and server |