nw_client

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientHash

func ClientHash(seeds ...[]string) string

func NewHttpRequest

func NewHttpRequest(method, url string, content es_rewinder.ReadRewinder) (*http.Request, error)

Types

type Http

type Http interface {
	Call(clientHash string, endpoint string, req *http.Request) (res *http.Response, latency time.Duration, err error)
}

type RequestBuilder

type RequestBuilder interface {
	// Create new http request
	Build() (*http.Request, error)

	// Identifier of endpoint. That could be url or part of url.
	// This will be used for QoS control.
	Endpoint() string

	// String form of parameters. This will be used for logging.
	Param() string
}

type RequestUrlFilter

type RequestUrlFilter interface {
	// Filter sensitive information for recording
	FilterUrl(url string) string
}

type Rest

type Rest interface {
	Call(ctx api_context.Context, req RequestBuilder) (res es_response.Response)
}

Jump to

Keyboard shortcuts

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