Back to godoc.org

Package streamserver

v0.0.0-...-1557bcf
Latest Go to latest

The latest major version is .

Published: Aug 13, 2020 | License: Apache-2.0 | Module: github.com/luci/luci-go

Index

type StreamServer

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

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

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: go.chromium.org/luci/logdog/butlerlib/streamclient

func (*StreamServer) Close

func (s *StreamServer) Close()

Close terminates the stream server, cleaning up resources.

func (*StreamServer) Listen

func (s *StreamServer) Listen() error

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

func (*StreamServer) Next

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

func (s *StreamServer) String() string

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier