client

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: MPL-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteCountDecimal

func ByteCountDecimal(b int64) string

Types

type AuthMethod

type AuthMethod int64
const (
	JWT AuthMethod = iota
	MutualTLS
)

type BaseClient

type BaseClient interface {
	NewRequest(method string, path string, body interface{}) (*http.Request, error)
	Do(req *http.Request) (interface{}, *http.Response, error)
}

func NewBaseClient

func NewBaseClient(config ClientConfiguration) (BaseClient, error)

type ClientConfig

type ClientConfig struct {
	BaseURL *url.URL
	// contains filtered or unexported fields
}

func (*ClientConfig) Do

func (c *ClientConfig) Do(req *http.Request) (interface{}, *http.Response, error)

func (*ClientConfig) NewRequest

func (c *ClientConfig) NewRequest(method string, path string, body interface{}) (*http.Request, error)

type ClientConfiguration

type ClientConfiguration struct {
	URL              *url.URL
	AuthMethod       AuthMethod
	AuthMethodConfig interface{}
	CACertificate    string
}

type JWTConfig

type JWTConfig struct {
	Username      string
	Password      string
	URL           *url.URL
	CACertificate string
}

type MutualTLSConfig

type MutualTLSConfig struct {
	ClientCert string
	ClientKey  string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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