client

package
v0.2.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// URLRequiredError is the error message returned when a client is initialized with an empty URL
	URLRequiredError string = "An URL must be provided to initialize a client"

	// ProcessNotFoundError is the error message returned when a
	ProcessNotFoundError string = "Not Found"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentClient

type AgentClient interface {
	CreateMap(process string, refs []SegmentRef, args ...string) (*cs.Segment, error)
	CreateSegment(process string, linkHash *types.Bytes32, action string, refs []SegmentRef, args ...string) (*cs.Segment, error)
	FindSegments(filter *store.SegmentFilter) (cs.SegmentSlice, error)
	GetInfo() (*agent.Info, error)
	GetMapIds(filter *store.MapFilter) ([]string, error)
	GetProcess(name string) (*agent.Process, error)
	GetProcesses() (agent.Processes, error)
	GetSegment(process string, linkHash *types.Bytes32) (*cs.Segment, error)
	URL() string
}

AgentClient is the interface for an agent client It can be used to access an agent's http endpoints.

func NewAgentClient

func NewAgentClient(agentURL string) (AgentClient, error)

NewAgentClient returns an initialized AgentClient If the provided url is empty, it will use a default one.

type ErrorData

type ErrorData struct {
	Status  int    `json:"status"`
	Message string `json:"error"`
}

ErrorData is the format used by an agent to format errors.

type SegmentRef

type SegmentRef struct {
	LinkHash *types.Bytes32 `json:"linkHash"`
	Process  string         `json:"process"`
	Segment  *cs.Segment    `json:"segment"`
	Meta     interface{}    `json:"meta"`
}

SegmentRef defines a format for a valid reference.

Jump to

Keyboard shortcuts

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