srpchttp

package
v0.0.0-...-b729584 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultPrefix = "/api/service"

Functions

func DecodeRequest

func DecodeRequest(ctx context.Context, r *http.Request) (interface{}, error)

func DecodeResponse

func DecodeResponse(ctx context.Context, resp *http.Response) (response interface{}, err error)

func EncodeRequest

func EncodeRequest(ctx context.Context, req *http.Request, request interface{}) error

func EncodeResponse

func EncodeResponse(_ context.Context, rw http.ResponseWriter, res interface{}) error

func ErrorEncoder

func ErrorEncoder(_ context.Context, err error, w http.ResponseWriter)

func MakeClientResponseDumper

func MakeClientResponseDumper(opt *DumperOptions) httptransport.ClientResponseFunc

func MakeRequestDumper

func MakeRequestDumper(opt *DumperOptions) httptransport.RequestFunc

func NewClientFactory

func NewClientFactory(conf *ClientFactoryConf) sd.Factory

func ServicePrefix

func ServicePrefix(c srpc.ServiceCoordinate) string

Types

type ClientFactoryConf

type ClientFactoryConf struct {
	Prefix  string
	Options []httptransport.ClientOption
}

type DumperOptions

type DumperOptions struct {
	Disabled bool
	SkipBody bool
	Out      bool
	OnError  func(error)
}

Jump to

Keyboard shortcuts

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