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

package streamserver

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

Index

Package Files

base.go handshake.go namedPipe_posix.go streamserver.go tcp.go

type StreamServer Uses

type StreamServer interface {
    // Performs initial connection and setup, entering a listening state.
    Listen() error

    // 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
    //
    // Address may only be called while the StreamServer is actively listening.
    Address() string

    // Blocks, returning a new Stream when one is available. If the stream server
    // has closed, this will return nil.
    Next() (io.ReadCloser, *streamproto.Properties)

    // Closes the stream server, cleaning up resources.
    Close()
}

StreamServer is an interface to a backgound service that allows external processes to establish Butler streams.

func NewTCP4Server Uses

func NewTCP4Server(ctx context.Context, spec string) (StreamServer, error)

NewTCP4Server creates a new TCP/IP4 stream server.

spec is a string of the form [addr][:port].

If addr is not empty, it will be an IPv4 network address to bind to. If it is empty, the StreamServer will bind exclusively to localhost.

port must be a valid, available port. It may be omitted or <=0, in which case an ephemeral port will be chosen by the system. Note that, in this case, the caller cannot prescribe the port in advance, and must discover it via exported stream server parameters (externally) or by calling Address (internally).

func NewTCP6Server Uses

func NewTCP6Server(ctx context.Context, spec string) (StreamServer, error)

NewTCP6Server creates a new TCP/IP6 stream server.

spec is a string of the form [addr][:port].

If addr is not empty, it will be an IPv6 network address to bind to. If it is empty, the StreamServer will bind exclusively to localhost.

port must be a valid, available port. It may be omitted or <=0, in which case an ephemeral port will be chosen by the system. Note that, in this case, the caller cannot prescribe the port in advance, and must discover it via exported stream server parameters (externally) or by calling Address (internally).

func NewUNIXDomainSocketServer Uses

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

NewUNIXDomainSocketServer instantiates a new POSIX domain soecket server instance.

No resources are actually created until methods are called on the returned server.

Directories

PathSynopsis
localclient

Package streamserver imports 20 packages (graph) and is imported by 4 packages. Updated 2018-10-19. Refresh now. Tools for package owners.