process_master

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2021 License: Apache-2.0 Imports: 37 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrClientNotInit = errors.New("no client")
)

Functions

func Process

func Process()

Types

type ExtenderSettingRaft added in v0.3.0

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

func NewExtenderRaft added in v0.3.0

func NewExtenderRaft(service raft_service.IService) *ExtenderSettingRaft

func (*ExtenderSettingRaft) Append added in v0.3.0

func (e *ExtenderSettingRaft) Append(cmd string, data []byte) error

func (*ExtenderSettingRaft) CommitHandler added in v0.3.0

func (e *ExtenderSettingRaft) CommitHandler(cmd string, data []byte) error

func (*ExtenderSettingRaft) Complete added in v0.3.0

func (e *ExtenderSettingRaft) Complete() error

func (*ExtenderSettingRaft) DelExtender added in v0.3.0

func (e *ExtenderSettingRaft) DelExtender(group, project string) (string, bool)

func (*ExtenderSettingRaft) GetExtenderVersion added in v0.3.0

func (e *ExtenderSettingRaft) GetExtenderVersion(group, project string) (string, bool)

func (*ExtenderSettingRaft) ProcessHandler added in v0.3.0

func (e *ExtenderSettingRaft) ProcessHandler(cmd string, body []byte) ([]byte, interface{}, error)

func (*ExtenderSettingRaft) ResetHandler added in v0.3.0

func (e *ExtenderSettingRaft) ResetHandler(data []byte) error

func (*ExtenderSettingRaft) SetExtender added in v0.3.0

func (e *ExtenderSettingRaft) SetExtender(group, project, version string) error

func (*ExtenderSettingRaft) Snapshot added in v0.3.0

func (e *ExtenderSettingRaft) Snapshot() []byte

type ForkStatus added in v0.3.0

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

func (*ForkStatus) IsRunningFork added in v0.3.0

func (fs *ForkStatus) IsRunningFork() bool

func (*ForkStatus) Start added in v0.3.0

func (fs *ForkStatus) Start() bool

func (*ForkStatus) Stop added in v0.3.0

func (fs *ForkStatus) Stop() bool

type IAdmin

type IAdmin interface {
}

type IWorkerProcess

type IWorkerProcess interface {
	TrafficStatus() ([]int, []int, error)
}

type Master

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

func NewMasterHandle

func NewMasterHandle() *Master

func (*Master) Close

func (m *Master) Close()

func (*Master) Fork

func (m *Master) Fork(pFile *pidfile.PidFile) error

Fork Master fork 子进程,入参为子进程需要的内容

func (*Master) Start

func (m *Master) Start(handler *MasterHandler) error

func (*Master) Wait

func (m *Master) Wait(pFile *pidfile.PidFile) error

type MasterCliServer added in v0.3.0

type MasterCliServer struct {
	service.UnimplementedCtiServiceServer
	// contains filtered or unexported fields
}

func NewMasterCliServer added in v0.3.0

func NewMasterCliServer(node *raft.Node, extendsRaft *ExtenderSettingRaft) *MasterCliServer

func (*MasterCliServer) ExtendsInstall added in v0.3.0

func (m *MasterCliServer) ExtendsInstall(ctx context.Context, request *service.ExtendsRequest) (*service.ExtendsResponse, error)

ExtendsInstall 安装拓展

func (*MasterCliServer) ExtendsUninstall added in v0.3.0

ExtendsUninstall卸载拓展

func (*MasterCliServer) ExtendsUpdate added in v0.3.0

func (m *MasterCliServer) ExtendsUpdate(ctx context.Context, request *service.ExtendsRequest) (*service.ExtendsResponse, error)

ExtendsUpdate 更新拓展

func (*MasterCliServer) Info added in v0.3.0

Info 获取节点信息

func (*MasterCliServer) Join added in v0.3.0

Join 加入集群操作

func (*MasterCliServer) Leave added in v0.3.0

Leave 将节点移除

func (*MasterCliServer) List added in v0.3.0

List 获取节点列表

type MasterHandler

type MasterHandler struct {
	Professions eosc.IProfessions
}

type MasterServiceServer added in v0.3.0

type MasterServiceServer struct {
	service.UnimplementedMasterServer
}

func NewMasterServiceServer added in v0.3.0

func NewMasterServiceServer() *MasterServiceServer

func (*MasterServiceServer) Hello added in v0.3.0

type ProfessionRaft

type ProfessionRaft struct {
	eosc.IProfessions
}

func NewProfessionRaft

func NewProfessionRaft(IProfessionsData eosc.IProfessions) *ProfessionRaft

func (*ProfessionRaft) Append added in v0.3.0

func (p *ProfessionRaft) Append(cmd string, data []byte) error

func (*ProfessionRaft) CommitHandler

func (p *ProfessionRaft) CommitHandler(cmd string, data []byte) error

func (*ProfessionRaft) Complete added in v0.3.0

func (p *ProfessionRaft) Complete() error

func (*ProfessionRaft) Delete

func (p *ProfessionRaft) Delete(name string) error

func (*ProfessionRaft) Encode

func (p *ProfessionRaft) Encode(startIndex int) ([]byte, []*os.File, error)

func (*ProfessionRaft) ProcessHandler

func (p *ProfessionRaft) ProcessHandler(cmd string, body []byte) ([]byte, interface{}, error)

func (*ProfessionRaft) ResetHandler

func (p *ProfessionRaft) ResetHandler(data []byte) error

func (*ProfessionRaft) Set

func (p *ProfessionRaft) Set(name string, profession *eosc.ProfessionConfig) error

func (*ProfessionRaft) Snapshot

func (p *ProfessionRaft) Snapshot() []byte

type WorkerConfigs added in v0.3.0

type WorkerConfigs struct {
	workers.ITypedWorkers
}

func NewWorkerConfigs added in v0.3.0

func NewWorkerConfigs() *WorkerConfigs

type WorkerController

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

func NewWorkerController

func NewWorkerController(traffic traffic.IController, config *config.Config, extenderSetting extenders.ITypedExtenderSetting, professions eosc.IProfessions, workers *WorkerConfigs, workerServiceProxy *WorkerServiceProxy) *WorkerController

func (*WorkerController) NewWorker

func (wc *WorkerController) NewWorker() error

func (*WorkerController) Stop

func (wc *WorkerController) Stop()

func (*WorkerController) WaitStart added in v0.3.1

func (wc *WorkerController) WaitStart()

type WorkerProcess

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

func (*WorkerProcess) Close

func (w *WorkerProcess) Close() error

type WorkerServiceProxy added in v0.3.0

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

func NewWorkerServiceProxy added in v0.3.0

func NewWorkerServiceProxy() *WorkerServiceProxy

func (*WorkerServiceProxy) AddExtender added in v0.3.0

func (*WorkerServiceProxy) DelExtenderCheck added in v0.3.0

func (*WorkerServiceProxy) Delete added in v0.3.0

func (*WorkerServiceProxy) DeleteCheck added in v0.3.0

func (*WorkerServiceProxy) GetWorkerProcess added in v0.3.0

func (wc *WorkerServiceProxy) GetWorkerProcess() service.WorkerServiceClient

func (*WorkerServiceProxy) Ping added in v0.3.0

func (*WorkerServiceProxy) Reset added in v0.3.0

func (*WorkerServiceProxy) Set added in v0.3.0

func (*WorkerServiceProxy) SetCheck added in v0.3.0

func (*WorkerServiceProxy) SetWorkerProcess added in v0.3.0

func (wc *WorkerServiceProxy) SetWorkerProcess(client service.WorkerServiceClient)

func (*WorkerServiceProxy) Status added in v0.3.0

type WorkersRaft

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

func NewWorkersRaft

func NewWorkersRaft(WorkerConfig *WorkerConfigs, professions eosc.IProfessions, workerServiceClient service.WorkerServiceClient, service raft_service.IService) *WorkersRaft

func (*WorkersRaft) Append added in v0.3.0

func (w *WorkersRaft) Append(cmd string, data []byte) error

func (*WorkersRaft) CommitHandler

func (w *WorkersRaft) CommitHandler(cmd string, data []byte) error

func (*WorkersRaft) Complete added in v0.3.0

func (w *WorkersRaft) Complete() error

func (*WorkersRaft) Delete

func (w *WorkersRaft) Delete(id string) (eosc.TWorker, error)

func (*WorkersRaft) GetList

func (w *WorkersRaft) GetList(profession string) ([]eosc.TWorker, error)

func (*WorkersRaft) GetWork

func (w *WorkersRaft) GetWork(id string) (eosc.TWorker, error)

func (*WorkersRaft) ProcessHandler

func (w *WorkersRaft) ProcessHandler(cmd string, body []byte) ([]byte, interface{}, error)

func (*WorkersRaft) ResetHandler

func (w *WorkersRaft) ResetHandler(data []byte) error

func (*WorkersRaft) Set

func (w *WorkersRaft) Set(profession, name, driver string, data []byte) (eosc.TWorker, error)

func (*WorkersRaft) Snapshot

func (w *WorkersRaft) Snapshot() []byte

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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