service_client

package
v0.0.0-...-2b7dcb4 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: BSD-2-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AggressiveTransport = &http.Transport{
	Proxy: http.ProxyFromEnvironment,
	DialContext: (&net.Dialer{
		Timeout:   1 * time.Second,
		KeepAlive: 90 * time.Second,
	}).DialContext,
	TLSHandshakeTimeout: 3 * time.Second,
	MaxIdleConns:        100,
	MaxIdleConnsPerHost: 8,
	IdleConnTimeout:     90 * time.Second,
}

Functions

func NewServiceClient

func NewServiceClient(serviceURL string) *serviceClient

func NewServiceClientWithOpts

func NewServiceClientWithOpts(serviceURL string, opts ServiceClientOpts) *serviceClient

Types

type NoopScrubber

type NoopScrubber struct{}

func (*NoopScrubber) Scrub

func (s *NoopScrubber) Scrub(str string) string

type Scrubber

type Scrubber interface {
	Scrub(string) string
}

A Scrubber will process a string and remove PII making it safe for logging and metrics.

type ServiceClient

type ServiceClient interface {
	Do(ctx context.Context, method, path string, jsonData interface{}, targetObject interface{}) error
	DoWithBearerAuth(ctx context.Context, method, path, access_token string, jsonData, targetObject interface{}) error
}

type ServiceClientOpts

type ServiceClientOpts struct {
	IncludeForwardedHeaders []string
	SigningKeyId            string
	SigningKey              string
	Scrubber                Scrubber
}

Jump to

Keyboard shortcuts

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