nats

package
v0.3.0-prep Latest Latest
Warning

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

Go to latest
Published: May 4, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllServicesResponse

type AllServicesResponse struct {
	Services []platform.Service
	ErrorResponse
}

type ApplyResponse

type ApplyResponse struct {
	Result fluxrpc.ApplyResult
	ErrorResponse
}

type ErrorResponse

type ErrorResponse struct {
	Error string
	Fatal bool
}

ErrorResponse is for dropping into responses so they have appropriate fields. The field `Error` carries either an empty string (no error), or the error message to be reconstituted as an error). The field `Fatal` indicates that the error resulted in the connection to the daemon being torn down.

type ExportResponse

type ExportResponse struct {
	Config []byte
	ErrorResponse
}

type NATS

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

func NewMessageBus

func NewMessageBus(url string, metrics platform.BusMetrics) (*NATS, error)

func (*NATS) AwaitPresence

func (n *NATS) AwaitPresence(instID flux.InstanceID, timeout time.Duration) error

Wait up to `timeout` for a particular instance to connect. Mostly useful for synchronising during testing.

func (*NATS) Connect

func (n *NATS) Connect(instID flux.InstanceID) (platform.Platform, error)

Connect returns a platform.Platform implementation that can be used to talk to a particular instance.

func (*NATS) Ping

func (n *NATS) Ping(instID flux.InstanceID) error

func (*NATS) Subscribe

func (n *NATS) Subscribe(instID flux.InstanceID, remote platform.Platform, done chan<- error)

Subscribe registers a remote platform.Platform implementation as the daemon for an instance (identified by instID). Any platform.FatalError returned when processing requests will result in the platform being deregistered, with the error put on the channel `done`.

type PingResponse

type PingResponse struct {
	ErrorResponse
}

type SomeServicesResponse

type SomeServicesResponse struct {
	Services []platform.Service
	ErrorResponse
}

type SyncResponse

type SyncResponse struct {
	Result fluxrpc.SyncResult
	ErrorResponse
}

type VersionResponse

type VersionResponse struct {
	Version string
	ErrorResponse
}

Jump to

Keyboard shortcuts

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