Documentation ¶
Index ¶
- Variables
- func MarshalEvent(e *hippo.Event) ([]byte, error)
- func MarshalEventText(e *hippo.Event) (string, error)
- func RegisterCommandServer(s *grpc.Server, srv CommandServer)
- func RegisterQueryServer(s *grpc.Server, srv QueryServer)
- func UnmarshalEvent(data []byte, e *hippo.Event) error
- func UnmarshalEventText(s string, e *hippo.Event) error
- type CommandClient
- type CommandServer
- type CreateEventRequest
- func (*CreateEventRequest) Descriptor() ([]byte, []int)
- func (m *CreateEventRequest) GetEvent() *Event
- func (*CreateEventRequest) ProtoMessage()
- func (m *CreateEventRequest) Reset()
- func (m *CreateEventRequest) String() string
- func (m *CreateEventRequest) XXX_DiscardUnknown()
- func (m *CreateEventRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CreateEventRequest) XXX_Merge(src proto.Message)
- func (m *CreateEventRequest) XXX_Size() int
- func (m *CreateEventRequest) XXX_Unmarshal(b []byte) error
- type Event
- func (*Event) Descriptor() ([]byte, []int)
- func (m *Event) GetAggregateId() string
- func (m *Event) GetCreateTime() *timestamp.Timestamp
- func (m *Event) GetData() []byte
- func (m *Event) GetFormat() Format
- func (m *Event) GetMetadata() map[string]string
- func (m *Event) GetOriginIp() string
- func (m *Event) GetOriginName() string
- func (m *Event) GetPriority() int32
- func (m *Event) GetSchema() string
- func (m *Event) GetSignature() string
- func (m *Event) GetTopic() string
- func (m *Event) GetVersion() int64
- func (*Event) ProtoMessage()
- func (m *Event) Reset()
- func (m *Event) String() string
- func (m *Event) XXX_DiscardUnknown()
- func (m *Event) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Event) XXX_Merge(src proto.Message)
- func (m *Event) XXX_Size() int
- func (m *Event) XXX_Unmarshal(b []byte) error
- type Format
- type GetEventRequest
- func (*GetEventRequest) Descriptor() ([]byte, []int)
- func (m *GetEventRequest) GetAggregateId() string
- func (m *GetEventRequest) GetVersion() int64
- func (*GetEventRequest) ProtoMessage()
- func (m *GetEventRequest) Reset()
- func (m *GetEventRequest) String() string
- func (m *GetEventRequest) XXX_DiscardUnknown()
- func (m *GetEventRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GetEventRequest) XXX_Merge(src proto.Message)
- func (m *GetEventRequest) XXX_Size() int
- func (m *GetEventRequest) XXX_Unmarshal(b []byte) error
- type ListEventsRequest
- func (*ListEventsRequest) Descriptor() ([]byte, []int)
- func (m *ListEventsRequest) GetAggregateId() string
- func (m *ListEventsRequest) GetVersionMax() int64
- func (m *ListEventsRequest) GetVersionMin() int64
- func (*ListEventsRequest) ProtoMessage()
- func (m *ListEventsRequest) Reset()
- func (m *ListEventsRequest) String() string
- func (m *ListEventsRequest) XXX_DiscardUnknown()
- func (m *ListEventsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ListEventsRequest) XXX_Merge(src proto.Message)
- func (m *ListEventsRequest) XXX_Size() int
- func (m *ListEventsRequest) XXX_Unmarshal(b []byte) error
- type QueryClient
- type QueryServer
- type Query_ListEventsClient
- type Query_ListEventsServer
- type SnapshotEventRequest
- func (*SnapshotEventRequest) Descriptor() ([]byte, []int)
- func (m *SnapshotEventRequest) GetEvent() *Event
- func (*SnapshotEventRequest) ProtoMessage()
- func (m *SnapshotEventRequest) Reset()
- func (m *SnapshotEventRequest) String() string
- func (m *SnapshotEventRequest) XXX_DiscardUnknown()
- func (m *SnapshotEventRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *SnapshotEventRequest) XXX_Merge(src proto.Message)
- func (m *SnapshotEventRequest) XXX_Size() int
- func (m *SnapshotEventRequest) XXX_Unmarshal(b []byte) error
- type UnimplementedCommandServer
- type UnimplementedQueryServer
Constants ¶
This section is empty.
Variables ¶
var Format_name = map[int32]string{
0: "PROTOBUF",
1: "JSON",
2: "STRING",
}
var Format_value = map[string]int32{
"PROTOBUF": 0,
"JSON": 1,
"STRING": 2,
}
Functions ¶
func MarshalEvent ¶
MarshalEvent encodes a event to binary format.
func MarshalEventText ¶
MarshalEventText encodes a event to compact string format.
func RegisterCommandServer ¶
func RegisterCommandServer(s *grpc.Server, srv CommandServer)
func RegisterQueryServer ¶
func RegisterQueryServer(s *grpc.Server, srv QueryServer)
func UnmarshalEvent ¶
UnmarshalEvent decodes a event from a binary data.
Types ¶
type CommandClient ¶
type CommandClient interface { CreateEvent(ctx context.Context, in *CreateEventRequest, opts ...grpc.CallOption) (*empty.Empty, error) SnapshotEvent(ctx context.Context, in *SnapshotEventRequest, opts ...grpc.CallOption) (*empty.Empty, error) }
CommandClient is the client API for Command service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewCommandClient ¶
func NewCommandClient(cc *grpc.ClientConn) CommandClient
type CommandServer ¶
type CommandServer interface { CreateEvent(context.Context, *CreateEventRequest) (*empty.Empty, error) SnapshotEvent(context.Context, *SnapshotEventRequest) (*empty.Empty, error) }
CommandServer is the server API for Command service.
type CreateEventRequest ¶
type CreateEventRequest struct { // The event resource to create. Event *Event `protobuf:"bytes,1,opt,name=event,proto3" json:"event,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Request message for CreateEvent method.
func (*CreateEventRequest) Descriptor ¶
func (*CreateEventRequest) Descriptor() ([]byte, []int)
func (*CreateEventRequest) GetEvent ¶
func (m *CreateEventRequest) GetEvent() *Event
func (*CreateEventRequest) ProtoMessage ¶
func (*CreateEventRequest) ProtoMessage()
func (*CreateEventRequest) Reset ¶
func (m *CreateEventRequest) Reset()
func (*CreateEventRequest) String ¶
func (m *CreateEventRequest) String() string
func (*CreateEventRequest) XXX_DiscardUnknown ¶
func (m *CreateEventRequest) XXX_DiscardUnknown()
func (*CreateEventRequest) XXX_Marshal ¶
func (m *CreateEventRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CreateEventRequest) XXX_Merge ¶
func (m *CreateEventRequest) XXX_Merge(src proto.Message)
func (*CreateEventRequest) XXX_Size ¶
func (m *CreateEventRequest) XXX_Size() int
func (*CreateEventRequest) XXX_Unmarshal ¶
func (m *CreateEventRequest) XXX_Unmarshal(b []byte) error
type Event ¶
type Event struct { // Topic (name) of the event. These should be written in the past tense (event_created) Topic string `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"` // Aggregate ID is the primary key of the aggregate to which the event refers to. AggregateId string `protobuf:"bytes,2,opt,name=aggregate_id,json=aggregateId,proto3" json:"aggregate_id,omitempty"` // Version of the aggregate, useful when using concurrency writes. Version int64 `protobuf:"varint,3,opt,name=version,proto3" json:"version,omitempty"` // Schema of the aggregate. Schema string `protobuf:"bytes,4,opt,name=schema,proto3" json:"schema,omitempty"` // Format of the encoded type of the aggregate data Format Format `protobuf:"varint,5,opt,name=format,proto3,enum=internal.Format" json:"format,omitempty"` // Data raw object data. Data []byte `protobuf:"bytes,6,opt,name=data,proto3" json:"data,omitempty"` // Priority of the event, where 0 is the highest priority. Priority int32 `protobuf:"varint,7,opt,name=priority,proto3" json:"priority,omitempty"` // Signature includes SHA1 signature computed against it's contents and signature of the previous event. Signature string `protobuf:"bytes,8,opt,name=signature,proto3" json:"signature,omitempty"` // Origin of the event. e.g. service name. OriginName string `protobuf:"bytes,9,opt,name=origin_name,json=originName,proto3" json:"origin_name,omitempty"` // Origin of the event. e.g. service ip address / browser. OriginIp string `protobuf:"bytes,10,opt,name=origin_ip,json=originIp,proto3" json:"origin_ip,omitempty"` // Metadata Metadata map[string]string `` /* 158-byte string literal not displayed */ // CreateTime timestamp when event ocurred, location should be set to UTC. CreateTime *timestamp.Timestamp `protobuf:"bytes,12,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Event resource.
func (*Event) Descriptor ¶
func (*Event) GetAggregateId ¶
func (*Event) GetCreateTime ¶
func (*Event) GetMetadata ¶
func (*Event) GetOriginIp ¶
func (*Event) GetOriginName ¶
func (*Event) GetPriority ¶
func (*Event) GetSignature ¶
func (*Event) GetVersion ¶
func (*Event) ProtoMessage ¶
func (*Event) ProtoMessage()
func (*Event) XXX_DiscardUnknown ¶
func (m *Event) XXX_DiscardUnknown()
func (*Event) XXX_Marshal ¶
func (*Event) XXX_Unmarshal ¶
type GetEventRequest ¶
type GetEventRequest struct { // The ID of the event is based on the aggregate_id and version AggregateId string `protobuf:"bytes,1,opt,name=aggregate_id,json=aggregateId,proto3" json:"aggregate_id,omitempty"` Version int64 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Request message for GetEvent method.
func (*GetEventRequest) Descriptor ¶
func (*GetEventRequest) Descriptor() ([]byte, []int)
func (*GetEventRequest) GetAggregateId ¶
func (m *GetEventRequest) GetAggregateId() string
func (*GetEventRequest) GetVersion ¶
func (m *GetEventRequest) GetVersion() int64
func (*GetEventRequest) ProtoMessage ¶
func (*GetEventRequest) ProtoMessage()
func (*GetEventRequest) Reset ¶
func (m *GetEventRequest) Reset()
func (*GetEventRequest) String ¶
func (m *GetEventRequest) String() string
func (*GetEventRequest) XXX_DiscardUnknown ¶
func (m *GetEventRequest) XXX_DiscardUnknown()
func (*GetEventRequest) XXX_Marshal ¶
func (m *GetEventRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GetEventRequest) XXX_Merge ¶
func (m *GetEventRequest) XXX_Merge(src proto.Message)
func (*GetEventRequest) XXX_Size ¶
func (m *GetEventRequest) XXX_Size() int
func (*GetEventRequest) XXX_Unmarshal ¶
func (m *GetEventRequest) XXX_Unmarshal(b []byte) error
type ListEventsRequest ¶
type ListEventsRequest struct { // The ID of the event is based on the aggregate_id and version AggregateId string `protobuf:"bytes,1,opt,name=aggregate_id,json=aggregateId,proto3" json:"aggregate_id,omitempty"` VersionMin int64 `protobuf:"varint,2,opt,name=version_min,json=versionMin,proto3" json:"version_min,omitempty"` VersionMax int64 `protobuf:"varint,3,opt,name=version_max,json=versionMax,proto3" json:"version_max,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Request message for ListEvents method.
func (*ListEventsRequest) Descriptor ¶
func (*ListEventsRequest) Descriptor() ([]byte, []int)
func (*ListEventsRequest) GetAggregateId ¶
func (m *ListEventsRequest) GetAggregateId() string
func (*ListEventsRequest) GetVersionMax ¶
func (m *ListEventsRequest) GetVersionMax() int64
func (*ListEventsRequest) GetVersionMin ¶
func (m *ListEventsRequest) GetVersionMin() int64
func (*ListEventsRequest) ProtoMessage ¶
func (*ListEventsRequest) ProtoMessage()
func (*ListEventsRequest) Reset ¶
func (m *ListEventsRequest) Reset()
func (*ListEventsRequest) String ¶
func (m *ListEventsRequest) String() string
func (*ListEventsRequest) XXX_DiscardUnknown ¶
func (m *ListEventsRequest) XXX_DiscardUnknown()
func (*ListEventsRequest) XXX_Marshal ¶
func (m *ListEventsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ListEventsRequest) XXX_Merge ¶
func (m *ListEventsRequest) XXX_Merge(src proto.Message)
func (*ListEventsRequest) XXX_Size ¶
func (m *ListEventsRequest) XXX_Size() int
func (*ListEventsRequest) XXX_Unmarshal ¶
func (m *ListEventsRequest) XXX_Unmarshal(b []byte) error
type QueryClient ¶
type QueryClient interface { GetEvent(ctx context.Context, in *GetEventRequest, opts ...grpc.CallOption) (*Event, error) ListEvents(ctx context.Context, in *ListEventsRequest, opts ...grpc.CallOption) (Query_ListEventsClient, error) }
QueryClient is the client API for Query service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewQueryClient ¶
func NewQueryClient(cc *grpc.ClientConn) QueryClient
type QueryServer ¶
type QueryServer interface { GetEvent(context.Context, *GetEventRequest) (*Event, error) ListEvents(*ListEventsRequest, Query_ListEventsServer) error }
QueryServer is the server API for Query service.
type Query_ListEventsClient ¶
type Query_ListEventsClient interface { Recv() (*Event, error) grpc.ClientStream }
type Query_ListEventsServer ¶
type Query_ListEventsServer interface { Send(*Event) error grpc.ServerStream }
type SnapshotEventRequest ¶
type SnapshotEventRequest struct { // The event resource to snapshot. Event *Event `protobuf:"bytes,1,opt,name=event,proto3" json:"event,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Request message for SnapshotEvent method.
func (*SnapshotEventRequest) Descriptor ¶
func (*SnapshotEventRequest) Descriptor() ([]byte, []int)
func (*SnapshotEventRequest) GetEvent ¶
func (m *SnapshotEventRequest) GetEvent() *Event
func (*SnapshotEventRequest) ProtoMessage ¶
func (*SnapshotEventRequest) ProtoMessage()
func (*SnapshotEventRequest) Reset ¶
func (m *SnapshotEventRequest) Reset()
func (*SnapshotEventRequest) String ¶
func (m *SnapshotEventRequest) String() string
func (*SnapshotEventRequest) XXX_DiscardUnknown ¶
func (m *SnapshotEventRequest) XXX_DiscardUnknown()
func (*SnapshotEventRequest) XXX_Marshal ¶
func (m *SnapshotEventRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*SnapshotEventRequest) XXX_Merge ¶
func (m *SnapshotEventRequest) XXX_Merge(src proto.Message)
func (*SnapshotEventRequest) XXX_Size ¶
func (m *SnapshotEventRequest) XXX_Size() int
func (*SnapshotEventRequest) XXX_Unmarshal ¶
func (m *SnapshotEventRequest) XXX_Unmarshal(b []byte) error
type UnimplementedCommandServer ¶
type UnimplementedCommandServer struct { }
UnimplementedCommandServer can be embedded to have forward compatible implementations.
func (*UnimplementedCommandServer) CreateEvent ¶
func (*UnimplementedCommandServer) CreateEvent(ctx context.Context, req *CreateEventRequest) (*empty.Empty, error)
func (*UnimplementedCommandServer) SnapshotEvent ¶
func (*UnimplementedCommandServer) SnapshotEvent(ctx context.Context, req *SnapshotEventRequest) (*empty.Empty, error)
type UnimplementedQueryServer ¶
type UnimplementedQueryServer struct { }
UnimplementedQueryServer can be embedded to have forward compatible implementations.
func (*UnimplementedQueryServer) GetEvent ¶
func (*UnimplementedQueryServer) GetEvent(ctx context.Context, req *GetEventRequest) (*Event, error)
func (*UnimplementedQueryServer) ListEvents ¶
func (*UnimplementedQueryServer) ListEvents(req *ListEventsRequest, srv Query_ListEventsServer) error