Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BaseStream ¶
type BaseStream struct { // WriteCloser (required) is the stream's underlying io.WriteCloser. io.WriteCloser // P (required) is this stream's properties. P *streamproto.Properties // contains filtered or unexported fields }
BaseStream is the standard implementation of the Stream interface.
func (*BaseStream) Properties ¶
func (s *BaseStream) Properties() *streamproto.Properties
Properties implements StreamClient.
func (*BaseStream) Write ¶
func (s *BaseStream) Write(data []byte) (int, error)
Write implements StreamClient.
func (*BaseStream) WriteDatagram ¶
func (s *BaseStream) WriteDatagram(dg []byte) error
WriteDatagram implements StreamClient.
type Client ¶
type Client interface { // NewStream creates a new stream with the supplied stream properties. NewStream(f streamproto.Flags) (Stream, error) }
Client is a client to a LogDog Butler StreamServer. A Client will connect to a StreamServer, negotiate a stream configuration, and return an active stream object that can be written to.
func New ¶
New instantiates a new Client instance. This type of instance will be parsed from the supplied path string, which takes the form:
<protocol>:<protocol-specific-spec>
Supported protocols and their respective specs are:
- unix:/path/to/socket describes a stream server listening on UNIX domain socket at "/path/to/socket".
Windows-only:
- net.pipe:name describes a stream server listening on Windows named pipe "\\.\pipe\name".
type ClientFactory ¶
ClientFactory is a generator function that is invoked by the Registry when a new Client is requested for its protocol.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry maps protocol prefix strings to their Client generator functions.
This allows multiple Butler stream protocols (e.g., "unix:", "net.pipe:", etc.) to be parsed from string.
func GetDefaultRegistry ¶
func GetDefaultRegistry() *Registry
GetDefaultRegistry returns the default client registry instance.
Initializes the registry on first invocation.
func (*Registry) NewClient ¶
NewClient invokes the protocol ClientFactory generator for the supplied protocol/address string, returning the generated Client.
func (*Registry) Register ¶
func (r *Registry) Register(name string, f ClientFactory)
Register registers a new protocol and its ClientFactory.
This can be invoked by calling NewClient with a path spec referencing that protocol.
type Stream ¶
type Stream interface { io.WriteCloser // WriteDatagram writes a LogDog Butler streaming datagram to the underlying // Writer. WriteDatagram([]byte) error // Properties returns a copy of this Stream's properties. Properties() *streamproto.Properties }
Stream is an individual LogDog Butler stream.