luci: Index | Files

package streamserver

import ""


Package Files

namedPipe_posix.go streamserver.go

type StreamServer Uses

type StreamServer struct {
    // contains filtered or unexported fields

StreamServer implements a Logdog Butler listener.

This holds a named pipe listener (either a unix domain socket or windows Named Pipe, depending on the platform). Local processes on the machine may connect to this named pipe to stream data to Logdog.

func New Uses

func New(ctx context.Context, path string) (*StreamServer, error)

New creates a new StreamServer.

This has a platform-specific implementation.

On Mac/Linux, this makes a Unix Domain Socket based server, and `path` is required to be the absolute path to a filesystem location which is suitable for a domain socket. The location will be removed prior to, and after, use.

On Windows, this makes a Named Pipe based server. `path` must be a valid UNC path component, and will be used to listen on the named pipe "\\.\$path.$PID.$UNIQUE" where $PID is the process id of the current process and $UNIQUE is a monotonically increasing value within this process' memory.

`path` may be empty and a unique name will be chosen for you.

func (*StreamServer) Address Uses

func (s *StreamServer) Address() string

Address returns a string that can be used by the "streamclient" package to return a client for this StreamServer.

Full package is:

func (*StreamServer) Close Uses

func (s *StreamServer) Close()

Close terminates the stream server, cleaning up resources.

func (*StreamServer) Listen Uses

func (s *StreamServer) Listen() error

Listen performs initial connection and setup and runs a goroutine to listen for new connections.

func (*StreamServer) Next Uses

func (s *StreamServer) Next() (io.ReadCloser, *logpb.LogStreamDescriptor)

Next blocks, returning a new Stream when one is available. If the stream server has closed, this will return nil.

func (*StreamServer) String Uses

func (s *StreamServer) String() string

Package streamserver imports 14 packages (graph) and is imported by 4 packages. Updated 2021-01-24. Refresh now. Tools for package owners.