app

package
v1.6.7-0...-b28dd99 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Config *config.Config
	Client *http.Client
	Logger *zap.SugaredLogger
	API    *Server
}

App represents main worker node application entrypoint.

func NewApp

func NewApp(config *config.Config, logger *zap.Logger) (*App, error)

NewApp returns new App instance.

func (*App) Run

func (a *App) Run() error

Run start main application loop.

type Server

type Server struct {
	pb.UnimplementedAPIServer
	// contains filtered or unexported fields
}

Server represents gRPC server.

func NewServer

func NewServer(config *config.Config, logger *zap.Logger, app *App) *Server

NewServer returns new gRPC server.

func (*Server) Connect

func (s *Server) Connect(ctx context.Context, in *empty.Empty) (*pb.HostInfo, error)

Connect returns worker host information.

func (*Server) Error

func (s *Server) Error() chan error

func (*Server) Run

func (s *Server) Run() error

Run starts the gRPC server.

func (*Server) StartJob

func (s *Server) StartJob(job *pb.Job, stream pb.API_StartJobServer) error

StartJob gRPC method.

func (*Server) StopJob

func (s *Server) StopJob(ctx context.Context, job *pb.Job) (*pb.JobStopResp, error)

StopJob gRPC method.

func (*Server) Usage

func (s *Server) Usage(stream pb.API_UsageServer) error

Usage returns stream of health data.

Jump to

Keyboard shortcuts

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