rest

package
v0.4.31 Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPStatusFromCode

func HTTPStatusFromCode(code codes.Code) int

func HTTPStatusFromError

func HTTPStatusFromError(err error) int

Types

type AESDecoderEncoder

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

func NewAESDecoderEncoder

func NewAESDecoderEncoder(key []byte) (*AESDecoderEncoder, error)

func (*AESDecoderEncoder) DecodeBody

func (d *AESDecoderEncoder) DecodeBody(request *http.Request) (io.Reader, error)

func (*AESDecoderEncoder) Encode

type AESResponseWriter

type AESResponseWriter struct {
	http.ResponseWriter
	// contains filtered or unexported fields
}

func (*AESResponseWriter) Write

func (a *AESResponseWriter) Write(msg []byte) (int, error)

type Decoder

type Decoder interface {
	DecodeBody(request *http.Request) (io.Reader, error)
}

type Encoder

type Encoder interface {
	Encode(rw http.ResponseWriter) (http.ResponseWriter, error)
}

type Method

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

type Option

type Option func(options *options)

Option func is for applying any params to hub options

func WithDecoder

func WithDecoder(d Decoder) Option

func WithEncoder

func WithEncoder(e Encoder) Option

func WithInterceptors added in v0.4.13

func WithInterceptors(interceptors ...grpc.UnaryServerInterceptor) Option

func WithLog added in v0.4.5

func WithLog(log *zap.Logger) Option

type Server

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

func NewServer

func NewServer(opts ...Option) *Server

func (*Server) Close

func (s *Server) Close()

func (*Server) RegisterService

func (s *Server) RegisterService(interfacePtr, concretePtr interface{}) error

func (*Server) Serve

func (s *Server) Serve(listeners ...net.Listener) error

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(rw http.ResponseWriter, request *http.Request)

func (*Server) Services added in v0.4.5

func (s *Server) Services() []string

type Service

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

Jump to

Keyboard shortcuts

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