server

package
Version: v0.3.19 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(logger *zap.Logger, options ...Option) *grpc.Server

New create a grpc server

func ParseFileDescriptor added in v0.3.19

func ParseFileDescriptor(descriptor protoreflect.FileDescriptor)

ParseFileDescriptor parse file descriptor

func RegisteAuthorizationValidator

func RegisteAuthorizationValidator(name string, handler func(authorization string, payload Payload) (userinfo interface{}, err error))

RegisteAuthorizationValidator some handler(s) for validate authorization and return userinfo

func RegisteProxyAuthorizationValidator

func RegisteProxyAuthorizationValidator(name string, handler func(proxyAuthorization string, payload Payload) (ok bool, err error))

RegisteProxyAuthorizationValidator some handler(s) for validate signature

Types

type Option

type Option func(*option)

Option how setup client

func WithCredential

func WithCredential(credential credentials.TransportCredentials) Option

WithCredential setup credential for tls

func WithEnforcementPolicy

func WithEnforcementPolicy(enforcementPolicy *keepalive.EnforcementPolicy) Option

WithEnforcementPolicy setup enforcement policy

func WithKeepAlive

func WithKeepAlive(keepalive *keepalive.ServerParameters) Option

WithKeepAlive setup keepalive parameters

func WithMarshalJournal added in v0.3.1

func WithMarshalJournal() Option

WithMarshalJournal marshal journal to json string

func WithNotifyHandler added in v0.3.19

func WithNotifyHandler(handler func(desc, err, stack, journalID string)) Option

WithNotifyHandler notify when got panic

func WithPrometheus

func WithPrometheus(addr string) Option

WithPrometheus prometheus metrics exposes on http://addr/metrics

func WithPrometheusPush

func WithPrometheusPush(gateway string) Option

WithPrometheusPush push prometheus metrics to the Pushgateway

type Payload

type Payload = interceptor.Payload

Payload rest or grpc payload

Jump to

Keyboard shortcuts

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