agent

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: 6 Imported by: 0

Documentation

Overview

Package agent is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionInfo

type ActionInfo map[string][]string

ActionInfo is the data structure used by Process.GetInfo()

type Actions

type Actions map[string]func(...interface{}) interface{}

Actions is a map indexing an action function by its name

type Agent

type Agent interface {
	AddProcess(process string, actions Actions, storeClient interface{}, fossilizerClients []interface{}, opts *ProcessOptions) (Process, error)
	UploadProcess(processName string, actionsPath string, storeURL string, fossilizerURLs []string, pluginIDs []string) (*Process, error)
	FindSegments(filter store.SegmentFilter) (cs.SegmentSlice, error)
	GetInfo() (*Info, error)
	GetMapIds(filter store.MapFilter) ([]string, error)
	GetProcesses() (Processes, error)
	GetProcess(process string) (*Process, error)
	GetSegment(process string, linkHash types.Bytes32)
	HttpServer() *http.Server
	RemoveProcess(process string) (Processes, error)
	Url() string
}

Agent is the interface of an agent

type FossilizerInfo

type FossilizerInfo map[string]interface{}

FossilizerInfo is the generic data structure returned by Fossilizer.GetInfo()

type Info

type Info struct {
	Processes   ProcessesMap     `json:"processes"`
	Stores      []StoreInfo      `json:"stores"`
	Fossilizers []FossilizerInfo `json:"fossilizers"`
	Plugins     Plugins          `json:"plugins"`
}

Info is the data structure returned by Agent.GetInfo()

type MockAgent

type MockAgent struct {
	// contains filtered or unexported fields
}

MockAgent is a mock of Agent interface

func NewMockAgent

func NewMockAgent(ctrl *gomock.Controller) *MockAgent

NewMockAgent creates a new mock instance

func (*MockAgent) AddProcess

func (m *MockAgent) AddProcess(process string, actions Actions, storeClient interface{}, fossilizerClients []interface{}, opts *ProcessOptions) (Process, error)

AddProcess mocks base method

func (*MockAgent) EXPECT

func (m *MockAgent) EXPECT() *MockAgentMockRecorder

EXPECT returns an object that allows the caller to indicate expected use

func (*MockAgent) FindSegments

func (m *MockAgent) FindSegments(process string, opts map[string]string) (cs.SegmentSlice, error)

FindSegments mocks base method

func (*MockAgent) GetInfo

func (m *MockAgent) GetInfo() (*Info, error)

GetInfo mocks base method

func (*MockAgent) GetMapIds

func (m *MockAgent) GetMapIds(process string, opts map[string]string) (cs.SegmentSlice, error)

GetMapIds mocks base method

func (*MockAgent) GetProcess

func (m *MockAgent) GetProcess(process string) (Process, error)

GetProcess mocks base method

func (*MockAgent) GetProcesses

func (m *MockAgent) GetProcesses() (Processes, error)

GetProcesses mocks base method

func (*MockAgent) HttpServer

func (m *MockAgent) HttpServer() *http.Server

HttpServer mocks base method

func (*MockAgent) RemoveProcess

func (m *MockAgent) RemoveProcess(process string) (Processes, error)

RemoveProcess mocks base method

func (*MockAgent) UploadProcess added in v0.3.0

func (m *MockAgent) UploadProcess(processName string, actionsPath string, storeURL string, fossilizerURLs []string, pluginIDs []string) (*Process, error)

UploadProcess mocks base method

func (*MockAgent) Url

func (m *MockAgent) Url() string

Url mocks base method

type MockAgentMockRecorder

type MockAgentMockRecorder struct {
	// contains filtered or unexported fields
}

MockAgentMockRecorder is the mock recorder for MockAgent

func (*MockAgentMockRecorder) AddProcess

func (mr *MockAgentMockRecorder) AddProcess(process, actions, storeClient, fossilizerClients, opts interface{}) *gomock.Call

AddProcess indicates an expected call of AddProcess

func (*MockAgentMockRecorder) FindSegments

func (mr *MockAgentMockRecorder) FindSegments(process, opts interface{}) *gomock.Call

FindSegments indicates an expected call of FindSegments

func (*MockAgentMockRecorder) GetInfo

func (mr *MockAgentMockRecorder) GetInfo() *gomock.Call

GetInfo indicates an expected call of GetInfo

func (*MockAgentMockRecorder) GetMapIds

func (mr *MockAgentMockRecorder) GetMapIds(process, opts interface{}) *gomock.Call

GetMapIds indicates an expected call of GetMapIds

func (*MockAgentMockRecorder) GetProcess

func (mr *MockAgentMockRecorder) GetProcess(process interface{}) *gomock.Call

GetProcess indicates an expected call of GetProcess

func (*MockAgentMockRecorder) GetProcesses

func (mr *MockAgentMockRecorder) GetProcesses() *gomock.Call

GetProcesses indicates an expected call of GetProcesses

func (*MockAgentMockRecorder) HttpServer

func (mr *MockAgentMockRecorder) HttpServer() *gomock.Call

HttpServer indicates an expected call of HttpServer

func (*MockAgentMockRecorder) RemoveProcess

func (mr *MockAgentMockRecorder) RemoveProcess(process interface{}) *gomock.Call

RemoveProcess indicates an expected call of RemoveProcess

func (*MockAgentMockRecorder) UploadProcess added in v0.3.0

func (mr *MockAgentMockRecorder) UploadProcess(processName, actionsPath, storeURL, fossilizerURLs, pluginIDs interface{}) *gomock.Call

UploadProcess indicates an expected call of AddProcess

func (*MockAgentMockRecorder) Url

func (mr *MockAgentMockRecorder) Url() *gomock.Call

Url indicates an expected call of Url

type Plugin

type Plugin interface {
	// WillCreate is called right before a transition function from the agent's actions.
	// It takes the existing link as an argument. It should be updated in-place.
	WillCreate(*cs.Link)

	//is called whenever a link has been created by a transition function.
	// It takes the new link as an argument. It should be updated in-place.
	DidCreateLink(*cs.Link)

	// is called when segments are retrieved by the agent from the underlying storage.
	// It should return true if the plugins accepts the segment, false otherwise.
	FilterSegment(*cs.Segment) bool
}

Plugin is the interface describing the handlers that a plugin can implement

type PluginInfo

type PluginInfo struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	ID          string `json:"id"`
}

PluginInfo is the data structure used by the agent when returning informations about a process' plugins

type Plugins

type Plugins []PluginInfo

Plugins is a list of Plugin

type Process

type Process struct {
	Name            string           `json:"name"`
	ProcessInfo     ProcessInfo      `json:"processInfo"`
	StoreInfo       StoreInfo        `json:"storeInfo"`
	FossilizersInfo []FossilizerInfo `json:"fossilizersInfo"`
}

Process is the agent's representation of a process

type ProcessInfo

type ProcessInfo struct {
	Actions     map[string]ActionInfo `json:"actions"`
	PluginsInfo []PluginInfo          `json:"pluginsInfo"`
}

ProcessInfo is the data structure used to store information about a process actions and plugins

type ProcessOptions

type ProcessOptions struct {
	ReconnectTimeout int     `json:"reconnectTimeout"`
	Plugins          Plugins `json:"plugins"`
}

ProcessOptions can be used to configure a process when creating a new one

type Processes

type Processes []*Process

Processes is a list of Process

func (Processes) FindProcess

func (p Processes) FindProcess(name string) *Process

FindProcess returns the process whose name matches the provided one

type ProcessesMap

type ProcessesMap map[string]*Process

ProcessesMap is a mapping of processes indexed by name

type StoreInfo

type StoreInfo map[string]interface{}

StoreInfo is the generic data structured returned by Store.GetInfo()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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