Documentation
¶
Index ¶
- Constants
- func NewEventbusWithOption(option LocaledEventbusOption) (eb *localedEventbus)
- type ClusterEventbusOption
- type DeliveryOptions
- type EndpointMeta
- type EndpointStatus
- type EndpointTLS
- func (s EndpointTLS) CA() string
- func (s EndpointTLS) ClientCert() string
- func (s EndpointTLS) ClientKey() string
- func (s EndpointTLS) Enable() bool
- func (s EndpointTLS) ServerCert() string
- func (s EndpointTLS) ServerKey() string
- func (s EndpointTLS) ToClientTLSConfig() (config *tls.Config, err error)
- func (s EndpointTLS) ToServerTLSConfig() (config *tls.Config, err error)
- func (s EndpointTLS) VerifySSL() bool
- type EventHandler
- type Eventbus
- type LocaledEventbusOption
- type Meta
- type MultiMap
- func (h MultiMap) Add(key string, value string)
- func (h MultiMap) Empty() bool
- func (h MultiMap) Get(key string) (string, bool)
- func (h MultiMap) Keys() []string
- func (h MultiMap) Merge(o ...MultiMap)
- func (h MultiMap) Put(key string, value []string)
- func (h MultiMap) Remove(key string)
- func (h MultiMap) Values(key string) ([]string, bool)
- type Registration
- type RegistrationTLS
- type ReplyError
- func (e *ReplyError) Error() string
- func (e *ReplyError) GetMeta() errors.MultiMap
- func (e *ReplyError) GetStacktrace() (fn string, file string, line int)
- func (e *ReplyError) SetFailureCode(failureCode int) errors.CodeError
- func (e *ReplyError) SetId(id string) errors.CodeError
- func (e *ReplyError) String() string
- func (e *ReplyError) ToJson() []byte
- type ReplyFuture
- type ServiceDiscovery
- type Status
Constants ¶
View Source
const ( EndpointStatusRunning = EndpointStatus("RUNNING") EndpointStatusClosing = EndpointStatus("CLOSING") )
Variables ¶
This section is empty.
Functions ¶
func NewEventbusWithOption ¶
func NewEventbusWithOption(option LocaledEventbusOption) (eb *localedEventbus)
Types ¶
type ClusterEventbusOption ¶
type ClusterEventbusOption struct {
Host string `json:"host,omitempty"`
Port int `json:"port,omitempty"`
PublicHost string `json:"publicHost,omitempty"`
PublicPort int `json:"publicPort,omitempty"`
Meta *EndpointMeta `json:"meta,omitempty"`
Tags []string `json:"tags,omitempty"`
TLS *EndpointTLS `json:"tls,omitempty"`
EventChanCap int `json:"eventChanCap,omitempty"`
EventHandlerInstanceNumber int `json:"eventHandlerInstanceNumber,omitempty"`
EnableLocal bool `json:"enableLocal,omitempty"`
}
type DeliveryOptions ¶
type DeliveryOptions struct {
MultiMap
}
func NewDeliveryOptions ¶
func NewDeliveryOptions() DeliveryOptions
func (*DeliveryOptions) AddTag ¶
func (options *DeliveryOptions) AddTag(tags ...string)
type EndpointMeta ¶
func NewEndpointMeta ¶
func NewEndpointMeta() EndpointMeta
func (EndpointMeta) Empty ¶
func (meta EndpointMeta) Empty() bool
func (EndpointMeta) Keys ¶
func (meta EndpointMeta) Keys() []string
func (EndpointMeta) Merge ¶
func (meta EndpointMeta) Merge(o ...Meta)
func (EndpointMeta) Put ¶
func (meta EndpointMeta) Put(key string, value string)
func (EndpointMeta) Rem ¶
func (meta EndpointMeta) Rem(key string)
type EndpointStatus ¶
type EndpointStatus string
func (EndpointStatus) Closing ¶
func (s EndpointStatus) Closing() bool
func (EndpointStatus) Ok ¶
func (s EndpointStatus) Ok() bool
type EndpointTLS ¶
type EndpointTLS struct {
Enable_ bool `json:"enable,omitempty"`
VerifySSL_ bool `json:"verifySsl,omitempty"`
CA_ string `json:"ca,omitempty"`
ServerCert_ string `json:"serverCert,omitempty"`
ServerKey_ string `json:"serverKey,omitempty"`
ClientCert_ string `json:"clientCert,omitempty"`
ClientKey_ string `json:"clientKey,omitempty"`
}
func (EndpointTLS) CA ¶
func (s EndpointTLS) CA() string
func (EndpointTLS) ClientCert ¶
func (s EndpointTLS) ClientCert() string
func (EndpointTLS) ClientKey ¶
func (s EndpointTLS) ClientKey() string
func (EndpointTLS) Enable ¶
func (s EndpointTLS) Enable() bool
func (EndpointTLS) ServerCert ¶
func (s EndpointTLS) ServerCert() string
func (EndpointTLS) ServerKey ¶
func (s EndpointTLS) ServerKey() string
func (EndpointTLS) ToClientTLSConfig ¶
func (s EndpointTLS) ToClientTLSConfig() (config *tls.Config, err error)
func (EndpointTLS) ToServerTLSConfig ¶
func (s EndpointTLS) ToServerTLSConfig() (config *tls.Config, err error)
func (EndpointTLS) VerifySSL ¶
func (s EndpointTLS) VerifySSL() bool
type EventHandler ¶
type Eventbus ¶
type Eventbus interface {
Send(address string, v interface{}, options ...DeliveryOptions) (err error)
Request(address string, v interface{}, options ...DeliveryOptions) (reply *ReplyFuture)
RegisterHandler(address string, handler EventHandler, tags ...string) (err error)
Start(context context.Context)
Close(context context.Context)
}
func NewClusterEventbus ¶
func NewClusterEventbus(discovery ServiceDiscovery, option ClusterEventbusOption) (bus Eventbus, err error)
func NewEventbus ¶
func NewEventbus() Eventbus
type LocaledEventbusOption ¶
type Registration ¶
type Registration interface {
NodeId() (nodeId string)
NodeName() (nodeName string)
Id() (id string)
Group() (group string)
Name() (name string)
Status() (status Status)
Protocol() (protocol string)
Address() (address string)
Tags() (tags []string)
Meta() (meta Meta)
TLS() (registrationTLS RegistrationTLS)
}
type RegistrationTLS ¶
type ReplyError ¶
type ReplyError struct {
Id string `json:"id,omitempty"`
FailureCode int `json:"failureCode,omitempty"`
Code string `json:"code,omitempty"`
Message string `json:"message,omitempty"`
Meta errors.MultiMap `json:"meta,omitempty"`
}
func (*ReplyError) Error ¶
func (e *ReplyError) Error() string
func (*ReplyError) GetMeta ¶
func (e *ReplyError) GetMeta() errors.MultiMap
func (*ReplyError) GetStacktrace ¶
func (e *ReplyError) GetStacktrace() (fn string, file string, line int)
func (*ReplyError) SetFailureCode ¶
func (e *ReplyError) SetFailureCode(failureCode int) errors.CodeError
func (*ReplyError) String ¶
func (e *ReplyError) String() string
func (*ReplyError) ToJson ¶
func (e *ReplyError) ToJson() []byte
type ReplyFuture ¶
type ReplyFuture struct {
// contains filtered or unexported fields
}
func (*ReplyFuture) Result ¶
func (r *ReplyFuture) Result(v interface{}) (err error)
type ServiceDiscovery ¶
type ServiceDiscovery interface {
Publish(group string, name string, protocol string, address string, tags []string, meta Meta, registrationTLS RegistrationTLS) (registration Registration, err error)
UnPublish(registration Registration) (err error)
Get(group string, name string, tags ...string) (registration Registration, has bool, err error)
GetALL(group string, name string, tags ...string) (registrations []Registration, has bool, err error)
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.