core

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2018 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(config *viper.Viper, s chan error) (err error)

Run run agent

Types

type Agent

type Agent struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Agent representation of agent

func (*Agent) ControllerStart

func (a *Agent) ControllerStart() error

ControllerStart Start Controller

func (*Agent) DispatchAgent

func (a *Agent) DispatchAgent(agentMsg *control.Agent) error

DispatchAgent dispatch agent message

func (*Agent) DispatchSink

func (a *Agent) DispatchSink(payload *rpc.Message, sinkName string)

DispatchSink dispatch sink message

func (*Agent) DispatchSource

func (a *Agent) DispatchSource(payload *rpc.Message, sourceName string)

DispatchSource dispatch source message

func (*Agent) GetConfig

func (a *Agent) GetConfig() error

GetConfig Get Configuration from server

func (*Agent) GetSchemas

func (a *Agent) GetSchemas() *control.Agent

GetSchemas create message of schemas

func (*Agent) GetSourceAvailableAction

func (a *Agent) GetSourceAvailableAction(sourceName string, srcCtrl *control.Source)

GetSourceAvailableAction Controller asked for Available Actions, sending it

func (*Agent) HandleMessage

func (a *Agent) HandleMessage(async chan *rpc.Message)

HandleMessage Handle Message from rpc

func (*Agent) HealthCheck

func (a *Agent) HealthCheck() (alive bool)

HealthCheck returns true if agent and all source are up

func (*Agent) InitConfig

func (a *Agent) InitConfig() (err error)

InitConfig Init Config

func (*Agent) LoadMultiplexer

func (a *Agent) LoadMultiplexer(multiplexer *map[string][]string) error

LoadMultiplexer Load Multiplexer

func (*Agent) LoadSink

func (a *Agent) LoadSink(sinkName string, sinkType string, eventChan chan *events.LookatchEvent) (err error)

LoadSink Load Sinks from name

func (*Agent) LoadSinks

func (a *Agent) LoadSinks() (err error)

LoadSinks Load Sinks

func (*Agent) LoadSource

func (a *Agent) LoadSource(sourceName string, sourceType string, eventChan chan *events.LookatchEvent) (err error)

LoadSource Load Source from name

func (*Agent) LoadSources

func (a *Agent) LoadSources(multiplexer *map[string][]string) (err error)

LoadSources Load Sources

func (*Agent) SendAgentAvailableAction

func (a *Agent) SendAgentAvailableAction(agentCtrl *control.Agent) error

SendAgentAvailableAction send agent action

func (*Agent) SendAgentStatus

func (a *Agent) SendAgentStatus(agentCtrl *control.Agent) error

SendAgentStatus send agent status

func (*Agent) SendAvailableAction

func (a *Agent) SendAvailableAction(agentCtrl *control.Agent) (err error)

SendAvailableAction send all available action

func (*Agent) SendEncapsMessage

func (a *Agent) SendEncapsMessage(msg interface{}, typeMessage string) (err error)

SendEncapsMessage encaspule message and send to rpc

func (*Agent) SendMeta

func (a *Agent) SendMeta(agentCtrl *control.Agent) error

SendMeta Send all meta schema

func (*Agent) SendSchema

func (a *Agent) SendSchema(agentCtrl *control.Agent) error

SendSchema send all sources schema

func (*Agent) SendSourceAvailableAction

func (a *Agent) SendSourceAvailableAction(agentCtrl *control.Agent) error

SendSourceAvailableAction send source action

func (*Agent) SendSourceStatus

func (a *Agent) SendSourceStatus(agentCtrl *control.Agent) error

SendSourceStatus send source status

func (*Agent) SendStatus

func (a *Agent) SendStatus(agentCtrl *control.Agent) (err error)

SendStatus send agent status and source status

func (*Agent) UpdateConfig

func (a *Agent) UpdateConfig(agentCtrl *control.Agent) (err error)

UpdateConfig Update agent Config

type Auth

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

Auth representation of auth

func (*Auth) GetToken

func (a *Auth) GetToken() (token string, err error)

GetToken get new token

type Controller

type Controller struct {
	Status string
	// contains filtered or unexported fields
}

Controller representation of controller

func NewControllerClient

func NewControllerClient(conf *viper.Viper, auth *Auth) *Controller

NewControllerClient create new controller client

func (*Controller) RecvMessage

func (c *Controller) RecvMessage(async chan *rpc.Message)

RecvMessage receive message from channel

func (*Controller) StartChannel

func (c *Controller) StartChannel()

StartChannel start channel

type ControllerConfig

type ControllerConfig struct {
	Address string `json:"address"`
	Port    int    `json:"port"`
	Secure  bool   `json:"secure"`
}

ControllerConfig representation of controller config

type Multiplexer

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

Multiplexer representation of Multiplexer

func NewMultiplexer

func NewMultiplexer(in chan *events.LookatchEvent, outs []chan *events.LookatchEvent) (multiplexer *Multiplexer)

NewMultiplexer create new multiplexer

Jump to

Keyboard shortcuts

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