luci: go.chromium.org/luci/logdog/client/butler/streamserver Index | Files

package streamserver

import "go.chromium.org/luci/logdog/client/butler/streamserver"

Index

Package Files

namedPipe_posix.go streamserver.go

type ReadCloseWriteCloser Uses

type ReadCloseWriteCloser interface {
    io.ReadCloser
    CloseWrite() error
}

ReadCloseWriteCloser represents a client connection.

CloseWrite must be called once this stream has been registered/accounted for, and lets the client know that the server will be reading its data.

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

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() (ReadCloseWriteCloser, *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 6 packages. Updated 2019-12-07. Refresh now. Tools for package owners.