http

package
v0.0.0-...-e2c346a Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2015 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAgentClient

func NewAgentClient(
	endpoint string,
	directorID string,
	getTaskDelay time.Duration,
	httpClient bmhttpclient.HTTPClient,
	logger boshlog.Logger,
) bmac.AgentClient

func NewAgentRequest

func NewAgentRequest(endpoint string, httpClient bmhttpclient.HTTPClient, directorID string) agentRequest

Types

type AgentClientFactory

type AgentClientFactory interface {
	NewAgentClient(directorID, mbusURL string) bmac.AgentClient
}

func NewAgentClientFactory

func NewAgentClientFactory(
	getTaskDelay time.Duration,
	logger boshlog.Logger,
) AgentClientFactory

type AgentRequestMessage

type AgentRequestMessage struct {
	Method    string        `json:"method"`
	Arguments []interface{} `json:"arguments"`
	ReplyTo   string        `json:"reply_to"`
}

type AgentState

type AgentState struct {
	JobState string `json:"job_state"`
}

type ListResponse

type ListResponse struct {
	Value     []string
	Exception exceptionResponse
}

func (*ListResponse) GetException

func (r *ListResponse) GetException() exceptionResponse

func (*ListResponse) Unmarshal

func (r *ListResponse) Unmarshal(message []byte) error

type Response

type Response interface {
	Unmarshal([]byte) error
	GetException() exceptionResponse
}

type SimpleTaskResponse

type SimpleTaskResponse struct {
	Value     string
	Exception exceptionResponse
}

func (*SimpleTaskResponse) GetException

func (r *SimpleTaskResponse) GetException() exceptionResponse

func (*SimpleTaskResponse) Unmarshal

func (r *SimpleTaskResponse) Unmarshal(message []byte) error

type StateResponse

type StateResponse struct {
	Value     AgentState
	Exception exceptionResponse
}

func (*StateResponse) GetException

func (r *StateResponse) GetException() exceptionResponse

func (*StateResponse) Unmarshal

func (r *StateResponse) Unmarshal(message []byte) error

type TaskResponse

type TaskResponse struct {
	Value     interface{}
	Exception exceptionResponse
}

func (*TaskResponse) GetException

func (r *TaskResponse) GetException() exceptionResponse

func (*TaskResponse) TaskID

func (r *TaskResponse) TaskID() (string, error)

func (*TaskResponse) TaskState

func (r *TaskResponse) TaskState() (string, error)

TaskState returns the state of the task reported by agent.

Agent response to get_task can be in different format based on task state. If task state is running agent responds with value as { agent_task_id: "task-id", state: "running" } Otherwise the value is a string like "stopped".

func (*TaskResponse) Unmarshal

func (r *TaskResponse) Unmarshal(message []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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