server

package
v0.0.0-...-d95efa9 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPRegisterFunc

func HTTPRegisterFunc(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption, registerFunc ...HTTPRegister) error

Types

type GRPCRegister

type GRPCRegister func(*grpc.Server)

type HTTPRegister

type HTTPRegister func(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) error

type Server

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

func NewServer

func NewServer() *Server

NewServer init server struct

func (*Server) AddGRPCMiddleware

func (s *Server) AddGRPCMiddleware(interceptor grpc.UnaryServerInterceptor)

AddGRPCMiddleware add gRPC middleware

func (*Server) AddHTTPHandle

func (s *Server) AddHTTPHandle(pattern string, handler http.Handler)

AddHTTPHandle add http handle

func (*Server) AddHTTPHandleFunc

func (s *Server) AddHTTPHandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))

AddHTTPHandleFunc add http handle func

func (*Server) AddHTTPMiddleware

func (s *Server) AddHTTPMiddleware(middleware func(next http.Handler) http.Handler)

AddHTTPMiddleware add http middleware

func (*Server) AddHTTPServeMuxOption

func (s *Server) AddHTTPServeMuxOption(option runtime.ServeMuxOption)

AddHTTPServeMuxOption add http serve mux option

func (*Server) Run

func (s *Server) Run() error

func (*Server) SetGRPCHandlerTimeout

func (s *Server) SetGRPCHandlerTimeout(t int)

func (*Server) SetGRPCIp

func (s *Server) SetGRPCIp(ip string)

SetGRPCIp set gRPC ip

func (*Server) SetGRPCPort

func (s *Server) SetGRPCPort(port string)

SetGRPCPort set gRPC port

func (*Server) SetGRPCRegister

func (s *Server) SetGRPCRegister(register GRPCRegister)

SetGRPCRegister register grpc handler

func (*Server) SetGatewayPattern

func (s *Server) SetGatewayPattern(pattern string)

SetGatewayPattern set gateway pattern

func (*Server) SetHTTPHandlerTimeout

func (s *Server) SetHTTPHandlerTimeout(t int)

SetHTTPHandlerTimeout set http handler timeout

func (*Server) SetHTTPIdleTimeout

func (s *Server) SetHTTPIdleTimeout(t int)

SetHTTPIdleTimeout set http idle timeout

func (*Server) SetHTTPIp

func (s *Server) SetHTTPIp(ip string)

SetHTTPIp set http ip

func (*Server) SetHTTPPort

func (s *Server) SetHTTPPort(port string)

SetHTTPPort set http port

func (*Server) SetHTTPReadTimeout

func (s *Server) SetHTTPReadTimeout(t int)

SetHTTPReadTimeout set http read timeout

func (*Server) SetHTTPRegister

func (s *Server) SetHTTPRegister(register HTTPRegister)

SetHTTPRegister set http register

func (*Server) SetHTTPWriteTimeout

func (s *Server) SetHTTPWriteTimeout(t int)

SetHTTPWriteTimeout set http read timeout

func (*Server) SetHttpQuitTimeout

func (s *Server) SetHttpQuitTimeout(t int)

SetHttpQuitTimeout set http quit timeout

func (*Server) SetMaxConnectionIdle

func (s *Server) SetMaxConnectionIdle(t int)

SetMaxConnectionIdle set max connection idle

func (*Server) SetMaxMsgSize

func (s *Server) SetMaxMsgSize(size int)

SetMaxMsgSize set max msg size

Jump to

Keyboard shortcuts

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