serversupport

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const CollectorServerURI = "/collector"
View Source
const ExecutorServerURI = "/executor"

Variables

This section is empty.

Functions

func Setup

func Setup()

func Teardown

func Teardown()

Types

type CollectorInvoker

type CollectorInvoker struct {
	*InvokerBase
}

func NewCollectorInvoker

func NewCollectorInvoker(serverHost string, serverPort uint16, user string) *CollectorInvoker

func (*CollectorInvoker) GetInvoker

return an invoker function for executor to invoke collector

type CollectorRequestBody

type CollectorRequestBody struct {
	Results []taskmodel.SubtaskResult `json:"Results"`
}

collector request body structure

type CollectorServer

type CollectorServer struct {
	*ServerBase
	// contains filtered or unexported fields
}

the Collector Server receive the requests of subtask results

func NewCollectorServer

func NewCollectorServer(handler taskmodel.CollectorRequestHandler) *CollectorServer

func (*CollectorServer) GetRegister

return a register function for collector to register a request handler to hander collector requests

func (*CollectorServer) Serve

func (s *CollectorServer) Serve(serverPort uint16) error

start the collector server to receive requests

type ExecutorInvoker

type ExecutorInvoker struct {
	*InvokerBase
}

func NewExecutorInvoker

func NewExecutorInvoker(serverHost string, serverPort uint16, user string) *ExecutorInvoker

func (*ExecutorInvoker) GetInvoker

func (e *ExecutorInvoker) GetInvoker() taskmodel.ExecutorInvoker

return an invoker function for scheduler to invoke the executor executor invoker, send subtasks to the executor

type ExecutorRequestBody

type ExecutorRequestBody struct {
	Subtasks []taskmodel.SubtaskBody `json:"Subtasks"`
}

type ExecutorServer

type ExecutorServer struct {
	*ServerBase
	// contains filtered or unexported fields
}

func NewExecutorServer

func NewExecutorServer(handler taskmodel.ExecutorRequestHandler) *ExecutorServer

func (*ExecutorServer) GetRegister

for executor to register a handler to process executor requests

func (*ExecutorServer) Serve

func (s *ExecutorServer) Serve(serverPort uint16) error

start the executor server to receive requests

func (*ExecutorServer) Shutdown

func (s *ExecutorServer) Shutdown() error

type InvokerBase

type InvokerBase struct {
	ServerHost string
	ServerPort uint16
	URI        string
	UserName   string
	// contains filtered or unexported fields
}

func NewInvokerBase

func NewInvokerBase(serverHost string, serverPort uint16, uri string, user string) *InvokerBase

type ServerBase

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

func NewServerBase

func NewServerBase() *ServerBase

func (*ServerBase) Shutdown

func (s *ServerBase) Shutdown() error

Jump to

Keyboard shortcuts

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