Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterEventServiceServer(s grpc.ServiceRegistrar, srv EventServiceServer)
- type Code
- type Event
- type EventServiceClient
- type EventServiceServer
- type SendEventRequest
- func (*SendEventRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SendEventRequest) GetEvents() []*Event
- func (x *SendEventRequest) GetReqGuid() string
- func (x *SendEventRequest) GetSentTime() *timestamppb.Timestamp
- func (*SendEventRequest) ProtoMessage()
- func (x *SendEventRequest) ProtoReflect() protoreflect.Message
- func (x *SendEventRequest) Reset()
- func (x *SendEventRequest) String() string
- type SendEventResponse
- func (*SendEventResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SendEventResponse) GetCode() Code
- func (x *SendEventResponse) GetData() map[string]string
- func (x *SendEventResponse) GetReason() string
- func (x *SendEventResponse) GetSentTime() int64
- func (x *SendEventResponse) GetStatus() Status
- func (*SendEventResponse) ProtoMessage()
- func (x *SendEventResponse) ProtoReflect() protoreflect.Message
- func (x *SendEventResponse) Reset()
- func (x *SendEventResponse) String() string
- type Status
- type UnimplementedEventServiceServer
- type UnsafeEventServiceServer
Constants ¶
const (
EventService_SendEvent_FullMethodName = "/raystack.raccoon.v1beta1.EventService/SendEvent"
)
Variables ¶
var ( Status_name = map[int32]string{ 0: "STATUS_UNSPECIFIED", 1: "STATUS_SUCCESS", 2: "STATUS_ERROR", } Status_value = map[string]int32{ "STATUS_UNSPECIFIED": 0, "STATUS_SUCCESS": 1, "STATUS_ERROR": 2, } )
Enum value maps for Status.
var ( Code_name = map[int32]string{ 0: "CODE_UNSPECIFIED", 1: "CODE_OK", 2: "CODE_BAD_REQUEST", 3: "CODE_INTERNAL_ERROR", 4: "CODE_MAX_CONNECTION_LIMIT_REACHED", 5: "CODE_MAX_USER_LIMIT_REACHED", } Code_value = map[string]int32{ "CODE_UNSPECIFIED": 0, "CODE_OK": 1, "CODE_BAD_REQUEST": 2, "CODE_INTERNAL_ERROR": 3, "CODE_MAX_CONNECTION_LIMIT_REACHED": 4, "CODE_MAX_USER_LIMIT_REACHED": 5, } )
Enum value maps for Code.
var EventService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "raystack.raccoon.v1beta1.EventService", HandlerType: (*EventServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SendEvent", Handler: _EventService_SendEvent_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "raystack/raccoon/v1beta1/raccoon.proto", }
EventService_ServiceDesc is the grpc.ServiceDesc for EventService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_raystack_raccoon_v1beta1_raccoon_proto protoreflect.FileDescriptor
Functions ¶
func RegisterEventServiceServer ¶
func RegisterEventServiceServer(s grpc.ServiceRegistrar, srv EventServiceServer)
Types ¶
type Code ¶
type Code int32
const ( // `CODE_UNSPECIFIED` indicates no appropriate/existing code can describe it. Code_CODE_UNSPECIFIED Code = 0 // `OK` indicates the request is processed successfully. Code_CODE_OK Code = 1 // `BAD_REQUEST` indicates there is something wrong with the request. Code_CODE_BAD_REQUEST Code = 2 // `INTERNAL_ERROR` indicates that Raccoon encountered an unexpected condition that prevented it from fulfilling the request. Code_CODE_INTERNAL_ERROR Code = 3 // `MAX_CONNECTION_LIMIT_REACHED` indicates that Raccoon is unable to accepts new connection due to max connection is reached. // // To prevent Raccoon from eating up resources, connection limit needs to be set. The limit is configurable on Raccoon by setting `SERVER_WEBSOCKET_MAX_CONN` Code_CODE_MAX_CONNECTION_LIMIT_REACHED Code = 4 // `MAX_USER_LIMIT_REACHED` indicates that existing connection with the same ID. // // Raccoon ensures unique connection using unique identifier passed from the header // the first time Websocket connection is established. The header key that // contains unique identifier is configurable on Raccoon by setting `SERVER_WEBSOCKET_CONN_UNIQ_ID_HEADER` Code_CODE_MAX_USER_LIMIT_REACHED Code = 5 )
func (Code) Descriptor ¶
func (Code) Descriptor() protoreflect.EnumDescriptor
func (Code) EnumDescriptor
deprecated
func (Code) Number ¶
func (x Code) Number() protoreflect.EnumNumber
func (Code) Type ¶
func (Code) Type() protoreflect.EnumType
type Event ¶
type Event struct { // `event_bytes` is where you put bytes serialized event. EventBytes []byte `protobuf:"bytes,1,opt,name=event_bytes,json=eventBytes,proto3" json:"event_bytes,omitempty"` // `type` denotes an event type that the producer of this proto message may set. // // It is currently used by raccoon to distribute events to respective Kafka topics. However the // users of this proto can use this type to set strings which can be processed in their // ingestion systems to distribute or perform other functions. Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` // contains filtered or unexported fields }
func (*Event) Descriptor
deprecated
func (*Event) GetEventBytes ¶
func (*Event) ProtoMessage ¶
func (*Event) ProtoMessage()
func (*Event) ProtoReflect ¶
func (x *Event) ProtoReflect() protoreflect.Message
type EventServiceClient ¶
type EventServiceClient interface {
SendEvent(ctx context.Context, in *SendEventRequest, opts ...grpc.CallOption) (*SendEventResponse, error)
}
EventServiceClient is the client API for EventService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewEventServiceClient ¶
func NewEventServiceClient(cc grpc.ClientConnInterface) EventServiceClient
type EventServiceServer ¶
type EventServiceServer interface { SendEvent(context.Context, *SendEventRequest) (*SendEventResponse, error) // contains filtered or unexported methods }
EventServiceServer is the server API for EventService service. All implementations must embed UnimplementedEventServiceServer for forward compatibility
type SendEventRequest ¶
type SendEventRequest struct { // `req_guid` is unique identifier of the request the client is making. // // Raccoon uses the identifier to send response of the request. The client can handle the // response accordingly. For example, the client can retry the request in case the response is // giving `INTERNAL_ERROR` code with "publisher failed" reason. // // This identifier is necessary because on event-based protocols like WebSocket the response is // returned asynchronously. If there is no identifier, no way the client can tell which response // belongs to which request. // // Apart from sending response, `req_guid` is used to log some informations on 'debug' level. You can search the // debug logs with `ReqGUID` keyword. ReqGuid string `protobuf:"bytes,1,opt,name=req_guid,json=reqGuid,proto3" json:"req_guid,omitempty"` // `sent_time` defines the time the request is sent. // // `sent_time` is used to calculate various metrics. The main metric uses `sent_time` is duration from the // request is sent until the events are published. SentTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=sent_time,json=sentTime,proto3" json:"sent_time,omitempty"` // `events` is where the client put all the events wrapped in `Event`. // // As mentioned above, the request allows the client to push more than one event. Normally you want to batch // the events to optimize the network call. Events []*Event `protobuf:"bytes,3,rep,name=events,proto3" json:"events,omitempty"` // contains filtered or unexported fields }
`EventRequest` defines the contract to push events to Raccoon
An `EventRequest` allows you to push more than one events(batch). The events are wrapped inside `events` repeated field. All of the fields on `EventRequest` are required.
func (*SendEventRequest) Descriptor
deprecated
func (*SendEventRequest) Descriptor() ([]byte, []int)
Deprecated: Use SendEventRequest.ProtoReflect.Descriptor instead.
func (*SendEventRequest) GetEvents ¶
func (x *SendEventRequest) GetEvents() []*Event
func (*SendEventRequest) GetReqGuid ¶
func (x *SendEventRequest) GetReqGuid() string
func (*SendEventRequest) GetSentTime ¶
func (x *SendEventRequest) GetSentTime() *timestamppb.Timestamp
func (*SendEventRequest) ProtoMessage ¶
func (*SendEventRequest) ProtoMessage()
func (*SendEventRequest) ProtoReflect ¶
func (x *SendEventRequest) ProtoReflect() protoreflect.Message
func (*SendEventRequest) Reset ¶
func (x *SendEventRequest) Reset()
func (*SendEventRequest) String ¶
func (x *SendEventRequest) String() string
type SendEventResponse ¶
type SendEventResponse struct { // `status` denotes status of the request. // // Only 3 values are valid. `SUCCESS` means the the request is processed // successfully. `ERROR` means the request failed to be processed. `UNKNOWN_STATUS` // means Raccoon unable to determine whether the request is success or not. Status Status `protobuf:"varint,1,opt,name=status,proto3,enum=raystack.raccoon.v1beta1.Status" json:"status,omitempty"` // `code` gives more detail of what happened to the request. // // Details of available `code` can be seen below. Code Code `protobuf:"varint,2,opt,name=code,proto3,enum=raystack.raccoon.v1beta1.Code" json:"code,omitempty"` // `sent_time` is UNIX timestamp populated by Raccoon by the time the response is sent. SentTime int64 `protobuf:"varint,3,opt,name=sent_time,json=sentTime,proto3" json:"sent_time,omitempty"` // `reason` is additional-human readable information to provide more context to `status` and `code`. // // There is no predefined structure for this. The value is arbitrary. Reason string `protobuf:"bytes,4,opt,name=reason,proto3" json:"reason,omitempty"` // `data` is arbitrary extra metadata. // // Arbitrary key-value makes the field flexible for future changes. `req_guid` is also sent as part // of `data`. The client may fetch req_guid as key to get the `req_guid` value. Data map[string]string `` /* 149-byte string literal not displayed */ // contains filtered or unexported fields }
func (*SendEventResponse) Descriptor
deprecated
func (*SendEventResponse) Descriptor() ([]byte, []int)
Deprecated: Use SendEventResponse.ProtoReflect.Descriptor instead.
func (*SendEventResponse) GetCode ¶
func (x *SendEventResponse) GetCode() Code
func (*SendEventResponse) GetData ¶
func (x *SendEventResponse) GetData() map[string]string
func (*SendEventResponse) GetReason ¶
func (x *SendEventResponse) GetReason() string
func (*SendEventResponse) GetSentTime ¶
func (x *SendEventResponse) GetSentTime() int64
func (*SendEventResponse) GetStatus ¶
func (x *SendEventResponse) GetStatus() Status
func (*SendEventResponse) ProtoMessage ¶
func (*SendEventResponse) ProtoMessage()
func (*SendEventResponse) ProtoReflect ¶
func (x *SendEventResponse) ProtoReflect() protoreflect.Message
func (*SendEventResponse) Reset ¶
func (x *SendEventResponse) Reset()
func (*SendEventResponse) String ¶
func (x *SendEventResponse) String() string
type Status ¶
type Status int32
func (Status) Descriptor ¶
func (Status) Descriptor() protoreflect.EnumDescriptor
func (Status) EnumDescriptor
deprecated
func (Status) Number ¶
func (x Status) Number() protoreflect.EnumNumber
func (Status) Type ¶
func (Status) Type() protoreflect.EnumType
type UnimplementedEventServiceServer ¶
type UnimplementedEventServiceServer struct { }
UnimplementedEventServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedEventServiceServer) SendEvent ¶
func (UnimplementedEventServiceServer) SendEvent(context.Context, *SendEventRequest) (*SendEventResponse, error)
type UnsafeEventServiceServer ¶
type UnsafeEventServiceServer interface {
// contains filtered or unexported methods
}
UnsafeEventServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to EventServiceServer will result in compilation errors.