{"modulePath":"github.com/eric-erki/https-hyperledger.org","version":"v1.2.1","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package consumer\n\n## Types\n\n```go\ntype EventAdapter interface {\n\tGetInterestedEvents() ([]*peer.Interest, error)\n\tRecv(msg *peer.Event) (bool, error)\n\tDisconnected(err error)\n}\n```\nEventAdapter is the interface by which a fabric event client registers interested events and receives messages from the fabric event Server\n\n```go\ntype EventsClient struct {\n\tsync.RWMutex\n\t// contains filtered or unexported fields\n}\n```\nEventsClient holds the stream and adapter for consumer to work with\n\n```go\nfunc NewEventsClient(peerAddress string, regTimeout time.Duration, adapter EventAdapter) (*EventsClient, error)\n```\nNewEventsClient Returns a new grpc.ClientConn to the configured local PEER.\n\n```go\nfunc (ec *EventsClient) Recv() (*ehpb.Event, error)\n```\nRecv receives next event - use when client has not called Start\n\n```go\nfunc (ec *EventsClient) RegisterAsync(config *RegistrationConfig) error\n```\nRegisterAsync - registers interest in a event and doesn't wait for a response\n\n```go\nfunc (ec *EventsClient) Start() error\n```\nStart establishes connection with Event hub and registers interested events with it\n\n```go\nfunc (ec *EventsClient) Stop() error\n```\nStop terminates connection with event hub\n\n```go\nfunc (ec *EventsClient) UnregisterAsync(ies []*ehpb.Interest) error\n```\nUnregisterAsync - Unregisters interest in a event and doesn't wait for a response\n\n```go\ntype RegistrationConfig struct {\n\tInterestedEvents []*ehpb.Interest\n\tTimestamp        *timestamp.Timestamp\n\tTlsCert          *x509.Certificate\n}\n```\nRegistrationConfig holds the information to be used when registering for events from the eventhub\n\n","path":"github.com/eric-erki/https-hyperledger.org/events/consumer","name":"consumer","synopsis":"","isRedistributable":true}
