transport

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OptionFunc

type OptionFunc func(*Options, *v1.Next) error

func (OptionFunc) Apply

func (fn OptionFunc) Apply(o *Options, cfg *v1.Next) error

type Options

type Options struct {
	Address    string                  // server address
	Timeout    time.Duration           // server timeout
	Context    context.Context         // server context
	Middleware []middleware.Middleware // server middleware
}

func NewDefaultOptions

func NewDefaultOptions(cfg *v1.Next, opts ...ServerOption) (*Options, error)

NewDefaultOptions returns a new Options with default values.

type ServerOption

type ServerOption interface {
	Apply(o *Options, cfg *v1.Next) error
}

func Address

func Address(address string) ServerOption

Address with server address.

func Middleware

func Middleware(m ...middleware.Middleware) ServerOption

Middleware with server middleware.

func Timeout

func Timeout(timeout time.Duration) ServerOption

Timeout with server timeout.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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