client

package
v0.2.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

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)
	CreateLink(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