Documentation ¶
Index ¶
- Variables
- func Process()
- type IAdmin
- type IWorkerProcess
- type Master
- func (m *Master) Close()
- func (m *Master) Fork() error
- func (m *Master) Hello(ctx context.Context, request *service.HelloRequest) (*service.HelloResponse, error)
- func (m *Master) Info(ctx context.Context, request *service.InfoRequest) (*service.InfoResponse, error)
- func (m *Master) Join(ctx context.Context, request *service.JoinRequest) (*service.JoinResponse, error)
- func (m *Master) Leave(ctx context.Context, request *service.LeaveRequest) (*service.LeaveResponse, error)
- func (m *Master) List(ctx context.Context, request *service.ListRequest) (*service.ListResponse, error)
- func (m *Master) Start(handler *MasterHandler) error
- func (m *Master) Wait() error
- type MasterHandler
- type ProfessionRaft
- func (p *ProfessionRaft) CommitHandler(cmd string, data []byte) error
- func (p *ProfessionRaft) Delete(name string) error
- func (p *ProfessionRaft) Encode(startIndex int) ([]byte, []*os.File, error)
- func (p *ProfessionRaft) ProcessHandler(cmd string, body []byte) ([]byte, interface{}, error)
- func (p *ProfessionRaft) ResetHandler(data []byte) error
- func (p *ProfessionRaft) Set(name string, profession *eosc.ProfessionConfig) error
- func (p *ProfessionRaft) Snapshot() []byte
- type WorkerController
- func (wc *WorkerController) Delete(ctx context.Context, in *service.WorkerDeleteRequest, opts ...grpc.CallOption) (*service.WorkerDeleteResponse, error)
- func (wc *WorkerController) DeleteCheck(ctx context.Context, in *service.WorkerDeleteRequest, opts ...grpc.CallOption) (*service.WorkerDeleteResponse, error)
- func (wc *WorkerController) NewWorker() error
- func (wc *WorkerController) Ping(ctx context.Context, in *service.WorkerHelloRequest, opts ...grpc.CallOption) (*service.WorkerHelloResponse, error)
- func (wc *WorkerController) Set(ctx context.Context, in *service.WorkerSetRequest, opts ...grpc.CallOption) (*service.WorkerSetResponse, error)
- func (wc *WorkerController) SetCheck(ctx context.Context, in *service.WorkerSetRequest, opts ...grpc.CallOption) (*service.WorkerSetResponse, error)
- func (wc *WorkerController) Start()
- func (wc *WorkerController) Stop()
- type WorkerProcess
- type WorkerProcessController
- type WorkersData
- type WorkersRaft
- func (w *WorkersRaft) CommitHandler(cmd string, data []byte) error
- func (w *WorkersRaft) Delete(id string) (eosc.TWorker, error)
- func (w *WorkersRaft) GetList(profession string) ([]eosc.TWorker, error)
- func (w *WorkersRaft) GetWork(id string) (eosc.TWorker, error)
- func (w *WorkersRaft) ProcessHandler(cmd string, body []byte) ([]byte, interface{}, error)
- func (w *WorkersRaft) ResetHandler(data []byte) error
- func (w *WorkersRaft) Set(profession, name, driver string, data []byte) (eosc.TWorker, error)
- func (w *WorkersRaft) Snapshot() []byte
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrClientNotInit = errors.New("no client")
)
Functions ¶
Types ¶
type IWorkerProcess ¶
type Master ¶
type Master struct { service.UnimplementedMasterServer service.UnimplementedCtiServiceServer PID *pidfile.PidFile // contains filtered or unexported fields }
func NewMasterHandle ¶
func (*Master) Hello ¶
func (m *Master) Hello(ctx context.Context, request *service.HelloRequest) (*service.HelloResponse, error)
func (*Master) Info ¶
func (m *Master) Info(ctx context.Context, request *service.InfoRequest) (*service.InfoResponse, error)
Info 获取节点信息
func (*Master) Join ¶
func (m *Master) Join(ctx context.Context, request *service.JoinRequest) (*service.JoinResponse, error)
Join 加入集群操作
func (*Master) Leave ¶
func (m *Master) Leave(ctx context.Context, request *service.LeaveRequest) (*service.LeaveResponse, error)
Leave 将节点移除
func (*Master) List ¶
func (m *Master) List(ctx context.Context, request *service.ListRequest) (*service.ListResponse, error)
List 获取节点列表
func (*Master) Start ¶
func (m *Master) Start(handler *MasterHandler) error
type MasterHandler ¶
type MasterHandler struct {
Professions eosc.IProfessionsData
}
type ProfessionRaft ¶
type ProfessionRaft struct {
eosc.IProfessionsData
}
func NewProfessionRaft ¶
func NewProfessionRaft(IProfessionsData eosc.IProfessionsData) *ProfessionRaft
func (*ProfessionRaft) CommitHandler ¶
func (p *ProfessionRaft) CommitHandler(cmd string, data []byte) error
func (*ProfessionRaft) Delete ¶
func (p *ProfessionRaft) Delete(name string) 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 WorkerController ¶
type WorkerController struct {
// contains filtered or unexported fields
}
func NewWorkerController ¶
func NewWorkerController(trafficController traffic.IController, dms ...eosc.IDataMarshaller) *WorkerController
func (*WorkerController) Delete ¶
func (wc *WorkerController) Delete(ctx context.Context, in *service.WorkerDeleteRequest, opts ...grpc.CallOption) (*service.WorkerDeleteResponse, error)
func (*WorkerController) DeleteCheck ¶
func (wc *WorkerController) DeleteCheck(ctx context.Context, in *service.WorkerDeleteRequest, opts ...grpc.CallOption) (*service.WorkerDeleteResponse, error)
func (*WorkerController) NewWorker ¶
func (wc *WorkerController) NewWorker() error
func (*WorkerController) Ping ¶
func (wc *WorkerController) Ping(ctx context.Context, in *service.WorkerHelloRequest, opts ...grpc.CallOption) (*service.WorkerHelloResponse, error)
func (*WorkerController) Set ¶
func (wc *WorkerController) Set(ctx context.Context, in *service.WorkerSetRequest, opts ...grpc.CallOption) (*service.WorkerSetResponse, error)
func (*WorkerController) SetCheck ¶
func (wc *WorkerController) SetCheck(ctx context.Context, in *service.WorkerSetRequest, opts ...grpc.CallOption) (*service.WorkerSetResponse, error)
func (*WorkerController) Start ¶
func (wc *WorkerController) Start()
func (*WorkerController) Stop ¶
func (wc *WorkerController) Stop()
type WorkerProcess ¶
type WorkerProcess struct { service.WorkerServiceClient // contains filtered or unexported fields }
func (*WorkerProcess) Close ¶
func (w *WorkerProcess) Close() error
type WorkerProcessController ¶
type WorkerProcessController interface { Stop() NewWorker() error Start() }
type WorkersData ¶
type WorkersData struct {
workers.ITypedWorkers
}
func NewWorkersData ¶
func NewWorkersData(ITypedWorkers workers.ITypedWorkers) *WorkersData
type WorkersRaft ¶
type WorkersRaft struct {
// contains filtered or unexported fields
}
func NewWorkersRaft ¶
func NewWorkersRaft(workerData *WorkersData, professions eosc.IProfessionsData, workerServiceClient service.WorkerServiceClient, service raft_service.IService, workerController WorkerProcessController) *WorkersRaft
func (*WorkersRaft) CommitHandler ¶
func (w *WorkersRaft) CommitHandler(cmd string, data []byte) error
func (*WorkersRaft) GetList ¶
func (w *WorkersRaft) GetList(profession 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) Snapshot ¶
func (w *WorkersRaft) Snapshot() []byte
Source Files ¶
Click to show internal directories.
Click to hide internal directories.