apislave

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2023 License: MIT Imports: 5 Imported by: 1

Documentation

Overview

Package apislave implements the Slave API.

https://wiki.ros.org/ROS/Slave_API

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a Slave API client.

func NewClient

func NewClient(address string, callerID string, httpClient *http.Client) *Client

NewClient allocates a Client.

func (*Client) GetBusInfo

func (c *Client) GetBusInfo() ([][]interface{}, error)

GetBusInfo writes a getBusInfo request.

func (*Client) GetPid

func (c *Client) GetPid() (int, error)

GetPid writes a getPid request.

func (*Client) GetPublications

func (c *Client) GetPublications() ([][]string, error)

GetPublications writes a getPublications request.

func (*Client) PublisherUpdate

func (c *Client) PublisherUpdate(topic string, urls []string) error

PublisherUpdate writes a publisherUpdate request.

func (*Client) RequestTopic

func (c *Client) RequestTopic(topic string, protocols [][]interface{}) (
	[]interface{}, error,
)

RequestTopic writes a requestTopic request.

func (*Client) Shutdown

func (c *Client) Shutdown(reason string) error

Shutdown writes a shutdown request.

type ErrorRes

type ErrorRes xmlrpc.ErrorRes

ErrorRes is the error returned by the server in case of wrong or unhandled requests.

type Request

type Request interface{}

Request is a slave API request.

type RequestGetBusInfo

type RequestGetBusInfo struct {
	CallerID string
}

RequestGetBusInfo is a getBusInfo request.

type RequestGetPid

type RequestGetPid struct {
	CallerID string
}

RequestGetPid is a getPid request.

type RequestGetPublications

type RequestGetPublications struct {
	CallerID string
}

RequestGetPublications is a getPublications request.

type RequestPublisherUpdate

type RequestPublisherUpdate struct {
	CallerID      string
	Topic         string
	PublisherURLs []string
}

RequestPublisherUpdate is a publisherUpdate request.

type RequestRequestTopic

type RequestRequestTopic struct {
	CallerID  string
	Topic     string
	Protocols [][]interface{}
}

RequestRequestTopic is a requestTopic request.

type RequestShutdown

type RequestShutdown struct {
	CallerID string
	Reason   string
}

RequestShutdown is a shutdown request.

type Response

type Response interface{}

Response is a slave API response.

type ResponseGetBusInfo

type ResponseGetBusInfo struct {
	Code          int
	StatusMessage string
	BusInfo       [][]interface{}
}

ResponseGetBusInfo is the response to a getBusInfo request.

type ResponseGetPid

type ResponseGetPid struct {
	Code          int
	StatusMessage string
	Pid           int
}

ResponseGetPid is the response to a getPid request.

type ResponseGetPublications

type ResponseGetPublications struct {
	Code          int
	StatusMessage string
	TopicList     [][]string
}

ResponseGetPublications is the response to a getPublications request.

type ResponsePublisherUpdate

type ResponsePublisherUpdate struct {
	Code          int
	StatusMessage string
	Ignore        int
}

ResponsePublisherUpdate is the response to a publisherUpdate request.

type ResponseRequestTopic

type ResponseRequestTopic struct {
	Code          int
	StatusMessage string
	Protocol      []interface{}
}

ResponseRequestTopic is the response to a requestTopic request.

type ResponseShutdown

type ResponseShutdown struct {
	Code          int
	StatusMessage string
	Ignore        int
}

ResponseShutdown is the response to a shutdown request.

type Server

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

Server is a Slave API server.

func NewServer

func NewServer(address string, nodeIP net.IP, nodeZone string, writeTimeout time.Duration) (*Server, error)

NewServer allocates a Server.

func (*Server) Close

func (s *Server) Close() error

Close closes the server.

func (*Server) Serve

func (s *Server) Serve(handler func(req Request) Response)

Serve starts serving requests and waits until the server is closed.

func (*Server) URL

func (s *Server) URL() string

URL returns the server URL.

Jump to

Keyboard shortcuts

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