Documentation ¶
Index ¶
- Variables
- func RandomJobID(prefix string) string
- type Client
- func (c *Client) AddJobs(req *host.AddJobsReq) (*host.AddJobsRes, error)
- func (c *Client) Close() error
- func (c *Client) DialHost(id string) (Host, error)
- func (c *Client) LeaderID() string
- func (c *Client) ListHosts() (map[string]host.Host, error)
- func (c *Client) NewLeaderSignal() <-chan struct{}
- func (c *Client) RPCClient() (RPCClient, error)
- func (c *Client) RegisterHost(host *host.Host, jobs chan *host.Job) *error
- func (c *Client) RemoveJobs(jobIDs []string) error
- func (c *Client) StreamHostEvents(ch chan<- *host.HostEvent) Stream
- type Host
- type LocalClient
- type RPCClient
- type ReadWriteCloser
- type ServiceSetFunc
- type Stream
Constants ¶
This section is empty.
Variables ¶
View Source
var Attempts = attempt.Strategy{ Min: 5, Total: 5 * time.Second, Delay: 200 * time.Millisecond, }
Attempts is the attempt strategy that is used to connect to the leader. It must not be modified after the first call to NewClient.
View Source
var ErrNoServers = errors.New("cluster: no servers found")
ErrNoServers is returned if no host servers are found
View Source
var ErrWouldWait = errors.New("cluster: attach would wait")
Functions ¶
func RandomJobID ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClientWithDial ¶
func NewClientWithDial(dial rpcplus.DialFunc, services ServiceSetFunc) (*Client, error)
func NewClientWithSelf ¶
func NewClientWithSelf(id string, self LocalClient) (*Client, error)
func (*Client) NewLeaderSignal ¶
func (c *Client) NewLeaderSignal() <-chan struct{}
NewLeaderSignal returns a channel that strobes exactly once when a new leader connection has been established successfully. It is an error to attempt to receive more than one value from the channel.
func (*Client) RegisterHost ¶
Register is used by flynn-host to register itself with the leader and get a stream of new jobs. It is not used by clients.
func (*Client) RemoveJobs ¶
RemoveJobs is used by flynn-host to delete jobs from the cluster state. It does not actually kill jobs running on hosts, and must not be used by clients.
func (*Client) StreamHostEvents ¶
type LocalClient ¶
type RPCClient ¶
type RPCClient interface { Call(serviceMethod string, args interface{}, reply interface{}) error Go(serviceMethod string, args interface{}, reply interface{}, done chan *rpcplus.Call) *rpcplus.Call StreamGo(serviceMethod string, args interface{}, replyStream interface{}) *rpcplus.Call Close() error }
type ReadWriteCloser ¶
type ReadWriteCloser interface { io.ReadWriteCloser CloseWrite() error }
type ServiceSetFunc ¶
Click to show internal directories.
Click to hide internal directories.