libsserver

package
v0.0.0-...-9994f1b Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2025 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Overview

Package libserver implements the test_libs_service.proto (see proto for details)

Package common defines shared resources across registration and test libs service.

Implements test_libs_service.proto (see proto for details)

Package main inplements the test_libs_service.proto (see proto for details)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LibReg

type LibReg struct {
	Name        string   `json:"name"`
	Registry    string   `json:"registry"`
	Version     int      `json:"version"`
	Image       string   `json:"image"`
	ExecCmd     []string `json:"exec_cmd"`
	LogDir      string   `json:"log_dir"`
	Port        string   `json:"port"`
	ServoPort   string   `json:"servo_port"`
	Ping        string   `json:"ping"`
	APIType     string   `json:"api_type"`
	Owners      []string `json:"owners"`
	Description string   `json:"description"`
}

LibReg represents the information provided by a single library when registering.

func (*LibReg) Validate

func (r *LibReg) Validate() error

Validate returns an error if the registration info has any issues.

type RunningLib

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

RunningLib represents a running docker container.

func (*RunningLib) Run

func (l *RunningLib) Run(ctx context.Context, cmd string, args string) ([]byte, error)

Run runs the given command on this docker container.

type TestLibsServer

type TestLibsServer struct {
	Port int32
	// contains filtered or unexported fields
}

TestLibsServer represents a Test Libs Service Server.

func New

func New(logger *log.Logger, outputDir, token string, req *pb.CrosToolRunnerTestRequest) (*TestLibsServer, error)

New creates a new server to listen to rpc requests.

func (*TestLibsServer) FindLib

FindLib takes in a request and looks up the given library (or starts one if it is not already running).

func (*TestLibsServer) KillLib

KillLib handles a KillLibRequest to stop the given library.

func (*TestLibsServer) Serve

func (s *TestLibsServer) Serve(wg *sync.WaitGroup) error

Serve creates and runs a grpc server with predefined parameters.

func (*TestLibsServer) StartLib

func (s *TestLibsServer) StartLib(ctx context.Context, req *pb.GetLibRequest) (*pb.GetLibResponse, error)

StartLib takes in a request and starts the given library.

func (*TestLibsServer) Stop

func (s *TestLibsServer) Stop(ctx context.Context)

Stop stops a Test Libs Server, including killing all running docker containers.

Jump to

Keyboard shortcuts

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