bus

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: MIT Imports: 10 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CommonErrorCode_name = map[int32]string{
		0: "UNKNOWN",
		1: "INVALID_TYPE",
		2: "TIMEOUT",
		3: "NOT_FOUND",
		4: "BAD_REQUEST",
		5: "FORBIDDEN",
	}
	CommonErrorCode_value = map[string]int32{
		"UNKNOWN":      0,
		"INVALID_TYPE": 1,
		"TIMEOUT":      2,
		"NOT_FOUND":    3,
		"BAD_REQUEST":  4,
		"FORBIDDEN":    5,
	}
)

Enum value maps for CommonErrorCode.

View Source
var (
	ExternalMessageType_name = map[int32]string{
		0:  "UNSPECIFIED",
		1:  "HAS_TOPIC_REQ",
		2:  "HAS_TOPIC_RESP",
		3:  "SUBSCRIBE_REQ",
		4:  "SUBSCRIBE_RESP",
		5:  "UNSUBSCRIBE_REQ",
		6:  "UNSUBSCRIBE_RESP",
		7:  "KV_SET_REQ",
		8:  "KV_SET_RESP",
		9:  "KV_GET_REQ",
		10: "KV_GET_RESP",
		11: "KV_LIST_REQ",
		12: "KV_LIST_RESP",
		13: "KV_DELETE_REQ",
		14: "KV_DELETE_RESP",
		15: "LOG_SEND_REQ",
		16: "LOG_SEND_RESP",
	}
	ExternalMessageType_value = map[string]int32{
		"UNSPECIFIED":      0,
		"HAS_TOPIC_REQ":    1,
		"HAS_TOPIC_RESP":   2,
		"SUBSCRIBE_REQ":    3,
		"SUBSCRIBE_RESP":   4,
		"UNSUBSCRIBE_REQ":  5,
		"UNSUBSCRIBE_RESP": 6,
		"KV_SET_REQ":       7,
		"KV_SET_RESP":      8,
		"KV_GET_REQ":       9,
		"KV_GET_RESP":      10,
		"KV_LIST_REQ":      11,
		"KV_LIST_RESP":     12,
		"KV_DELETE_REQ":    13,
		"KV_DELETE_RESP":   14,
		"LOG_SEND_REQ":     15,
		"LOG_SEND_RESP":    16,
	}
)

Enum value maps for ExternalMessageType.

View Source
var (
	LogLevel_name = map[int32]string{
		0: "DEBUG",
		1: "INFO",
		2: "WARN",
		3: "ERROR",
	}
	LogLevel_value = map[string]int32{
		"DEBUG": 0,
		"INFO":  1,
		"WARN":  2,
		"ERROR": 3,
	}
)

Enum value maps for LogLevel.

Functions

func Drain

func Drain[T any](c chan T)

Drain drains all values from a channel, assuming that channel is closed.

Types

type Bus

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

Bus delivers messages between modules

func New

func New(ctx context.Context) *Bus

New creates a new Bus. When ctx is cancelled the Bus will close all channels, signalling to modules that no more messages will be delivered.

func (*Bus) HandleTypes

func (b *Bus) HandleTypes(ctx context.Context, topic string, chanCap int,
	handlers map[int32]MessageHandler,
	unmatchedHandler MessageHandler,
)

HandleTypes creates a channel with chanCap capacity and subscribes it to topic. When ctx is cancelled, the topic is unsubscribed. When a message is received on the channel, the handlers map is searched for a handler matching the message type. If a match is found that handler is invoked. If no match is found and unmatchedHandler is non-nil, that handler is invoked. If no match is found and unmatchedHandler is nil, the message is dropped. If the hander returns a non-nil BusMessage, that message is sent as a reply to the message received.

func (*Bus) HasTopic

func (b *Bus) HasTopic(topic string) bool

HasTopic returns whether or not a topic has any subscribers. Note that reality may change immediately after HasTopic returns.

func (*Bus) Send

func (b *Bus) Send(msg *BusMessage)

Send a message on the bus. The destination topic will be taken from msg.

func (*Bus) SendReply

func (b *Bus) SendReply(from *BusMessage, msg *BusMessage)

SendReply sends a message as a reply to another message. If no reply handler is waiting the message is dropped.

func (*Bus) SendWithReply

func (b *Bus) SendWithReply(msg *BusMessage, replyVia chan<- *BusMessage)

SendWithReply will send a message and wait for a reply via the provided channel. Replies are expired after one minute.

func (*Bus) Subscribe

func (b *Bus) Subscribe(topic string, recv chan<- *BusMessage)

Subscribe to a topic with messages to be received on the provided channel. The caller should not close the channel.

func (*Bus) Unsubscribe

func (b *Bus) Unsubscribe(topic string, recv chan<- *BusMessage) bool

Unsubscribe the channel from the topic. Returns whether or not the channel was subscribed to the topic. Unsubscribe closes the channel.

func (*Bus) WaitForReply

func (b *Bus) WaitForReply(ctx context.Context, msg *BusMessage) *BusMessage

WaitForReply sends a message and waits for a reply, wrapping SendWithReply

func (*Bus) WaitForTopic

func (b *Bus) WaitForTopic(ctx context.Context, topic string, checkEvery time.Duration) error

WaitForTopic waits for a topic to have at least one subscriber. This function will poll repeatedly, sleeping for checkEvery between polls. If ctx returns an error, polling stops and the error returned by ctx.Err is returned.

type BusMessage

type BusMessage struct {
	Topic   string `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"`
	Type    int32  `protobuf:"varint,2,opt,name=type,proto3" json:"type,omitempty"`
	Error   *Error `protobuf:"bytes,3,opt,name=error,proto3,oneof" json:"error,omitempty"`
	Message []byte `protobuf:"bytes,4,opt,name=message,proto3,oneof" json:"message,omitempty"`
	ReplyTo *int64 `protobuf:"varint,5,opt,name=reply_to,json=replyTo,proto3,oneof" json:"reply_to,omitempty"`
	FromMod string `protobuf:"bytes,6,opt,name=from_mod,json=fromMod,proto3" json:"from_mod,omitempty"`
	// contains filtered or unexported fields
}

func DefaultReply added in v0.1.6

func DefaultReply(msg *BusMessage) *BusMessage

DefaultReply creates a template reply by copying msg's topic and incrementing the message's type

func (*BusMessage) Descriptor deprecated

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

Deprecated: Use BusMessage.ProtoReflect.Descriptor instead.

func (*BusMessage) GetError

func (x *BusMessage) GetError() *Error

func (*BusMessage) GetFromMod added in v0.0.19

func (x *BusMessage) GetFromMod() string

func (*BusMessage) GetMessage

func (x *BusMessage) GetMessage() []byte

func (*BusMessage) GetReplyTo

func (x *BusMessage) GetReplyTo() int64

func (*BusMessage) GetTopic

func (x *BusMessage) GetTopic() string

func (*BusMessage) GetType

func (x *BusMessage) GetType() int32

func (*BusMessage) ProtoMessage

func (*BusMessage) ProtoMessage()

func (*BusMessage) ProtoReflect

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

func (*BusMessage) Reset

func (x *BusMessage) Reset()

func (*BusMessage) String

func (x *BusMessage) String() string

type CommonErrorCode

type CommonErrorCode int32
const (
	CommonErrorCode_UNKNOWN      CommonErrorCode = 0
	CommonErrorCode_INVALID_TYPE CommonErrorCode = 1
	CommonErrorCode_TIMEOUT      CommonErrorCode = 2
	CommonErrorCode_NOT_FOUND    CommonErrorCode = 3
	CommonErrorCode_BAD_REQUEST  CommonErrorCode = 4
	CommonErrorCode_FORBIDDEN    CommonErrorCode = 5
)

func (CommonErrorCode) Descriptor

func (CommonErrorCode) Enum

func (x CommonErrorCode) Enum() *CommonErrorCode

func (CommonErrorCode) EnumDescriptor deprecated

func (CommonErrorCode) EnumDescriptor() ([]byte, []int)

Deprecated: Use CommonErrorCode.Descriptor instead.

func (CommonErrorCode) Number

func (CommonErrorCode) String

func (x CommonErrorCode) String() string

func (CommonErrorCode) Type

type Error

type Error struct {
	Code           int32   `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Detail         *string `protobuf:"bytes,2,opt,name=detail,proto3,oneof" json:"detail,omitempty"`
	UserMessage    *string `protobuf:"bytes,3,opt,name=user_message,json=userMessage,proto3,oneof" json:"user_message,omitempty"`
	NotCommonError bool    `protobuf:"varint,4,opt,name=NotCommonError,proto3" json:"NotCommonError,omitempty"`
	// contains filtered or unexported fields
}

func NewError added in v0.1.8

func NewError(err error) *Error

NewError does a best-effort conversion from common error types to an Error with the correct CommonErrorCode

func (*Error) Descriptor deprecated

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

Deprecated: Use Error.ProtoReflect.Descriptor instead.

func (*Error) Error

func (e *Error) Error() string

Error implements error for the Error proto

func (*Error) GetCode

func (x *Error) GetCode() int32

func (*Error) GetDetail

func (x *Error) GetDetail() string

func (*Error) GetNotCommonError

func (x *Error) GetNotCommonError() bool

func (*Error) GetUserMessage

func (x *Error) GetUserMessage() string

func (*Error) ProtoMessage

func (*Error) ProtoMessage()

func (*Error) ProtoReflect

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

func (*Error) Reset

func (x *Error) Reset()

func (*Error) String

func (x *Error) String() string

func (*Error) Unwrap added in v0.1.8

func (e *Error) Unwrap() error

Unwrap returns an error of a common type based on e's Code. It's kind of the inverse of NewError()

type ExternalMessageType

type ExternalMessageType int32
const (
	ExternalMessageType_UNSPECIFIED      ExternalMessageType = 0
	ExternalMessageType_HAS_TOPIC_REQ    ExternalMessageType = 1
	ExternalMessageType_HAS_TOPIC_RESP   ExternalMessageType = 2
	ExternalMessageType_SUBSCRIBE_REQ    ExternalMessageType = 3
	ExternalMessageType_SUBSCRIBE_RESP   ExternalMessageType = 4
	ExternalMessageType_UNSUBSCRIBE_REQ  ExternalMessageType = 5
	ExternalMessageType_UNSUBSCRIBE_RESP ExternalMessageType = 6
	ExternalMessageType_KV_SET_REQ       ExternalMessageType = 7
	ExternalMessageType_KV_SET_RESP      ExternalMessageType = 8
	ExternalMessageType_KV_GET_REQ       ExternalMessageType = 9
	ExternalMessageType_KV_GET_RESP      ExternalMessageType = 10
	ExternalMessageType_KV_LIST_REQ      ExternalMessageType = 11
	ExternalMessageType_KV_LIST_RESP     ExternalMessageType = 12
	ExternalMessageType_KV_DELETE_REQ    ExternalMessageType = 13
	ExternalMessageType_KV_DELETE_RESP   ExternalMessageType = 14
	ExternalMessageType_LOG_SEND_REQ     ExternalMessageType = 15
	ExternalMessageType_LOG_SEND_RESP    ExternalMessageType = 16
)

func (ExternalMessageType) Descriptor

func (ExternalMessageType) Enum

func (ExternalMessageType) EnumDescriptor deprecated

func (ExternalMessageType) EnumDescriptor() ([]byte, []int)

Deprecated: Use ExternalMessageType.Descriptor instead.

func (ExternalMessageType) Number

func (ExternalMessageType) String

func (x ExternalMessageType) String() string

func (ExternalMessageType) Type

type HasTopicRequest

type HasTopicRequest struct {
	Topic     string `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"`
	TimeoutMs int32  `protobuf:"varint,2,opt,name=timeout_ms,json=timeoutMs,proto3" json:"timeout_ms,omitempty"`
	// contains filtered or unexported fields
}

func (*HasTopicRequest) Descriptor deprecated

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

Deprecated: Use HasTopicRequest.ProtoReflect.Descriptor instead.

func (*HasTopicRequest) GetTimeoutMs

func (x *HasTopicRequest) GetTimeoutMs() int32

func (*HasTopicRequest) GetTopic

func (x *HasTopicRequest) GetTopic() string

func (*HasTopicRequest) ProtoMessage

func (*HasTopicRequest) ProtoMessage()

func (*HasTopicRequest) ProtoReflect

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

func (*HasTopicRequest) Reset

func (x *HasTopicRequest) Reset()

func (*HasTopicRequest) String

func (x *HasTopicRequest) String() string

type HasTopicResponse

type HasTopicResponse struct {
	Topic    string `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"`
	HasTopic bool   `protobuf:"varint,2,opt,name=has_topic,json=hasTopic,proto3" json:"has_topic,omitempty"`
	// contains filtered or unexported fields
}

func (*HasTopicResponse) Descriptor deprecated

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

Deprecated: Use HasTopicResponse.ProtoReflect.Descriptor instead.

func (*HasTopicResponse) GetHasTopic

func (x *HasTopicResponse) GetHasTopic() bool

func (*HasTopicResponse) GetTopic

func (x *HasTopicResponse) GetTopic() string

func (*HasTopicResponse) ProtoMessage

func (*HasTopicResponse) ProtoMessage()

func (*HasTopicResponse) ProtoReflect

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

func (*HasTopicResponse) Reset

func (x *HasTopicResponse) Reset()

func (*HasTopicResponse) String

func (x *HasTopicResponse) String() string

type KVDeleteRequest added in v0.0.17

type KVDeleteRequest struct {
	Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// contains filtered or unexported fields
}

func (*KVDeleteRequest) Descriptor deprecated added in v0.0.17

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

Deprecated: Use KVDeleteRequest.ProtoReflect.Descriptor instead.

func (*KVDeleteRequest) GetKey added in v0.0.17

func (x *KVDeleteRequest) GetKey() []byte

func (*KVDeleteRequest) ProtoMessage added in v0.0.17

func (*KVDeleteRequest) ProtoMessage()

func (*KVDeleteRequest) ProtoReflect added in v0.0.17

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

func (*KVDeleteRequest) Reset added in v0.0.17

func (x *KVDeleteRequest) Reset()

func (*KVDeleteRequest) String added in v0.0.17

func (x *KVDeleteRequest) String() string

type KVDeleteResponse added in v0.0.17

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

func (*KVDeleteResponse) Descriptor deprecated added in v0.0.17

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

Deprecated: Use KVDeleteResponse.ProtoReflect.Descriptor instead.

func (*KVDeleteResponse) ProtoMessage added in v0.0.17

func (*KVDeleteResponse) ProtoMessage()

func (*KVDeleteResponse) ProtoReflect added in v0.0.17

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

func (*KVDeleteResponse) Reset added in v0.0.17

func (x *KVDeleteResponse) Reset()

func (*KVDeleteResponse) String added in v0.0.17

func (x *KVDeleteResponse) String() string

type KVGetRequest added in v0.0.17

type KVGetRequest struct {
	Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// contains filtered or unexported fields
}

func (*KVGetRequest) Descriptor deprecated added in v0.0.17

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

Deprecated: Use KVGetRequest.ProtoReflect.Descriptor instead.

func (*KVGetRequest) GetKey added in v0.0.17

func (x *KVGetRequest) GetKey() []byte

func (*KVGetRequest) ProtoMessage added in v0.0.17

func (*KVGetRequest) ProtoMessage()

func (*KVGetRequest) ProtoReflect added in v0.0.17

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

func (*KVGetRequest) Reset added in v0.0.17

func (x *KVGetRequest) Reset()

func (*KVGetRequest) String added in v0.0.17

func (x *KVGetRequest) String() string

type KVGetResponse added in v0.0.17

type KVGetResponse struct {
	Key   []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*KVGetResponse) Descriptor deprecated added in v0.0.17

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

Deprecated: Use KVGetResponse.ProtoReflect.Descriptor instead.

func (*KVGetResponse) GetKey added in v0.0.17

func (x *KVGetResponse) GetKey() []byte

func (*KVGetResponse) GetValue added in v0.0.17

func (x *KVGetResponse) GetValue() []byte

func (*KVGetResponse) ProtoMessage added in v0.0.17

func (*KVGetResponse) ProtoMessage()

func (*KVGetResponse) ProtoReflect added in v0.0.17

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

func (*KVGetResponse) Reset added in v0.0.17

func (x *KVGetResponse) Reset()

func (*KVGetResponse) String added in v0.0.17

func (x *KVGetResponse) String() string

type KVListRequest added in v0.0.17

type KVListRequest struct {
	Prefix []byte `protobuf:"bytes,1,opt,name=prefix,proto3" json:"prefix,omitempty"`
	Offset uint32 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"`
	Limit  uint32 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"`
	// contains filtered or unexported fields
}

func (*KVListRequest) Descriptor deprecated added in v0.0.17

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

Deprecated: Use KVListRequest.ProtoReflect.Descriptor instead.

func (*KVListRequest) GetLimit added in v0.0.17

func (x *KVListRequest) GetLimit() uint32

func (*KVListRequest) GetOffset added in v0.0.17

func (x *KVListRequest) GetOffset() uint32

func (*KVListRequest) GetPrefix added in v0.0.17

func (x *KVListRequest) GetPrefix() []byte

func (*KVListRequest) ProtoMessage added in v0.0.17

func (*KVListRequest) ProtoMessage()

func (*KVListRequest) ProtoReflect added in v0.0.17

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

func (*KVListRequest) Reset added in v0.0.17

func (x *KVListRequest) Reset()

func (*KVListRequest) String added in v0.0.17

func (x *KVListRequest) String() string

type KVListResponse added in v0.0.17

type KVListResponse struct {
	Keys         [][]byte `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys,omitempty"`
	Prefix       []byte   `protobuf:"bytes,2,opt,name=prefix,proto3" json:"prefix,omitempty"`
	TotalMatches uint32   `protobuf:"varint,3,opt,name=total_matches,json=totalMatches,proto3" json:"total_matches,omitempty"`
	Offset       uint32   `protobuf:"varint,4,opt,name=offset,proto3" json:"offset,omitempty"`
	Limit        uint32   `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"`
	// contains filtered or unexported fields
}

func (*KVListResponse) Descriptor deprecated added in v0.0.17

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

Deprecated: Use KVListResponse.ProtoReflect.Descriptor instead.

func (*KVListResponse) GetKeys added in v0.0.17

func (x *KVListResponse) GetKeys() [][]byte

func (*KVListResponse) GetLimit added in v0.0.17

func (x *KVListResponse) GetLimit() uint32

func (*KVListResponse) GetOffset added in v0.0.17

func (x *KVListResponse) GetOffset() uint32

func (*KVListResponse) GetPrefix added in v0.0.17

func (x *KVListResponse) GetPrefix() []byte

func (*KVListResponse) GetTotalMatches added in v0.0.17

func (x *KVListResponse) GetTotalMatches() uint32

func (*KVListResponse) ProtoMessage added in v0.0.17

func (*KVListResponse) ProtoMessage()

func (*KVListResponse) ProtoReflect added in v0.0.17

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

func (*KVListResponse) Reset added in v0.0.17

func (x *KVListResponse) Reset()

func (*KVListResponse) String added in v0.0.17

func (x *KVListResponse) String() string

type KVSetRequest added in v0.0.17

type KVSetRequest struct {
	Key   []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*KVSetRequest) Descriptor deprecated added in v0.0.17

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

Deprecated: Use KVSetRequest.ProtoReflect.Descriptor instead.

func (*KVSetRequest) GetKey added in v0.0.17

func (x *KVSetRequest) GetKey() []byte

func (*KVSetRequest) GetValue added in v0.0.17

func (x *KVSetRequest) GetValue() []byte

func (*KVSetRequest) ProtoMessage added in v0.0.17

func (*KVSetRequest) ProtoMessage()

func (*KVSetRequest) ProtoReflect added in v0.0.17

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

func (*KVSetRequest) Reset added in v0.0.17

func (x *KVSetRequest) Reset()

func (*KVSetRequest) String added in v0.0.17

func (x *KVSetRequest) String() string

type KVSetResponse added in v0.0.17

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

func (*KVSetResponse) Descriptor deprecated added in v0.0.17

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

Deprecated: Use KVSetResponse.ProtoReflect.Descriptor instead.

func (*KVSetResponse) ProtoMessage added in v0.0.17

func (*KVSetResponse) ProtoMessage()

func (*KVSetResponse) ProtoReflect added in v0.0.17

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

func (*KVSetResponse) Reset added in v0.0.17

func (x *KVSetResponse) Reset()

func (*KVSetResponse) String added in v0.0.17

func (x *KVSetResponse) String() string

type LogLevel added in v0.0.17

type LogLevel int32
const (
	LogLevel_DEBUG LogLevel = 0
	LogLevel_INFO  LogLevel = 1
	LogLevel_WARN  LogLevel = 2
	LogLevel_ERROR LogLevel = 3
)

func (LogLevel) Descriptor added in v0.0.17

func (LogLevel) Descriptor() protoreflect.EnumDescriptor

func (LogLevel) Enum added in v0.0.17

func (x LogLevel) Enum() *LogLevel

func (LogLevel) EnumDescriptor deprecated added in v0.0.17

func (LogLevel) EnumDescriptor() ([]byte, []int)

Deprecated: Use LogLevel.Descriptor instead.

func (LogLevel) Number added in v0.0.17

func (x LogLevel) Number() protoreflect.EnumNumber

func (LogLevel) String added in v0.0.17

func (x LogLevel) String() string

func (LogLevel) Type added in v0.0.17

type LogSendRequest added in v0.0.17

type LogSendRequest struct {
	Level   LogLevel              `protobuf:"varint,1,opt,name=level,proto3,enum=bus.LogLevel" json:"level,omitempty"`
	Message string                `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	Args    []*LogSendRequest_Arg `protobuf:"bytes,3,rep,name=args,proto3" json:"args,omitempty"`
	// contains filtered or unexported fields
}

func (*LogSendRequest) Descriptor deprecated added in v0.0.17

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

Deprecated: Use LogSendRequest.ProtoReflect.Descriptor instead.

func (*LogSendRequest) GetArgs added in v0.0.17

func (x *LogSendRequest) GetArgs() []*LogSendRequest_Arg

func (*LogSendRequest) GetLevel added in v0.0.17

func (x *LogSendRequest) GetLevel() LogLevel

func (*LogSendRequest) GetMessage added in v0.0.17

func (x *LogSendRequest) GetMessage() string

func (*LogSendRequest) ProtoMessage added in v0.0.17

func (*LogSendRequest) ProtoMessage()

func (*LogSendRequest) ProtoReflect added in v0.0.17

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

func (*LogSendRequest) Reset added in v0.0.17

func (x *LogSendRequest) Reset()

func (*LogSendRequest) String added in v0.0.17

func (x *LogSendRequest) String() string

type LogSendRequest_Arg added in v0.0.17

type LogSendRequest_Arg struct {
	Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// Types that are assignable to Value:
	//
	//	*LogSendRequest_Arg_String_
	//	*LogSendRequest_Arg_Bool
	//	*LogSendRequest_Arg_Int64
	//	*LogSendRequest_Arg_Double
	Value isLogSendRequest_Arg_Value `protobuf_oneof:"value"`
	// contains filtered or unexported fields
}

func (*LogSendRequest_Arg) Descriptor deprecated added in v0.0.17

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

Deprecated: Use LogSendRequest_Arg.ProtoReflect.Descriptor instead.

func (*LogSendRequest_Arg) GetBool added in v0.0.17

func (x *LogSendRequest_Arg) GetBool() bool

func (*LogSendRequest_Arg) GetDouble added in v0.0.17

func (x *LogSendRequest_Arg) GetDouble() float64

func (*LogSendRequest_Arg) GetInt64 added in v0.0.17

func (x *LogSendRequest_Arg) GetInt64() int64

func (*LogSendRequest_Arg) GetKey added in v0.0.17

func (x *LogSendRequest_Arg) GetKey() string

func (*LogSendRequest_Arg) GetString_ added in v0.0.17

func (x *LogSendRequest_Arg) GetString_() string

func (*LogSendRequest_Arg) GetValue added in v0.0.17

func (m *LogSendRequest_Arg) GetValue() isLogSendRequest_Arg_Value

func (*LogSendRequest_Arg) ProtoMessage added in v0.0.17

func (*LogSendRequest_Arg) ProtoMessage()

func (*LogSendRequest_Arg) ProtoReflect added in v0.0.17

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

func (*LogSendRequest_Arg) Reset added in v0.0.17

func (x *LogSendRequest_Arg) Reset()

func (*LogSendRequest_Arg) String added in v0.0.17

func (x *LogSendRequest_Arg) String() string

type LogSendRequest_Arg_Bool added in v0.0.17

type LogSendRequest_Arg_Bool struct {
	Bool bool `protobuf:"varint,3,opt,name=bool,proto3,oneof"`
}

type LogSendRequest_Arg_Double added in v0.0.17

type LogSendRequest_Arg_Double struct {
	Double float64 `protobuf:"fixed64,5,opt,name=double,proto3,oneof"`
}

type LogSendRequest_Arg_Int64 added in v0.0.17

type LogSendRequest_Arg_Int64 struct {
	Int64 int64 `protobuf:"varint,4,opt,name=int64,proto3,oneof"`
}

type LogSendRequest_Arg_String_ added in v0.0.17

type LogSendRequest_Arg_String_ struct {
	String_ string `protobuf:"bytes,2,opt,name=string,proto3,oneof"`
}

type LogSendResponse added in v0.0.17

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

func (*LogSendResponse) Descriptor deprecated added in v0.0.17

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

Deprecated: Use LogSendResponse.ProtoReflect.Descriptor instead.

func (*LogSendResponse) ProtoMessage added in v0.0.17

func (*LogSendResponse) ProtoMessage()

func (*LogSendResponse) ProtoReflect added in v0.0.17

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

func (*LogSendResponse) Reset added in v0.0.17

func (x *LogSendResponse) Reset()

func (*LogSendResponse) String added in v0.0.17

func (x *LogSendResponse) String() string

type MessageHandler

type MessageHandler func(*BusMessage) *BusMessage

A MessageHandler processes a message and returns a reply or nil

type SubscribeRequest

type SubscribeRequest struct {
	Topic string `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"`
	// contains filtered or unexported fields
}

func (*SubscribeRequest) Descriptor deprecated

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

Deprecated: Use SubscribeRequest.ProtoReflect.Descriptor instead.

func (*SubscribeRequest) GetTopic

func (x *SubscribeRequest) GetTopic() string

func (*SubscribeRequest) ProtoMessage

func (*SubscribeRequest) ProtoMessage()

func (*SubscribeRequest) ProtoReflect

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

func (*SubscribeRequest) Reset

func (x *SubscribeRequest) Reset()

func (*SubscribeRequest) String

func (x *SubscribeRequest) String() string

type SubscribeResponse added in v0.0.17

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

func (*SubscribeResponse) Descriptor deprecated added in v0.0.17

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

Deprecated: Use SubscribeResponse.ProtoReflect.Descriptor instead.

func (*SubscribeResponse) ProtoMessage added in v0.0.17

func (*SubscribeResponse) ProtoMessage()

func (*SubscribeResponse) ProtoReflect added in v0.0.17

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

func (*SubscribeResponse) Reset added in v0.0.17

func (x *SubscribeResponse) Reset()

func (*SubscribeResponse) String added in v0.0.17

func (x *SubscribeResponse) String() string

type UnsubscribeRequest

type UnsubscribeRequest struct {
	Topic string `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"`
	// contains filtered or unexported fields
}

func (*UnsubscribeRequest) Descriptor deprecated

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

Deprecated: Use UnsubscribeRequest.ProtoReflect.Descriptor instead.

func (*UnsubscribeRequest) GetTopic

func (x *UnsubscribeRequest) GetTopic() string

func (*UnsubscribeRequest) ProtoMessage

func (*UnsubscribeRequest) ProtoMessage()

func (*UnsubscribeRequest) ProtoReflect

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

func (*UnsubscribeRequest) Reset

func (x *UnsubscribeRequest) Reset()

func (*UnsubscribeRequest) String

func (x *UnsubscribeRequest) String() string

type UnsubscribeResponse added in v0.0.17

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

func (*UnsubscribeResponse) Descriptor deprecated added in v0.0.17

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

Deprecated: Use UnsubscribeResponse.ProtoReflect.Descriptor instead.

func (*UnsubscribeResponse) ProtoMessage added in v0.0.17

func (*UnsubscribeResponse) ProtoMessage()

func (*UnsubscribeResponse) ProtoReflect added in v0.0.17

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

func (*UnsubscribeResponse) Reset added in v0.0.17

func (x *UnsubscribeResponse) Reset()

func (*UnsubscribeResponse) String added in v0.0.17

func (x *UnsubscribeResponse) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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