pack

package
v0.0.0-...-f011ba4 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyMiddlewares

func ApplyMiddlewares(input []byte, serviceConfig *config.ServiceConfig, middlewares ...Middleware) ([]byte, error)

func ApplyUnpackMiddlewares

func ApplyUnpackMiddlewares(input []byte, proxyData *protobuf.ProxyRespData, middlewares ...UnpackMiddleware) ([]byte, error)

func Compress

func Compress(input []byte, serviceConfig *config.ServiceConfig) ([]byte, error)

func Decode

func Decode(bodyBytes []byte) ([]byte, error)

func DecodeFastResp

func DecodeFastResp(bodyBytes []byte) ([]byte, *cerror.Err)

func DecodeResp

func DecodeResp(resp *http.Response) ([]byte, *cerror.Err)

func Decompress

func Decompress(input []byte, proxyData *protobuf.ProxyRespData) ([]byte, error)

func Decrypt

func Decrypt(input []byte, proxyData *protobuf.ProxyRespData) ([]byte, error)

func Encode

func Encode(bodyBytes []byte, serviceName string) ([]byte, error)

func EncodeReq

func EncodeReq(req *http.Request) ([]byte, *cerror.Err)

func Encrypt

func Encrypt(input []byte, serviceConfig *config.ServiceConfig) ([]byte, error)

func ProtobufEncode

func ProtobufEncode(input []byte, sc *config.ServiceConfig) ([]byte, error)

Types

type Middleware

type Middleware func([]byte, *config.ServiceConfig) ([]byte, error)

type PackHandler

type PackHandler interface {
	Fmap(fn func([]byte, *config.ServiceConfig) ([]byte, error)) PackHandler
}

func NewPackHandler

func NewPackHandler(b []byte, sc *config.ServiceConfig) PackHandler

type UnpackMiddleware

type UnpackMiddleware func([]byte, *protobuf.ProxyRespData) ([]byte, error)

Jump to

Keyboard shortcuts

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