server

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2021 License: Apache-2.0 Imports: 24 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package server defines the Options of server

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyOptions

func ApplyOptions(opts []Option, o *Options)

ApplyOptions applies the given options.

Types

type Config

type Config struct {
	Address net.Addr

	// Duration that server waits for to allow any existing connection to be closed gracefully.
	ExitWaitTime time.Duration

	// Duration that server waits for after error occurs during connection accepting.
	AcceptFailedDelayTime time.Duration

	// Duration that the accepted connection waits for to read or write data, only works under NIO.
	MaxConnectionIdleTime time.Duration
}

Config contains some server-side configuration.

func NewConfig

func NewConfig() *Config

NewConfig creates a new default config.

type Option

type Option struct {
	F func(o *Options, di *utils.Slice)
}

Option is the only way to config a server.

type Options

type Options struct {
	Svr      *rpcinfo.EndpointBasicInfo
	Configs  rpcinfo.RPCConfig
	LockBits int
	Once     *configutil.OptionOnce

	MetaHandlers []remote.MetaHandler

	RemoteOpt *remote.ServerOption
	ErrHandle func(error) error
	Proxy     proxy.BackwardProxy

	// Registry is used for service registry.
	Registry registry.Registry
	// RegistryInfo is used to in registry.
	RegistryInfo *registry.Info

	ACLRules      []acl.RejectFunc
	Limits        *limit.Option
	LimitReporter limiter.LimitReporter

	MWBs []endpoint.MiddlewareBuilder

	Bus    event.Bus
	Events event.Queue

	// DebugInfo should only contains objects that are suitable for json serialization.
	DebugInfo    utils.Slice
	DebugService diagnosis.Service

	// Observability
	Logger     klog.FormatLogger
	TracerCtl  *internal_stats.Controller
	StatsLevel *stats.Level
}

Options is used to initialize the server.

func NewOptions

func NewOptions(opts []Option) *Options

NewOptions creates a default options.

Jump to

Keyboard shortcuts

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