server

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWrappedStream

func NewWrappedStream(ctx context.Context, stream grpc.ServerStream) grpc.ServerStream

func StreamServerInterceptor

func StreamServerInterceptor() grpc.StreamServerInterceptor

StreamServerInterceptor is a gRPC stream server interceptor

func UnaryServerInterceptor

func UnaryServerInterceptor() grpc.UnaryServerInterceptor

UnaryServerInterceptor is a gRPC unary server interceptor

Types

type InitRpcServerFunc

type InitRpcServerFunc func(s *server.Server) error

type Option

type Option func(*Options)

func Addr

func Addr(s string) Option

func BasePath

func BasePath(s string) Option

func EtcdAddr

func EtcdAddr(a []string) Option

func InitRpcServer

func InitRpcServer(f InitRpcServerFunc) Option

func Name

func Name(s string) Option

func Tracing

func Tracing(b bool) Option

func UpdateInterval

func UpdateInterval(i int) Option

type Options

type Options struct {
	Name          string
	Addr          string
	InitRpcServer InitRpcServerFunc

	// registry
	BasePath       string
	UpdateInterval int
	EtcdAddr       []string

	Tracing bool
}

type Server

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

func NewServer

func NewServer(opts ...Option) *Server

func (*Server) Init

func (s *Server) Init(opts ...Option)

func (*Server) Start

func (s *Server) Start() error

func (*Server) Stop

func (s *Server) Stop() error

type Transport

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

Transport is a gRPC transport.

func (*Transport) ClientIp

func (tr *Transport) ClientIp() string

ClientIp client ip

func (*Transport) FullPath

func (tr *Transport) FullPath() string

FullPath Service full method or path

func (*Transport) Kind

func (tr *Transport) Kind() transport.Kind

Kind returns the transport kind.

func (*Transport) RequestHeader

func (tr *Transport) RequestHeader() transport.Header

RequestHeader returns the request header.

func (*Transport) ResponseHeader

func (tr *Transport) ResponseHeader() transport.Header

ResponseHeader returns the reply header.

Jump to

Keyboard shortcuts

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