servodserver

package
v0.0.0-...-19f3ddf Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: BSD-3-Clause Imports: 20 Imported by: 0

Documentation

Overview

Package servodserver implements servod_service.proto (see proto for details)

Index

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

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

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

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

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.

Jump to

Keyboard shortcuts

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