Documentation ¶
Index ¶
- Constants
- Variables
- type Discovery
- func (d *Discovery) Close() error
- func (d *Discovery) Deregister() error
- func (d *Discovery) DiscoverNodes() ([]*discovery.Node, error)
- func (d *Discovery) ID() string
- func (d *Discovery) Initialize() error
- func (d *Discovery) Register() error
- func (d *Discovery) SetConfig(config discovery.Options) error
- func (d *Discovery) Watch(ctx context.Context) (<-chan discovery.Event, error)
- type Message
- func (*Message) Descriptor() ([]byte, []int)deprecated
- func (x *Message) GetHost() string
- func (x *Message) GetMessageType() MessageType
- func (x *Message) GetName() string
- func (x *Message) GetPort() int32
- func (*Message) ProtoMessage()
- func (x *Message) ProtoReflect() protoreflect.Message
- func (x *Message) Reset()
- func (x *Message) String() string
- type MessageType
- func (MessageType) Descriptor() protoreflect.EnumDescriptor
- func (x MessageType) Enum() *MessageType
- func (MessageType) EnumDescriptor() ([]byte, []int)deprecated
- func (x MessageType) Number() protoreflect.EnumNumber
- func (x MessageType) String() string
- func (MessageType) Type() protoreflect.EnumType
- type Option
- type OptionFunc
Constants ¶
View Source
const ( Server string = "nats-server" // Server specifies the Nats server Address Subject string = "nats-subject" // Subject specifies the NATs subject ApplicationName = "app_name" // ApplicationName specifies the application name. This often matches the actor system name Timeout = "timeout" // Timeout specifies the discovery timeout. The default value is 1 second )
Variables ¶
View Source
var ( MessageType_name = map[int32]string{ 0: "MESSAGE_TYPE_REGISTER", 1: "MESSAGE_TYPE_DEREGISTER", 2: "MESSAGE_TYPE_REQUEST", 3: "MESSAGE_TYPE_RESPONSE", } MessageType_value = map[string]int32{ "MESSAGE_TYPE_REGISTER": 0, "MESSAGE_TYPE_DEREGISTER": 1, "MESSAGE_TYPE_REQUEST": 2, "MESSAGE_TYPE_RESPONSE": 3, } )
Enum value maps for MessageType.
View Source
var File_nats_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Discovery ¶
type Discovery struct {
// contains filtered or unexported fields
}
Discovery represents the kubernetes discovery
func NewDiscovery ¶
NewDiscovery returns an instance of the kubernetes discovery provider
func (*Discovery) Deregister ¶
Deregister removes this node from a service discovery directory.
func (*Discovery) DiscoverNodes ¶
DiscoverNodes returns a list of known nodes.
func (*Discovery) Initialize ¶
Initialize initializes the plugin: registers some internal data structures, clients etc.
type Message ¶
type Message struct { // Specifies the host name of the client node Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` // Specifies the port of the client node Port int32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` // Specifies the client name Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` // Specifies the message type MessageType MessageType `protobuf:"varint,4,opt,name=message_type,json=messageType,proto3,enum=nats.MessageType" json:"message_type,omitempty"` // contains filtered or unexported fields }
Message defines the NATs message used by the discovery provider
func (*Message) Descriptor
deprecated
func (*Message) GetMessageType ¶
func (x *Message) GetMessageType() MessageType
func (*Message) ProtoMessage ¶
func (*Message) ProtoMessage()
func (*Message) ProtoReflect ¶
func (x *Message) ProtoReflect() protoreflect.Message
type MessageType ¶
type MessageType int32
MessageType defines the NATs message type
const ( MessageType_MESSAGE_TYPE_REGISTER MessageType = 0 MessageType_MESSAGE_TYPE_DEREGISTER MessageType = 1 MessageType_MESSAGE_TYPE_REQUEST MessageType = 2 MessageType_MESSAGE_TYPE_RESPONSE MessageType = 3 )
func (MessageType) Descriptor ¶
func (MessageType) Descriptor() protoreflect.EnumDescriptor
func (MessageType) Enum ¶
func (x MessageType) Enum() *MessageType
func (MessageType) EnumDescriptor
deprecated
func (MessageType) EnumDescriptor() ([]byte, []int)
Deprecated: Use MessageType.Descriptor instead.
func (MessageType) Number ¶
func (x MessageType) Number() protoreflect.EnumNumber
func (MessageType) String ¶
func (x MessageType) String() string
func (MessageType) Type ¶
func (MessageType) Type() protoreflect.EnumType
type Option ¶
type Option interface { // Apply sets the Option value of a config. Apply(disco *Discovery) }
Option is the interface that applies a configuration option.
type OptionFunc ¶
type OptionFunc func(disco *Discovery)
OptionFunc implements the Option interface.
func (OptionFunc) Apply ¶
func (f OptionFunc) Apply(disco *Discovery)
Apply applies the Cluster's option
Click to show internal directories.
Click to hide internal directories.