generic

package
v0.53.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient

type APIClient struct {
	// contains filtered or unexported fields
}

func (*APIClient) GET

func (c *APIClient) GET(ctx context.Context, path string) (interface{}, *http.Response, error)

func (*APIClient) POST

func (c *APIClient) POST(ctx context.Context, path string, body io.Reader) (interface{}, *http.Response, error)

type Config

type Config struct {
	// HTTPClient is a custom HTTP client
	HTTPClient *http.Client
	// Debug enables debug-level logging
	Debug bool
	// BaseURL sets a custom API server base URL
	BaseURL string
}

APIConfig defines the available configuration options to customize the API client settings

type GenericAPI

type GenericAPI interface {
	GET(ctx context.Context, path string) (interface{}, *http.Response, error)
	POST(ctx context.Context, path string, body io.Reader) (interface{}, *http.Response, error)
}

func NewGenericAPIClient

func NewGenericAPIClient(cfg *Config) GenericAPI

Jump to

Keyboard shortcuts

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