interfaces

package
v1.2.803 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2023 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultServices = map[string]bool{
	"debug.Testing/Input":  true,
	"debug.Testing/Stream": true,
	"debug.Info/Request":   true,
	"grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo": true,
}

Functions

This section is empty.

Types

type CertStorage added in v1.2.4

type CertStorage interface {
	Init() error
	GetCrt() (s [][]byte)
	OnChange(func())
}

type EventTypeProcess

type EventTypeProcess string
const (
	EventTypeProcessSplitter               EventTypeProcess = "http.splitter"
	EventTypeProcessHttpHandler            EventTypeProcess = "http.handler"
	EventTypeProcessHttpController         EventTypeProcess = "http.controller"
	EventTypeProcessGRPCWebController      EventTypeProcess = "grpc.web.controller"
	EventTypeProcessGRPCController         EventTypeProcess = "grpc.controller"
	EventTypeProcessHttpMiddlewareCompress EventTypeProcess = "http.middleware.compress"
)

type Interceptor

type Interceptor interface {
	Handler(http.Handler) http.Handler
	UnaryServerInterceptor() grpc.UnaryServerInterceptor
	StreamServerInterceptor() grpc.StreamServerInterceptor
}

type Limiter added in v1.2.803

type Limiter struct {
	Enable      bool    `yaml:"enable" default:"false"`
	Max         float64 `yaml:"max" default:"100"`
	PerIp       bool    `yaml:"perIp" default:"false"`
	EveryMinute bool    `yaml:"everyMinute" default:"false"`
}

type Listener

type Listener interface {
	Init(opt Options, interceptor ...Interceptor)
	//InitProcess - Without starting listener
	InitProcess(opt Options, interceptor ...Interceptor)
	Run() (err error)
	Close()
	RegisterMultipleHandler(MethodMultipleHandler)
	RegisterHttpHandler(path, method string, handler http.Handler)
	SetTracer(tracing.Tracing)
	UseWebSocket(pa string, onConnected WebSocketHandler, onMsg WebSocketHandlerOnMsg,
		onDisconnected WebSocketHandler) error
	GetInterceptor() (interceptor []Interceptor)
	GetServices() []string
	GetAllServices() (res []*proto.ServicesItems)
	GetOptions() Options
	GetTracer() tracing.Tracing
	NewMonitor() (mm interface{})
	SetMonitor(interface{})
	GetMonitor() (mm interface{})
	GetMonitorResponse() *proto.MonitorResponse
	GetLimiter() *limiter.Limiter
	GetGrpcServer() *grpc.Server
	GetTLSCerts() TLSCerts
	GlobalContext() context.Context
}

type Method

type Method string
const (
	MethodGET    Method = "GET"
	MethodPOST   Method = "POST"
	MethodPUT    Method = "PUT"
	MethodDELETE Method = "DELETE"
)

type MethodMultipleHandler

type MethodMultipleHandler interface{}

type MultipleHandlerOption

type MultipleHandlerOption interface {
	GetServiceDesc() []*grpc.ServiceDesc
	AllowMethod(string) []Method
}

MultipleHandlerOption -

type Options

type Options struct {
	ServiceName         string
	Listen              string
	Port                Port
	Logger              logger.Logger
	Pem                 string
	Vault               *proto.Vault
	AutoReloadPemDir    bool
	DisableSecure       bool
	EnableEncryption    bool
	Driver              string
	UseAuthCallback     UseAuthCallback
	ServiceInfo         *proto.ServicesInfo
	DisableMonitor      bool
	DefaultAllowHeaders []string
	Limiter             Limiter
	TraceLog            tracingInterface.DefaultLogSpanSave
}

type Port

type Port struct {
	Insecure int
	Secure   int
}

type RequestContext added in v0.0.10

type RequestContext struct {
	// contains filtered or unexported fields
}

func (*RequestContext) GetQuery added in v0.0.11

func (c *RequestContext) GetQuery() (val func() url.Values)

func (*RequestContext) GetRequestID added in v0.0.10

func (c *RequestContext) GetRequestID() (val string)

func (*RequestContext) SetQuery added in v0.0.11

func (c *RequestContext) SetQuery(val func() url.Values)

func (*RequestContext) SetRequestID added in v0.0.10

func (c *RequestContext) SetRequestID(val string)

type RequestContextType added in v0.0.10

type RequestContextType string
const RequestContextWebSocket RequestContextType = "RequestContextWebSocket"

type TLSCerts added in v1.1.7

type TLSCerts interface {
	Init()
	NewConfig(name string, dir string, autoReload bool, disableHttp2 bool, vault *proto.Vault) *tls.Config
}

type TcpConnectionInformation added in v1.1.3

type TcpConnectionInformation struct {
	Secure      bool
	ClientHello *tls.ClientHelloInfo
}

type TcpHandler added in v1.1.2

type TcpHandler func(conn net.Conn, info *TcpConnectionInformation, onDone TcpHandlerOnDone)

type TcpHandlerOnDone added in v1.1.3

type TcpHandlerOnDone func()

type UseAuthCallback

type UseAuthCallback func(r *http.Request) bool

type WebSocketHandler added in v0.0.10

type WebSocketHandler func(ctx context.Context, c *websocket.Conn) error

type WebSocketHandlerOnMsg added in v0.0.11

type WebSocketHandlerOnMsg func(ctx context.Context, data []byte, c *websocket.Conn) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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