server

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: May 14, 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

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) (identifier string, 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

func WithMarshalJournal() Option

WithMarshalJournal marshal journal to json string

func WithNotifyHandler

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