origin

package
v0.0.0-...-5eca219 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMaxConns = 3
	DefaultBufSize  = 32768
)

Variables

View Source
var DefaultConfig = Config{
	MaxConns: DefaultMaxConns,
	BufSize:  DefaultBufSize,
}

Functions

This section is empty.

Types

type Config

type Config struct {
	MaxConns int
	BufSize  int
}

type Connector

type Connector struct {
	// contains filtered or unexported fields
}

func New

func New(config *Config) *Connector

New Connector instance for serving one (and only one) program instance.

func (*Connector) Close

func (cr *Connector) Close() error

Close causes currently blocked and future Connect calls to return nil. Established connections will not be closed.

func (*Connector) Connect

func (cr *Connector) Connect(ctx context.Context) func(context.Context, io.Reader, io.WriteCloser) error

Connect allocates a new I/O stream. The returned function is to be used to transfer data between a connection and the program instance. If it's non-nil, a connection was established.

func (*Connector) CreateInstance

func (cr *Connector) CreateInstance(ctx context.Context, config service.InstanceConfig, state []byte) (service.Instance, error)

func (*Connector) Discoverable

func (cr *Connector) Discoverable(context.Context) bool

func (*Connector) Properties

func (cr *Connector) Properties() service.Properties

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL