events

package
v0.3.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2024 License: MPL-2.0 Imports: 4 Imported by: 1

Documentation

Overview

Package events contains events sink gRPC server implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	HandleEvent(ctx context.Context, event Event) error
}

Adapter is an abstract event stream receiver.

type Event

type Event struct {
	Payload proto.Message
	TypeURL string
	ID      string
	Node    string
	ActorID string
}

Event as received from the API.

type Sink

type Sink struct {
	events.UnimplementedEventSinkServiceServer
	// contains filtered or unexported fields
}

Sink implements events.EventSinkServiceServer.

func NewSink

func NewSink(a Adapter, supportedTypes []proto.Message) *Sink

NewSink creates new events sink service.

func (*Sink) Publish

func (s *Sink) Publish(ctx context.Context, e *events.EventRequest) (*events.EventResponse, error)

Publish implements events.EventSinkServiceServer.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL