Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Version of stela Version = "0.11.6" // DefaultStelaAddress by default stela assumes there is a local instance running DefaultStelaAddress = "127.0.0.1:31000" // DefaultStelaPort by default stela assumes there is a local instance running DefaultStelaPort = 31000 // DefaultMulticastAddress is the multicast IPV6 address stela communicates on DefaultMulticastAddress = "[ff12::9000]" // DefaultMulticastPort is the default multicast port DefaultMulticastPort = 31053 // ServiceName is how stela instances are registered as services ServiceName = "stela.services.fg" // DefaultMaxValueBytes only allows the Value byte slice to be 256 bytes DefaultMaxValueBytes = 256 // DefaultServerName Used for TLS gRPC. Name that matches the common name in the certificate of the server DefaultServerName = "Stela" )
View Source
const ( RegisterAction = iota DeregisterAction = iota )
Actions for Service
Variables ¶
This section is empty.
Functions ¶
func DecodeValue ¶
func DecodeValue(b []byte) interface{}
DecodeValue converts byte slice to interface{}
func EncodeValue ¶
func EncodeValue(v interface{}) []byte
EncodeValue converts interface{} to a byte slice
Types ¶
type Client ¶
type Client struct {
Address string // IPv4 address
ID string
// contains filtered or unexported fields
}
Client struct holds all the information about a client registering a service
func (*Client) GenerateID ¶
GenerateID will overwrite the id with a new rand 10 byte string
func (*Client) SubscribeCh ¶
SubscribeCh returns a channel of Services that is sent a service when one is removed or added
type Service ¶
type Service struct {
Name string
Hostname string
IPv4 string
IPv6 string
Port int32
Priority int32
Timeout int32 // The length of time, in milliseconds, before a service is deregistered
Action int32
Client *Client // Store reference to the client that registered the service
Value []byte
// contains filtered or unexported fields
}
Service used in request/response
func (*Service) GenerateID ¶
GenerateID will overwrite the id with a new rand 10 byte string
func (*Service) IPv4Address ¶
IPv4Address helper to combine IPv4 and Port
func (*Service) IPv6Address ¶
IPv6Address helper to combine IPv4 and Port
Click to show internal directories.
Click to hide internal directories.