streamportserver

package
v0.0.0-...-646ff60 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: CC0-1.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = func(
	ctx context.Context,
) ProtocolSpecificConfig {
	return ProtocolSpecificConfig{
		IsTLS:          false,
		WriteQueueSize: 1024,
		WriteTimeout:   10 * time.Second,
		ReadTimeout:    10 * time.Second,
		ServerCert:     nil,
		ServerKey:      nil,
	}
}

Functions

This section is empty.

Types

type Config

type Config struct {
	ProtocolSpecificConfig `yaml:"config"`
	Type                   streamtypes.ServerType `yaml:"protocol"`
	ListenAddr             string                 `yaml:"listen"`
}

type GetPortServerser

type GetPortServerser interface {
	GetPortServers(context.Context) ([]Config, error)
}

type Option

type Option interface {
	// contains filtered or unexported methods
}

type OptionIsTLS

type OptionIsTLS bool

type OptionReadTimeout

type OptionReadTimeout time.Duration

type OptionServerCert

type OptionServerCert struct{ *x509.Certificate }

type OptionServerKey

type OptionServerKey struct{ crypto.PrivateKey }

type OptionWriteQueueSize

type OptionWriteQueueSize uint64

type OptionWriteTimeout

type OptionWriteTimeout time.Duration

type Options

type Options []Option

func (Options) ProtocolSpecificConfig

func (s Options) ProtocolSpecificConfig(
	ctx context.Context,
) ProtocolSpecificConfig

type ProtocolSpecificConfig

type ProtocolSpecificConfig struct {
	IsTLS          bool
	WriteQueueSize uint64
	WriteTimeout   time.Duration
	ReadTimeout    time.Duration
	ServerCert     *x509.Certificate
	ServerKey      crypto.PrivateKey
}

func (ProtocolSpecificConfig) Options

func (cfg ProtocolSpecificConfig) Options() Options

type Server

type Server interface {
	io.Closer

	ProtocolSpecificConfig() ProtocolSpecificConfig

	Type() streamtypes.ServerType
	ListenAddr() string

	NumBytesConsumerWrote() uint64
	NumBytesProducerRead() uint64
}

Jump to

Keyboard shortcuts

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