opt

package
v1.1.26 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option struct {
	//transportServer id can be set,or random
	//this is the unique identifier of the service
	Id string

	//transportServer name,eg.srv.hello or api.hello
	Name string

	//random port
	//Random ports make you don’t need to care about specific port numbers,
	//which are more commonly used in internal services
	RandPort *[2]int

	//socket tcp ip:port address
	TcpAddress string

	//websocket ip:port address
	WssAddress string

	//websocket relative path address of websocket
	WssPath string

	//http service address
	HttpAddress string

	//buffSize to data tunnel if it's need
	BuffSize int

	//transportServer transport
	TransportServer transport.Server

	//error packet
	//It will affect the format of the data you return
	Err parcel.ErrorPackager

	//receive system signal
	Signal []os.Signal

	//wrapper some middleware
	//it's can be interrupt
	//just for request response
	Wrappers []handler.WrapperHandler

	//just for http request before or socket setup before
	Dog []handler.DogHandler

	//when transportServer exit,will do exit func
	Exit []func()

	//etcd config
	EtcdConfig *clientv3.Config

	//config options
	ConfigOpt []config.Options

	//service discover registry
	Registry registry.Registry

	//service discover endpoint
	Endpoint *endpoint.Endpoint

	//only need cors middleware on roc http api POST/DELETE/GET/PUT/OPTIONS method
	CorsOptions *cors.Options
}

func NewOpts

func NewOpts(opts ...Options) Option

type Options

type Options func(option *Option)

Jump to

Keyboard shortcuts

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