Documentation ¶
Overview ¶
Connection header
Index ¶
- Constants
- func NewDefaultLogger() *defaultLogger
- type Duration
- func (d *Duration) Add(other Duration) Duration
- func (d *Duration) Cmp(other Duration) int
- func (t *Duration) FromNSec(nsec uint64)
- func (t *Duration) FromSec(sec float64)
- func (t *Duration) IsZero() bool
- func (t *Duration) Normalize()
- func (d *Duration) Sleep() error
- func (d *Duration) Sub(other Duration) Duration
- func (t *Duration) ToNSec() uint64
- func (t *Duration) ToSec() float64
- type LogLevel
- type Logger
- type Message
- type MessageEvent
- type MessageType
- type NameMap
- type NameResolver
- type Node
- type NodeOption
- type Publisher
- type Rate
- type Reader
- type Service
- type ServiceClient
- type ServiceClientOption
- type ServiceFactory
- type ServiceHandler
- type ServiceServer
- type ServiceServerOption
- type ServiceType
- type SingleSubscriberPublisher
- type Subscriber
- type Time
- func (t *Time) Add(d Duration) Time
- func (t *Time) Cmp(other Time) int
- func (t *Time) Diff(from Time) Duration
- func (t *Time) FromNSec(nsec uint64)
- func (t *Time) FromSec(sec float64)
- func (t *Time) IsZero() bool
- func (t *Time) Normalize()
- func (t *Time) Sub(d Duration) Time
- func (t *Time) ToNSec() uint64
- func (t *Time) ToSec() float64
Constants ¶
const ( Sep = "/" GlobalNS = "/" PrivateNS = "~" )
const ( APIStatusError = -1 APIStatusFailure = 0 APIStatusSuccess = 1 Remap = ":=" )
const BufferSize = 1024
Variables ¶
This section is empty.
Functions ¶
func NewDefaultLogger ¶
func NewDefaultLogger() *defaultLogger
Types ¶
type Duration ¶
type Duration struct {
// contains filtered or unexported fields
}
func NewDuration ¶
type Logger ¶
type Logger interface { Severity() LogLevel SetSeverity(severity LogLevel) Debug(v ...interface{}) Debugf(format string, v ...interface{}) Info(v ...interface{}) Infof(format string, v ...interface{}) Warn(v ...interface{}) Warnf(format string, v ...interface{}) Error(v ...interface{}) Errorf(format string, v ...interface{}) Fatal(v ...interface{}) Fatalf(format string, v ...interface{}) }
type MessageEvent ¶
type MessageEvent struct { PublisherName string ReceiptTime time.Time ConnectionHeader map[string]string }
MessageEvent is an optional second argument to a Subscriber callback.
type MessageType ¶
type NameResolver ¶
type NameResolver struct {
// contains filtered or unexported fields
}
type Node ¶
type Node interface { // NewPublisher creates a publisher for specified topic and message type. NewPublisher(topic string, msgType MessageType) Publisher // NewPublisherWithCallbacks creates a publisher which gives you callbacks when subscribers // connect and disconnect. The callbacks are called in their own // goroutines, so they don't need to return immediately to let the // connection proceed. NewPublisherWithCallbacks(topic string, msgType MessageType, connectCallback, disconnectCallback func(SingleSubscriberPublisher)) Publisher // NewSubscriber creates a subscriber to specified topic, where // the messages are of a given type. callback should be a function // which takes 0, 1, or 2 arguments.If it takes 0 arguments, it will // simply be called without the message. 1-argument functions are // the normal case, and the argument should be of the generated message type. // If the function takes 2 arguments, the first argument should be of the // generated message type and the second argument should be of type MessageEvent. NewSubscriber(topic string, msgType MessageType, callback interface{}) Subscriber NewServiceClient(service string, srvType ServiceType, options ...ServiceClientOption) ServiceClient NewServiceServer(service string, srvType ServiceType, callback interface{}, options ...ServiceServerOption) ServiceServer OK() bool SpinOnce() Spin() Shutdown() GetParam(name string) (interface{}, error) SetParam(name string, value interface{}) error HasParam(name string) (bool, error) SearchParam(name string) (string, error) DeleteParam(name string) error Logger() Logger NonRosArgs() []string Name() string }
Node defines interface for a ros node
type NodeOption ¶
type NodeOption func(n *defaultNode)
NodeOption allows to customize created nodes.
func NodeServiceClientOptions ¶
func NodeServiceClientOptions(opts ...ServiceClientOption) NodeOption
NodeServiceClientOptions specifies default options applied to the service clients created in this node.
func NodeServiceServerOptions ¶
func NodeServiceServerOptions(opts ...ServiceServerOption) NodeOption
NodeServiceServerOptions specifies default options applied to the service servers created in this node.
type Rate ¶
type Rate struct {
// contains filtered or unexported fields
}
Impelement Rate interface
func (*Rate) ExpectedCycleTime ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader implements io.Reader interface and provides a no-copy way to read N bytes via Next() method. Reader is used by generated message to de-serialize byte arrays ([]uint8) without/ copying underlying data.
func NewReader ¶
NewReader creates new Reader and adopts the byte slice. The caller must not modify the slice after this call.
func (*Reader) Next ¶
Next returns a slice containing the next n bytes from the buffer, advancing the buffer as if the bytes had been returned by Read. The resulting slice is a sub-slice of the original slice.
Asking for more bytes than available would returns only the remaining bytes. Calling Next on an empty buffer, or after the buffer has been exhausted, returns an empty slice.
type ServiceClient ¶
type ServiceClientOption ¶
type ServiceClientOption func(c *defaultServiceClient)
ServiceClientOption customizes service client instances.
func ServiceClientTCPTimeout ¶
func ServiceClientTCPTimeout(t time.Duration) ServiceClientOption
ServiceClientTCPTimeout changes default timeout of 10ms to the specified timeout. This timeout is applied to each TCP operation (such as writing header to the connection, reading response header, etc), rather than TCP connection as a whole. Total timeout is dependent on the number of operations.
type ServiceFactory ¶
type ServiceHandler ¶
type ServiceHandler interface{}
type ServiceServer ¶
type ServiceServer interface {
Shutdown()
}
type ServiceServerOption ¶
type ServiceServerOption func(c *defaultServiceServer)
ServiceServerOption customizes service server instances.
func ServiceServerTCPTimeout ¶
func ServiceServerTCPTimeout(t time.Duration) ServiceServerOption
ServiceServerTCPTimeout changes default timeout of 10ms to the specified timeout. This timeout is applied to each TCP operation (such as writing header to the connection, reading response header, etc), rather than TCP connection as a whole. Total timeout is dependent on the number of operations.
type ServiceType ¶
type ServiceType interface { MD5Sum() string Name() string RequestType() MessageType ResponseType() MessageType NewService() Service }
type SingleSubscriberPublisher ¶
type SingleSubscriberPublisher interface { Publish(msg Message) GetSubscriberName() string GetTopic() string }
SingleSubscriberPublisher is a publisher which only sends to one specific subscriber. This is sent as an argument to the connect and disconnect callback functions passed to Node.NewPublisherWithCallbacks().
type Subscriber ¶
type Subscriber interface { GetNumPublishers() int Shutdown() }