acs

package
v0.0.0-...-0dec3e3 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2014 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 1 more Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const CONNECT_TIMEOUT = 3 * time.Second
View Source
const HEARTBEAT_JITTER = 3 * time.Minute
View Source
const HEARTBEAT_TIMEOUT = 5 * time.Minute

The maximum time to wait between heartbeats without disconnecting

Variables

This section is empty.

Functions

This section is empty.

Types

type AckRequest

type AckRequest struct {
	ClusterArn           string `json:"cluster"`
	ContainerInstanceArn string `json:"containerInstance"`
	MessageId            string `json:"messageId"`
}

type AgentCommunicationClient

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

AgentCommunicationClient is a client that keeps track of connections to the AgentCommunication backend service. It stores configuration needed to connect and its current connection

func NewAgentCommunicationClient

func NewAgentCommunicationClient(endpoint string, cfg *config.Config, credentialProvider credentials.AWSCredentialProvider, containerInstanceArn string) *AgentCommunicationClient

func (*AgentCommunicationClient) Ack

func (acc *AgentCommunicationClient) Ack(message *Payload) bool

Ack acknowledges that a given message was recieved. It is expected to be called after Poll such that Poll has already opened a websocket connection.

func (*AgentCommunicationClient) Poll

func (acc *AgentCommunicationClient) Poll(insecureCert bool) (<-chan *Payload, <-chan error, error)

Poll contacts the agent communication service and opens a websocket to wait for updates. It emits each state update to the Payload channel it returns

type HealthResponse

type HealthResponse struct {
	Healthy bool `json:"healthy"`
}

type Payload

type Payload struct {
	Tasks     []*api.Task
	MessageId string
}

type PollCallback

type PollCallback func(api.Task)

type PollResponse

type PollResponse struct {
	MessageType string `json:"type"`
	//TODO handle other messageTypes, this should be union type
	Message Payload `json:"message"`
}

Jump to

Keyboard shortcuts

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