internal

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertEqual added in v0.0.3

func AssertEqual(t *testing.T, expected, actual any)

func AssertNotEqual added in v0.0.3

func AssertNotEqual(t *testing.T, expected, actual any)

func RequireErrorIs added in v0.0.3

func RequireErrorIs(t *testing.T, err error, target error)

func RequireNoError added in v0.0.3

func RequireNoError(t *testing.T, err error)

func TestHttpClient added in v0.0.2

func TestHttpClient(t *testing.T, createClient func() HttpClientTester)

Types

type Config

type Config struct {
	BaseURL string
	Header  http.Header
}

type HttpClient

type HttpClient interface {
	// SetConfig sets the config for the client, global config
	SetConfig(Config)

	// Do sends a request and returns a response
	Do(req *Request) (*Response, error)
}

HttpClient is the genapi client runtime, the generated client will call this interface to send requests You can provide your own implementation of HttpClient to use a different HTTP client

type HttpClientTester added in v0.0.2

type HttpClientTester interface {
	HttpClient
	GetClient() *http.Client
}

type Interface

type Interface interface {
	SetHttpClient(HttpClient)
}

Interface is the interface that mark this interface should be a genapi client that can be generated

type Option

type Option interface {
	Apply(Config)
}

type Request

type Request struct {
	Body       any
	Method     string
	Path       string
	Queries    url.Values
	Header     http.Header
	PathParams map[string]string
	Context    context.Context
}

type Response

type Response = http.Response

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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