server

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2020 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Options []Opt

Functions

func NewServer

func NewServer() *server

Types

type Opt

type Opt func(*Option) error

func WithDieHookFunc

func WithDieHookFunc(_func func()) Opt

func WithEtcdEndpoints

func WithEtcdEndpoints(endpoints []string) Opt

func WithIpWhiteList

func WithIpWhiteList(list []string) Opt

func WithMiddlewares

func WithMiddlewares(middlewareFuncs ...mux.MiddlewareFunc) Opt

func WithRatelimit

func WithRatelimit(limit int64) Opt

func WithServiceName

func WithServiceName(val string) Opt

func WithServices

func WithServices(srvs ...TwirpServer) Opt

type Option

type Option struct {
	ServiceName  string
	Services     []TwirpServer
	Middlewares  []mux.MiddlewareFunc
	DieHookFuncs []func()
	//
	EtcdEndpoints []string

	Ratelimit   int64
	IpWhiteList []string
}

type TwirpServer

type TwirpServer interface {
	http.Handler
	ServiceDescriptor() ([]byte, int)
	ProtocGenTwirpVersion() string
	PathPrefix() string
}

Jump to

Keyboard shortcuts

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