listener

package
Version: v0.1.4-beta Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2019 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Overview

* * @Author: xhzhang * @Date: 2019-04-18 16:36

* * @Author: xhzhang * @Date: 2019-04-19 10:12

* * @Author: xhzhang * @Date: 2019-04-19 10:25

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DealRecieveService

func DealRecieveService(w http.ResponseWriter, r *http.Request)

Register handler

func InitAgent

func InitAgent(etc string)

func Run

func Run()

Types

type Agent

type Agent struct {
	AgentID            string
	EtcdKey            string
	EtcdVal            string
	InstructionChannel string
	GraceChannel       string
	Services           []executor.Service
	ServicePrefix      string
}
var CurAgent *Agent

func NewAgent

func NewAgent() *Agent

func (*Agent) AddService

func (a *Agent) AddService(s executor.Service)

Add new service

func (*Agent) CheckRegisterIsExist

func (a *Agent) CheckRegisterIsExist(id string) bool

When registering a service, check if the service exists

func (*Agent) CheckServiceIsExist

func (a *Agent) CheckServiceIsExist(sidlist []string) ([]string, []string)

func (*Agent) GetService

func (a *Agent) GetService(serviceid string) executor.Service

Returns the service according to serviceid

func (*Agent) SetAgentID

func (a *Agent) SetAgentID(uuidfile string)

func (*Agent) SetEtcdKey

func (a *Agent) SetEtcdKey()

func (*Agent) SetEtcdVal

func (a *Agent) SetEtcdVal()

func (*Agent) SetInstructionChannel

func (a *Agent) SetInstructionChannel()

func (*Agent) SetServicePrefix

func (a *Agent) SetServicePrefix()

set config template

func (*Agent) SetServicesStruct

func (a *Agent) SetServicesStruct(slist []executor.Service)

set []Service to a.Services

func (*Agent) SyncService

func (a *Agent) SyncService(s executor.Service)

sync service

type Executor

type Executor interface {
	Exec(rs *executor.Result)
}

Executor interface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL