Documentation ¶
Index ¶
- type Event
- type Transport
- func (t *Transport) AsEndpoint() pubsub.Endpoint
- func (t *Transport) Close() error
- func (t *Transport) Closed() <-chan struct{}
- func (t *Transport) ErrorChan() <-chan error
- func (t *Transport) EventChan() <-chan pubsub.Event
- func (t *Transport) EventSeqTableChan() <-chan client.EventSeqTable
- func (t *Transport) Publish(eventKind string, eventObject interface{}) error
- func (t *Transport) Subscribe(eventKindPrefix string) error
- func (t *Transport) Unsubscribe(eventKindPrefix string) error
- func (t *Transport) Wait() error
- type TransportConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct {
// contains filtered or unexported fields
}
Event implements pubsub.Event, which is the interface required by the exchange.
func (*Event) SetSeq ¶
func (event *Event) SetSeq(seq pubsub.EventSeqNum)
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
Transport implements client.Transport so it can be used as the underlying transport for a Meeko client instance.
This particular transport is a bit special. It implements inproc transport that uses channels. It is suitable for clients that intend to live in the same process as Meeko.
For using Transport as a service Endpoint for the Meeko broker, check the AsEndpoint method.
func (*Transport) AsEndpoint ¶
AsTransport returns an adapter that makes Transport look like pubsub.Endpoint.
func (*Transport) EventSeqTableChan ¶
func (t *Transport) EventSeqTableChan() <-chan client.EventSeqTable
func (*Transport) Unsubscribe ¶
type TransportConfig ¶
type TransportConfig struct {
ChannelCapacity uint
}
TransportConfig serves as a factory for Transport. Once its fields are set to requested values, NewTransport method can be used to construct a Transport for the chosen configuration.
FeedFromEnv can be used to load config from environmental variables.
func NewTransportConfig ¶
func NewTransportConfig() *TransportConfig
NewTransportConfig creates a new TransportConfig with some reasonable defaults.
func (*TransportConfig) FeedFromEnv ¶
func (config *TransportConfig) FeedFromEnv(prefix string) error
FeedFromEnv loads config from the environment.
It checks variables looking like prefix + capitalizedFieldName.
func (*TransportConfig) MustFeedFromEnv ¶
func (config *TransportConfig) MustFeedFromEnv(prefix string) *TransportConfig
func (*TransportConfig) NewTransport ¶
func (config *TransportConfig) NewTransport(identity string, exchange pubsub.Exchange) *Transport
NewTransport creates a new Transport instance for the given configuration.