core

package
v0.0.0-...-11c6e4e Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_event_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Aggregate

type Aggregate struct {
	Name       string
	Store      badger.DB
	EventStore store.Blocks
	Consumers  sync.Map
}

type Consumer

type Consumer struct {
	Name string
	// contains filtered or unexported fields
}

func (*Consumer) AppendClient

func (consumer *Consumer) AppendClient(conn ConsumerConn)

func (*Consumer) Close

func (consumer *Consumer) Close()

func (*Consumer) LatestEvent

func (consumer *Consumer) LatestEvent()

func (*Consumer) OnlineClients

func (consumer *Consumer) OnlineClients()

func (*Consumer) PushEvents

func (consumer *Consumer) PushEvents(events *Events) (err error)

type ConsumerClient

type ConsumerClient struct {
	// contains filtered or unexported fields
}

func (*ConsumerClient) Close

func (client *ConsumerClient) Close()

func (*ConsumerClient) Key

func (client *ConsumerClient) Key() (key string)

func (*ConsumerClient) Push

func (client *ConsumerClient) Push(events *Events) (ok bool, err error)

type ConsumerConn

type ConsumerConn interface {
	io.Reader
	io.Writer
	io.Closer
}

type Event

type Event struct {
	Id          uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Aggregate   string `protobuf:"bytes,2,opt,name=aggregate,proto3" json:"aggregate,omitempty"`
	AggregateId string `protobuf:"bytes,3,opt,name=aggregateId,proto3" json:"aggregateId,omitempty"`
	Name        string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"`
	Content     []byte `protobuf:"bytes,5,opt,name=content,proto3" json:"content,omitempty"`
	// contains filtered or unexported fields
}

func NewEvent

func NewEvent(name string, id uint64, aggregate string, aggregateId string, content []byte) (event *Event)

func NewEventFromBytes

func NewEventFromBytes(p []byte) (event *Event, err error)

func (*Event) Descriptor deprecated

func (*Event) Descriptor() ([]byte, []int)

Deprecated: Use Event.ProtoReflect.Descriptor instead.

func (*Event) Encode

func (x *Event) Encode() (p []byte, err error)

func (*Event) GetAggregate

func (x *Event) GetAggregate() string

func (*Event) GetAggregateId

func (x *Event) GetAggregateId() string

func (*Event) GetContent

func (x *Event) GetContent() []byte

func (*Event) GetId

func (x *Event) GetId() uint64

func (*Event) GetName

func (x *Event) GetName() string

func (*Event) Key

func (x *Event) Key() (p []byte)

func (*Event) ProtoMessage

func (*Event) ProtoMessage()

func (*Event) ProtoReflect

func (x *Event) ProtoReflect() protoreflect.Message

func (*Event) Reset

func (x *Event) Reset()

func (*Event) String

func (x *Event) String() string

type Events

type Events struct {
	Events []*Event `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"`
	// contains filtered or unexported fields
}

func NewEventsFromBytes

func NewEventsFromBytes(p []byte) (events *Events, err error)

func (*Events) Descriptor deprecated

func (*Events) Descriptor() ([]byte, []int)

Deprecated: Use Events.ProtoReflect.Descriptor instead.

func (*Events) Encode

func (x *Events) Encode() (p []byte, err error)

func (*Events) FlatMap

func (x *Events) FlatMap() (flats map[string]*Events)

func (*Events) GetEvents

func (x *Events) GetEvents() []*Event

func (*Events) Len

func (x *Events) Len() int

func (*Events) Less

func (x *Events) Less(i, j int) bool

func (*Events) ProtoMessage

func (*Events) ProtoMessage()

func (*Events) ProtoReflect

func (x *Events) ProtoReflect() protoreflect.Message

func (*Events) Reset

func (x *Events) Reset()

func (*Events) String

func (x *Events) String() string

func (*Events) Swap

func (x *Events) Swap(i, j int)

Jump to

Keyboard shortcuts

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