client

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

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

Go to latest
Published: Jun 24, 2016 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const Version = "v1"

Variables

View Source
var (
	ErrNotFound     = errors.New("Not Found")
	ErrAuthFailure  = errors.New("Authentication failed")
	ErrAccessDenied = errors.New("Access denied")
	ErrNilResponse  = errors.New("Nil response")
)

Functions

func ToQueryString

func ToQueryString(q interface{}) (string, error)

Convert an interface{} to a urlencoded querystring

Types

type Client

type Client struct {
	URL *url.URL

	ApiKey string
	// contains filtered or unexported fields
}

func New

func New(serverUrl, apiKey string, insecure bool) (*Client, error)

func (*Client) AddAgent

func (c *Client) AddAgent(a *model.AgentDTO) error

func (*Client) AddTask

func (c *Client) AddTask(t *model.TaskDTO) error

func (*Client) DeleteAgent

func (c *Client) DeleteAgent(a *model.AgentDTO) error

func (*Client) DeleteTask

func (c *Client) DeleteTask(t *model.TaskDTO) error

func (*Client) GetAgentById

func (c *Client) GetAgentById(id int64) (*model.AgentDTO, error)

func (*Client) GetAgentMetrics

func (c *Client) GetAgentMetrics(id int64) ([]*model.Metric, error)

func (*Client) GetAgents

func (c *Client) GetAgents(q *model.GetAgentsQuery) ([]*model.AgentDTO, error)

func (*Client) GetMetrics

func (c *Client) GetMetrics(q *model.GetMetricsQuery) ([]*model.Metric, error)

func (*Client) GetTaskById

func (c *Client) GetTaskById(id int64) (*model.TaskDTO, error)

func (*Client) GetTasks

func (c *Client) GetTasks(q *model.GetTasksQuery) ([]*model.TaskDTO, error)

func (*Client) Heartbeat

func (c *Client) Heartbeat() (bool, error)

func (*Client) UpdateAgent

func (c *Client) UpdateAgent(a *model.AgentDTO) error

func (*Client) UpdateTask

func (c *Client) UpdateTask(t *model.TaskDTO) error

Jump to

Keyboard shortcuts

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