client

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2018 License: Apache-2.0 Imports: 14 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 {
	UploadProcess(processName string, actionsPath string, storeURL string, fossilizerURLs []string, pluginIDs []string) (*agent.Process, error)
	CreateMap(process string, refs []cs.SegmentReference, args ...string) (*cs.Segment, error)
	CreateSegment(process string, linkHash *types.Bytes32, action string, refs []cs.SegmentReference, 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 UploadProcessBody added in v0.3.0

type UploadProcessBody struct {
	Actions     string   `json:"actions"`
	StoreURL    urlObj   `json:"store"`
	Fossilizers []urlObj `json:"fossilizers"`
	Plugins     []idObj  `json:"plugins"`
}

UploadProcessBody is the body that should be sent with upload process.

Jump to

Keyboard shortcuts

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