Documentation ¶
Index ¶
- Constants
- func NewOutgoingMetrics(subsystem string, constLabels map[string]string) *outgoingMetrics
- func NewRequestBuilder() *builder
- func NewRequestBuilderWithCtx(ctx context.Context) *builder
- func NewTransport(opts clientOptions) http.RoundTripper
- type Client
- type Option
- type PromConfig
- type RequestOption
- type Transport
Constants ¶
View Source
const ( MIMEJSON = "application/json" MIMEHTML = "text/html" MIMEXML = "application/xml" MIMEXML2 = "text/xml" MIMEPlain = "text/plain" MIMEPOSTForm = "application/x-www-form-urlencoded" MIMEMultipartPOSTForm = "multipart/form-data" MIMEPROTOBUF = "application/x-protobuf" MIMEMSGPACK = "application/x-msgpack" MIMEMSGPACK2 = "application/msgpack" MIMEYAML = "application/x-yaml" )
Content-Type MIME of the most common data formats.
View Source
const GroupPathHeader = "X-Group-Path"
View Source
const RequestIDHeader = "X-Request-ID"
Variables ¶
This section is empty.
Functions ¶
func NewOutgoingMetrics ¶
func NewRequestBuilder ¶
func NewRequestBuilder() *builder
func NewTransport ¶
func NewTransport(opts clientOptions) http.RoundTripper
Types ¶
type Client ¶
type Client interface { PostJSON(c context.Context, url string, data, target interface{}, reqOptions ...RequestOption) (int, error) PostForm(c context.Context, url string, data, target interface{}, reqOptions ...RequestOption) (int, error) Get(c context.Context, url string, target interface{}, reqOptions ...RequestOption) (int, error) GetWithQuery(c context.Context, url string, data, target interface{}, reqOptions ...RequestOption) (int, error) GetWithoutEncodedQuery(c context.Context, url string, data, target interface{}, reqOptions ...RequestOption) (int, error) Do(ctx context.Context, request *http.Request, target interface{}) (int, error) }
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithBaseProm ¶
func WithPromConfig ¶
func WithPromConfig(config PromConfig) Option
func WithProxyURL ¶
func WithSkipLog ¶
func WithSplitLogBody ¶
func WithTimeout ¶
type PromConfig ¶
type PromConfig struct { Enable bool Subsystem string ConstLabel map[string]string Register prometheus.Registerer }
func NewBasePromConfig ¶
func NewBasePromConfig(subSystem, recipient string) PromConfig
func NewDefPromConfig ¶
func NewDefPromConfig() PromConfig
type RequestOption ¶
Click to show internal directories.
Click to hide internal directories.