rpc

package
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Key = tokenKey{}

Functions

func AuthUnaryServerInterceptor

func AuthUnaryServerInterceptor(verifier token.Verifier) grpc.UnaryServerInterceptor

func GetAccessToken added in v0.4.6

func GetAccessToken(ctx context.Context) (*token.AccessToken, bool)

func LogUnaryServerInterceptor

func LogUnaryServerInterceptor(logger *zap.Logger) grpc.UnaryServerInterceptor

func MetricsUnaryServerInterceptor

func MetricsUnaryServerInterceptor() grpc.UnaryServerInterceptor

Types

type Option

type Option func(*Server)

func WithHandler

func WithHandler(path string, handler http.Handler) Option

func WithLogger

func WithLogger(logger *zap.Logger) Option

func WithMetrics

func WithMetrics(registerer metrics.Registerer) Option

func WithPort

func WithPort(port int) Option

func WithService

func WithService(service Service) Option

func WithVerifier

func WithVerifier(verifier token.Verifier) Option

type Server

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

func NewServer

func NewServer(service Service, certPath, keyPath, serverName string, opt ...Option) *Server

func (*Server) Run

func (s *Server) Run()

func (*Server) Stop

func (s *Server) Stop(timeout time.Duration)

type Service

type Service interface {
	Register(server *grpc.Server)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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