eventstore

package
v0.0.0-...-783eb67 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2022 License: BSD-2-Clause Imports: 15 Imported by: 6

Documentation

Overview

Package eventstore is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterEventstoreServiceHandler

func RegisterEventstoreServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterEventstoreServiceHandler registers the http handlers for service EventstoreService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterEventstoreServiceHandlerClient

func RegisterEventstoreServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client EventstoreServiceClient) error

RegisterEventstoreServiceHandlerClient registers the http handlers for service EventstoreService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "EventstoreServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "EventstoreServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "EventstoreServiceClient" to call the correct interceptors.

func RegisterEventstoreServiceHandlerFromEndpoint

func RegisterEventstoreServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterEventstoreServiceHandlerFromEndpoint is same as RegisterEventstoreServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterEventstoreServiceServer

func RegisterEventstoreServiceServer(s *grpc.Server, srv EventstoreServiceServer)

Types

type AppLogConsumeEntry

type AppLogConsumeEntry struct {
	Originator           *common.Originator `protobuf:"bytes,1,opt,name=originator,proto3" json:"originator,omitempty"`
	Offset               string             `protobuf:"bytes,2,opt,name=offset,proto3" json:"offset,omitempty"`
	XXX_NoUnkeyedLiteral struct{}           `json:"-"`
	XXX_unrecognized     []byte             `json:"-"`
	XXX_sizecache        int32              `json:"-"`
}

func (*AppLogConsumeEntry) Descriptor

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

func (*AppLogConsumeEntry) GetOffset

func (m *AppLogConsumeEntry) GetOffset() string

func (*AppLogConsumeEntry) GetOriginator

func (m *AppLogConsumeEntry) GetOriginator() *common.Originator

func (*AppLogConsumeEntry) ProtoMessage

func (*AppLogConsumeEntry) ProtoMessage()

func (*AppLogConsumeEntry) Reset

func (m *AppLogConsumeEntry) Reset()

func (*AppLogConsumeEntry) String

func (m *AppLogConsumeEntry) String() string

func (*AppLogConsumeEntry) XXX_DiscardUnknown

func (m *AppLogConsumeEntry) XXX_DiscardUnknown()

func (*AppLogConsumeEntry) XXX_Marshal

func (m *AppLogConsumeEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AppLogConsumeEntry) XXX_Merge

func (m *AppLogConsumeEntry) XXX_Merge(src proto.Message)

func (*AppLogConsumeEntry) XXX_Size

func (m *AppLogConsumeEntry) XXX_Size() int

func (*AppLogConsumeEntry) XXX_Unmarshal

func (m *AppLogConsumeEntry) XXX_Unmarshal(b []byte) error

type AppLogEntry

type AppLogEntry struct {
	//  the id number in the stream
	Id                   string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Event                *Event   `protobuf:"bytes,2,opt,name=event,proto3" json:"event,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*AppLogEntry) Descriptor

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

func (*AppLogEntry) GetEvent

func (m *AppLogEntry) GetEvent() *Event

func (*AppLogEntry) GetId

func (m *AppLogEntry) GetId() string

func (*AppLogEntry) ProtoMessage

func (*AppLogEntry) ProtoMessage()

func (*AppLogEntry) Reset

func (m *AppLogEntry) Reset()

func (*AppLogEntry) String

func (m *AppLogEntry) String() string

func (*AppLogEntry) XXX_DiscardUnknown

func (m *AppLogEntry) XXX_DiscardUnknown()

func (*AppLogEntry) XXX_Marshal

func (m *AppLogEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AppLogEntry) XXX_Merge

func (m *AppLogEntry) XXX_Merge(src proto.Message)

func (*AppLogEntry) XXX_Size

func (m *AppLogEntry) XXX_Size() int

func (*AppLogEntry) XXX_Unmarshal

func (m *AppLogEntry) XXX_Unmarshal(b []byte) error

type AppLogRequest

type AppLogRequest struct {
	// specifies the id from which to start the listing of the events
	// if not specified starts from the beginning
	FromId string `protobuf:"bytes,1,opt,name=from_id,json=fromId,proto3" json:"from_id,omitempty"`
	// number of events to get back if not specifies 20 is default
	Size uint32 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"`
	// optional parameter to specify which events we're interested into
	// it can be specififed as eventType.* or specific event as well eventType.eventName
	Selector string `protobuf:"bytes,3,opt,name=selector,proto3" json:"selector,omitempty"`
	// this is in general the entity type
	PipelineId           string   `protobuf:"bytes,4,opt,name=pipeline_id,json=pipelineId,proto3" json:"pipeline_id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*AppLogRequest) Descriptor

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

func (*AppLogRequest) GetFromId

func (m *AppLogRequest) GetFromId() string

func (*AppLogRequest) GetPipelineId

func (m *AppLogRequest) GetPipelineId() string

func (*AppLogRequest) GetSelector

func (m *AppLogRequest) GetSelector() string

func (*AppLogRequest) GetSize

func (m *AppLogRequest) GetSize() uint32

func (*AppLogRequest) ProtoMessage

func (*AppLogRequest) ProtoMessage()

func (*AppLogRequest) Reset

func (m *AppLogRequest) Reset()

func (*AppLogRequest) String

func (m *AppLogRequest) String() string

func (*AppLogRequest) XXX_DiscardUnknown

func (m *AppLogRequest) XXX_DiscardUnknown()

func (*AppLogRequest) XXX_Marshal

func (m *AppLogRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AppLogRequest) XXX_Merge

func (m *AppLogRequest) XXX_Merge(src proto.Message)

func (*AppLogRequest) XXX_Size

func (m *AppLogRequest) XXX_Size() int

func (*AppLogRequest) XXX_Unmarshal

func (m *AppLogRequest) XXX_Unmarshal(b []byte) error

type AppLogResponse

type AppLogResponse struct {
	Results              []*AppLogEntry `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"`
	XXX_NoUnkeyedLiteral struct{}       `json:"-"`
	XXX_unrecognized     []byte         `json:"-"`
	XXX_sizecache        int32          `json:"-"`
}

func (*AppLogResponse) Descriptor

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

func (*AppLogResponse) GetResults

func (m *AppLogResponse) GetResults() []*AppLogEntry

func (*AppLogResponse) ProtoMessage

func (*AppLogResponse) ProtoMessage()

func (*AppLogResponse) Reset

func (m *AppLogResponse) Reset()

func (*AppLogResponse) String

func (m *AppLogResponse) String() string

func (*AppLogResponse) XXX_DiscardUnknown

func (m *AppLogResponse) XXX_DiscardUnknown()

func (*AppLogResponse) XXX_Marshal

func (m *AppLogResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AppLogResponse) XXX_Merge

func (m *AppLogResponse) XXX_Merge(src proto.Message)

func (*AppLogResponse) XXX_Size

func (m *AppLogResponse) XXX_Size() int

func (*AppLogResponse) XXX_Unmarshal

func (m *AppLogResponse) XXX_Unmarshal(b []byte) error

type AppendEventRequest

type AppendEventRequest struct {
	Event                *Event   `protobuf:"bytes,1,opt,name=event,proto3" json:"event,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*AppendEventRequest) Descriptor

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

func (*AppendEventRequest) GetEvent

func (m *AppendEventRequest) GetEvent() *Event

func (*AppendEventRequest) ProtoMessage

func (*AppendEventRequest) ProtoMessage()

func (*AppendEventRequest) Reset

func (m *AppendEventRequest) Reset()

func (*AppendEventRequest) String

func (m *AppendEventRequest) String() string

func (*AppendEventRequest) XXX_DiscardUnknown

func (m *AppendEventRequest) XXX_DiscardUnknown()

func (*AppendEventRequest) XXX_Marshal

func (m *AppendEventRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AppendEventRequest) XXX_Merge

func (m *AppendEventRequest) XXX_Merge(src proto.Message)

func (*AppendEventRequest) XXX_Size

func (m *AppendEventRequest) XXX_Size() int

func (*AppendEventRequest) XXX_Unmarshal

func (m *AppendEventRequest) XXX_Unmarshal(b []byte) error

type AppendEventResponse

type AppendEventResponse struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*AppendEventResponse) Descriptor

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

func (*AppendEventResponse) ProtoMessage

func (*AppendEventResponse) ProtoMessage()

func (*AppendEventResponse) Reset

func (m *AppendEventResponse) Reset()

func (*AppendEventResponse) String

func (m *AppendEventResponse) String() string

func (*AppendEventResponse) XXX_DiscardUnknown

func (m *AppendEventResponse) XXX_DiscardUnknown()

func (*AppendEventResponse) XXX_Marshal

func (m *AppendEventResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AppendEventResponse) XXX_Merge

func (m *AppendEventResponse) XXX_Merge(src proto.Message)

func (*AppendEventResponse) XXX_Size

func (m *AppendEventResponse) XXX_Size() int

func (*AppendEventResponse) XXX_Unmarshal

func (m *AppendEventResponse) XXX_Unmarshal(b []byte) error

type Event

type Event struct {
	// The object this event belongs to
	Originator *common.Originator `protobuf:"bytes,1,opt,name=originator,proto3" json:"originator,omitempty"`
	// this is the event type that this is related to
	// event type should be in the format of `Entity.Created` so that store can infer the
	// partition this event belongs to
	EventType string `protobuf:"bytes,2,opt,name=event_type,json=eventType,proto3" json:"event_type,omitempty"`
	// the data of the event is inside the payload
	Payload string `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"`
	// utc unix timestamp of the event occurence
	OccuredOn            int64    `protobuf:"varint,4,opt,name=occured_on,json=occuredOn,proto3" json:"occured_on,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Event is what you operate on with event store It's the smalled bit that the event store is aware of

func (*Event) Descriptor

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

func (*Event) GetEventType

func (m *Event) GetEventType() string

func (*Event) GetOccuredOn

func (m *Event) GetOccuredOn() int64

func (*Event) GetOriginator

func (m *Event) GetOriginator() *common.Originator

func (*Event) GetPayload

func (m *Event) GetPayload() string

func (*Event) ProtoMessage

func (*Event) ProtoMessage()

func (*Event) Reset

func (m *Event) Reset()

func (*Event) String

func (m *Event) String() string

func (*Event) XXX_DiscardUnknown

func (m *Event) XXX_DiscardUnknown()

func (*Event) XXX_Marshal

func (m *Event) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Event) XXX_Merge

func (m *Event) XXX_Merge(src proto.Message)

func (*Event) XXX_Size

func (m *Event) XXX_Size() int

func (*Event) XXX_Unmarshal

func (m *Event) XXX_Unmarshal(b []byte) error

type EventstoreServiceClient

type EventstoreServiceClient interface {
	Healtz(ctx context.Context, in *HealthRequest, opts ...grpc.CallOption) (*HealthResponse, error)
	Append(ctx context.Context, in *AppendEventRequest, opts ...grpc.CallOption) (*AppendEventResponse, error)
	GetEvents(ctx context.Context, in *GetEventsRequest, opts ...grpc.CallOption) (*GetEventsResponse, error)
	Logs(ctx context.Context, in *AppLogRequest, opts ...grpc.CallOption) (*AppLogResponse, error)
	LogsPoll(ctx context.Context, in *AppLogRequest, opts ...grpc.CallOption) (EventstoreService_LogsPollClient, error)
}

EventstoreServiceClient is the client API for EventstoreService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewEventstoreServiceClient

func NewEventstoreServiceClient(cc *grpc.ClientConn) EventstoreServiceClient

type EventstoreServiceServer

EventstoreServiceServer is the server API for EventstoreService service.

type EventstoreService_LogsPollClient

type EventstoreService_LogsPollClient interface {
	Recv() (*AppLogEntry, error)
	grpc.ClientStream
}

type EventstoreService_LogsPollServer

type EventstoreService_LogsPollServer interface {
	Send(*AppLogEntry) error
	grpc.ServerStream
}

type GetEventsRequest

type GetEventsRequest struct {
	// The object this event belongs to if the version is omitted all of the events
	// are going to be fetched, if version is supplied all the events from that version
	// are going to returned back.
	Originator *common.Originator `protobuf:"bytes,1,opt,name=originator,proto3" json:"originator,omitempty"`
	// entity type like Users, Projects and etc
	EntityType           string   `protobuf:"bytes,2,opt,name=entity_type,json=entityType,proto3" json:"entity_type,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*GetEventsRequest) Descriptor

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

func (*GetEventsRequest) GetEntityType

func (m *GetEventsRequest) GetEntityType() string

func (*GetEventsRequest) GetOriginator

func (m *GetEventsRequest) GetOriginator() *common.Originator

func (*GetEventsRequest) ProtoMessage

func (*GetEventsRequest) ProtoMessage()

func (*GetEventsRequest) Reset

func (m *GetEventsRequest) Reset()

func (*GetEventsRequest) String

func (m *GetEventsRequest) String() string

func (*GetEventsRequest) XXX_DiscardUnknown

func (m *GetEventsRequest) XXX_DiscardUnknown()

func (*GetEventsRequest) XXX_Marshal

func (m *GetEventsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetEventsRequest) XXX_Merge

func (m *GetEventsRequest) XXX_Merge(src proto.Message)

func (*GetEventsRequest) XXX_Size

func (m *GetEventsRequest) XXX_Size() int

func (*GetEventsRequest) XXX_Unmarshal

func (m *GetEventsRequest) XXX_Unmarshal(b []byte) error

type GetEventsResponse

type GetEventsResponse struct {
	Events               []*Event `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*GetEventsResponse) Descriptor

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

func (*GetEventsResponse) GetEvents

func (m *GetEventsResponse) GetEvents() []*Event

func (*GetEventsResponse) ProtoMessage

func (*GetEventsResponse) ProtoMessage()

func (*GetEventsResponse) Reset

func (m *GetEventsResponse) Reset()

func (*GetEventsResponse) String

func (m *GetEventsResponse) String() string

func (*GetEventsResponse) XXX_DiscardUnknown

func (m *GetEventsResponse) XXX_DiscardUnknown()

func (*GetEventsResponse) XXX_Marshal

func (m *GetEventsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GetEventsResponse) XXX_Merge

func (m *GetEventsResponse) XXX_Merge(src proto.Message)

func (*GetEventsResponse) XXX_Size

func (m *GetEventsResponse) XXX_Size() int

func (*GetEventsResponse) XXX_Unmarshal

func (m *GetEventsResponse) XXX_Unmarshal(b []byte) error

type HealthRequest

type HealthRequest struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*HealthRequest) Descriptor

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

func (*HealthRequest) ProtoMessage

func (*HealthRequest) ProtoMessage()

func (*HealthRequest) Reset

func (m *HealthRequest) Reset()

func (*HealthRequest) String

func (m *HealthRequest) String() string

func (*HealthRequest) XXX_DiscardUnknown

func (m *HealthRequest) XXX_DiscardUnknown()

func (*HealthRequest) XXX_Marshal

func (m *HealthRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*HealthRequest) XXX_Merge

func (m *HealthRequest) XXX_Merge(src proto.Message)

func (*HealthRequest) XXX_Size

func (m *HealthRequest) XXX_Size() int

func (*HealthRequest) XXX_Unmarshal

func (m *HealthRequest) XXX_Unmarshal(b []byte) error

type HealthResponse

type HealthResponse struct {
	Message              string   `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*HealthResponse) Descriptor

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

func (*HealthResponse) GetMessage

func (m *HealthResponse) GetMessage() string

func (*HealthResponse) ProtoMessage

func (*HealthResponse) ProtoMessage()

func (*HealthResponse) Reset

func (m *HealthResponse) Reset()

func (*HealthResponse) String

func (m *HealthResponse) String() string

func (*HealthResponse) XXX_DiscardUnknown

func (m *HealthResponse) XXX_DiscardUnknown()

func (*HealthResponse) XXX_Marshal

func (m *HealthResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*HealthResponse) XXX_Merge

func (m *HealthResponse) XXX_Merge(src proto.Message)

func (*HealthResponse) XXX_Size

func (m *HealthResponse) XXX_Size() int

func (*HealthResponse) XXX_Unmarshal

func (m *HealthResponse) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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