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 ¶
- type LibReg
- type RunningLib
- type TestLibsServer
- func (s *TestLibsServer) FindLib(ctx context.Context, req *pb.GetLibRequest) (*pb.GetLibResponse, error)
- func (s *TestLibsServer) KillLib(ctx context.Context, req *pb.KillLibRequest) (*pb.KillLibResponse, error)
- func (s *TestLibsServer) Serve(wg *sync.WaitGroup) error
- func (s *TestLibsServer) StartLib(ctx context.Context, req *pb.GetLibRequest) (*pb.GetLibResponse, error)
- func (s *TestLibsServer) Stop(ctx context.Context)
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.
type RunningLib ¶
type RunningLib struct {
// contains filtered or unexported fields
}
RunningLib represents a running 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 ¶
func (s *TestLibsServer) FindLib(ctx context.Context, req *pb.GetLibRequest) (*pb.GetLibResponse, error)
FindLib takes in a request and looks up the given library (or starts one if it is not already running).
func (*TestLibsServer) KillLib ¶
func (s *TestLibsServer) KillLib(ctx context.Context, req *pb.KillLibRequest) (*pb.KillLibResponse, error)
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.