Documentation ¶
Overview ¶
Package servodserver implements servod_service.proto (see proto for details)
Index ¶
- type ServodService
- func (s *ServodService) CallServod(ctx context.Context, req *api.CallServodRequest) (*api.CallServodResponse, error)
- func (s *ServodService) ExecCmd(ctx context.Context, req *api.ExecCmdRequest) (*api.ExecCmdResponse, error)
- func (s *ServodService) RunCli(cs model.CliSubcommand, a model.CliArgs, stdin io.Reader, routeToStd bool) (bytes.Buffer, bytes.Buffer, error)
- func (s *ServodService) StartServer(port int32) error
- func (s *ServodService) StartServod(ctx context.Context, req *api.StartServodRequest) (*longrunning.Operation, error)
- func (s *ServodService) StopServod(ctx context.Context, req *api.StopServodRequest) (*longrunning.Operation, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ServodService ¶
type ServodService struct {
// contains filtered or unexported fields
}
ServodService implementation of servod_service.proto
func NewServodService ¶
func NewServodService(ctx context.Context, logger *log.Logger, commandexecutor commandexecutor.CommandExecutorInterface) (*ServodService, func(), error)
NewServodService creates a new servod service.
func (*ServodService) CallServod ¶
func (s *ServodService) CallServod(ctx context.Context, req *api.CallServodRequest) (*api.CallServodResponse, error)
CallServod runs a servod command through an XML-RPC call. It runs the command inside the servod Docker container if the servod_docker_container_name parameter is provided in the request. Otherwise, it runs the command directly inside the host that the servo is physically connected to. Allowed methods: doc, get, set, and hwinit.
func (*ServodService) ExecCmd ¶
func (s *ServodService) ExecCmd(ctx context.Context, req *api.ExecCmdRequest) (*api.ExecCmdResponse, error)
ExecCmd executes a system command that is provided through the command parameter in the request. It allows the user to execute arbitrary commands that can't be handled by calling servod (e.g. update firmware through "futility", remote file copy through "scp"). It executes the command inside the servod Docker container if the servod_docker_container_name parameter is provided in the request. Otherwise, it executes the command directly inside the host that the servo is physically connected to.
func (*ServodService) RunCli ¶
func (s *ServodService) RunCli(cs model.CliSubcommand, a model.CliArgs, stdin io.Reader, routeToStd bool) (bytes.Buffer, bytes.Buffer, error)
RunCli runs servod service as execution by CLI.
func (*ServodService) StartServer ¶
func (s *ServodService) StartServer(port int32) error
StartServer starts servod server on requested port
func (*ServodService) StartServod ¶
func (s *ServodService) StartServod(ctx context.Context, req *api.StartServodRequest) (*longrunning.Operation, error)
StartServod runs a servod Docker container and starts the servod daemon inside the container if servod is containerized. Otherwise, it simply starts the servod daemon.
func (*ServodService) StopServod ¶
func (s *ServodService) StopServod(ctx context.Context, req *api.StopServodRequest) (*longrunning.Operation, error)
StopServod stops the servod daemon inside the container and stops the servod Docker container if servod is containerized. Otherwise, it simply stops the servod daemon.