api

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: MIT Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package api provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.2 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGetV1ConfigNamespaceNameRequest

func NewGetV1ConfigNamespaceNameRequest(server string, namespace string, name string, params *GetV1ConfigNamespaceNameParams) (*http.Request, error)

NewGetV1ConfigNamespaceNameRequest constructs an http.Request for the GetV1ConfigNamespaceName method

func NewGetV1LicenseStatusRequest

func NewGetV1LicenseStatusRequest(server string) (*http.Request, error)

NewGetV1LicenseStatusRequest constructs an http.Request for the GetV1LicenseStatus method

func NewListV1ConfigsNamespaceRequest

func NewListV1ConfigsNamespaceRequest(server string, namespace string, params *ListV1ConfigsNamespaceParams) (*http.Request, error)

NewListV1ConfigsNamespaceRequest constructs an http.Request for the ListV1ConfigsNamespace method

func NewListV1ConfigsRequest

func NewListV1ConfigsRequest(server string, params *ListV1ConfigsParams) (*http.Request, error)

NewListV1ConfigsRequest constructs an http.Request for the ListV1Configs method

Types

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) GetV1ConfigNamespaceName

func (c *Client) GetV1ConfigNamespaceName(ctx context.Context, namespace string, name string, params *GetV1ConfigNamespaceNameParams, reqEditors ...RequestEditorFn) (*http.Response, error)

GetV1ConfigNamespaceName performs a GET /api/v1/configs/{namespace}/{name} (the `GetV1ConfigNamespaceName` operationId) request.

API to list or watch config objects for a specific gateway in a specific namespace.

func (*Client) GetV1LicenseStatus

func (c *Client) GetV1LicenseStatus(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

GetV1LicenseStatus performs a GET /api/v1/license (the `GetV1LicenseStatus` operationId) request.

API to obtain the current licensing status of the server. Note that the dataplane gets the licensing info as part of the dataplane config, this API endpoint serves purely informative purposes to get the license info even when there is still no dataplane provisioned.

func (*Client) ListV1Configs

func (c *Client) ListV1Configs(ctx context.Context, params *ListV1ConfigsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListV1Configs performs a GET /api/v1/configs (the `ListV1Configs` operationId) request.

API to list or watch config objects in all namespaces.

func (*Client) ListV1ConfigsNamespace

func (c *Client) ListV1ConfigsNamespace(ctx context.Context, namespace string, params *ListV1ConfigsNamespaceParams, reqEditors ...RequestEditorFn) (*http.Response, error)

ListV1ConfigsNamespace performs a GET /api/v1/configs/{namespace} (the `ListV1ConfigsNamespace` operationId) request.

API to list or watch config objects in a specific namespace.

type ClientInterface

type ClientInterface interface {

	// ListV1Configs performs a GET /api/v1/configs (the `ListV1Configs` operationId) request.
	//
	// API to list or watch config objects in all namespaces.
	ListV1Configs(ctx context.Context, params *ListV1ConfigsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListV1ConfigsNamespace performs a GET /api/v1/configs/{namespace} (the `ListV1ConfigsNamespace` operationId) request.
	//
	// API to list or watch config objects in a specific namespace.
	ListV1ConfigsNamespace(ctx context.Context, namespace string, params *ListV1ConfigsNamespaceParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetV1ConfigNamespaceName performs a GET /api/v1/configs/{namespace}/{name} (the `GetV1ConfigNamespaceName` operationId) request.
	//
	// API to list or watch config objects for a specific gateway in a specific namespace.
	GetV1ConfigNamespaceName(ctx context.Context, namespace string, name string, params *GetV1ConfigNamespaceNameParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetV1LicenseStatus performs a GET /api/v1/license (the `GetV1LicenseStatus` operationId) request.
	//
	// API to obtain the current licensing status of the server. Note that the dataplane gets the
	// licensing info as part of the dataplane config, this API endpoint serves purely informative
	// purposes to get the license info even when there is still no dataplane provisioned.
	GetV1LicenseStatus(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithRequestEditorFn

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) GetV1ConfigNamespaceNameWithResponse

func (c *ClientWithResponses) GetV1ConfigNamespaceNameWithResponse(ctx context.Context, namespace string, name string, params *GetV1ConfigNamespaceNameParams, reqEditors ...RequestEditorFn) (*GetV1ConfigNamespaceNameResponse, error)

GetV1ConfigNamespaceNameWithResponse performs a GET /api/v1/configs/{namespace}/{name} (the `GetV1ConfigNamespaceName` operationId) request.

API to list or watch config objects for a specific gateway in a specific namespace.

Returns a wrapper object for the known response body format(s).

func (*ClientWithResponses) GetV1LicenseStatusWithResponse

func (c *ClientWithResponses) GetV1LicenseStatusWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetV1LicenseStatusResponse, error)

GetV1LicenseStatusWithResponse performs a GET /api/v1/license (the `GetV1LicenseStatus` operationId) request.

API to obtain the current licensing status of the server. Note that the dataplane gets the licensing info as part of the dataplane config, this API endpoint serves purely informative purposes to get the license info even when there is still no dataplane provisioned.

Returns a wrapper object for the known response body format(s).

func (*ClientWithResponses) ListV1ConfigsNamespaceWithResponse

func (c *ClientWithResponses) ListV1ConfigsNamespaceWithResponse(ctx context.Context, namespace string, params *ListV1ConfigsNamespaceParams, reqEditors ...RequestEditorFn) (*ListV1ConfigsNamespaceResponse, error)

ListV1ConfigsNamespaceWithResponse performs a GET /api/v1/configs/{namespace} (the `ListV1ConfigsNamespace` operationId) request.

API to list or watch config objects in a specific namespace.

Returns a wrapper object for the known response body format(s).

func (*ClientWithResponses) ListV1ConfigsWithResponse

func (c *ClientWithResponses) ListV1ConfigsWithResponse(ctx context.Context, params *ListV1ConfigsParams, reqEditors ...RequestEditorFn) (*ListV1ConfigsResponse, error)

ListV1ConfigsWithResponse performs a GET /api/v1/configs (the `ListV1Configs` operationId) request.

API to list or watch config objects in all namespaces.

Returns a wrapper object for the known response body format(s).

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {

	// ListV1ConfigsWithResponse performs a GET /api/v1/configs (the `ListV1Configs` operationId) request.
	//
	// API to list or watch config objects in all namespaces.
	//
	// Returns a wrapper object for the known response body format(s).
	ListV1ConfigsWithResponse(ctx context.Context, params *ListV1ConfigsParams, reqEditors ...RequestEditorFn) (*ListV1ConfigsResponse, error)

	// ListV1ConfigsNamespaceWithResponse performs a GET /api/v1/configs/{namespace} (the `ListV1ConfigsNamespace` operationId) request.
	//
	// API to list or watch config objects in a specific namespace.
	//
	// Returns a wrapper object for the known response body format(s).
	ListV1ConfigsNamespaceWithResponse(ctx context.Context, namespace string, params *ListV1ConfigsNamespaceParams, reqEditors ...RequestEditorFn) (*ListV1ConfigsNamespaceResponse, error)

	// GetV1ConfigNamespaceNameWithResponse performs a GET /api/v1/configs/{namespace}/{name} (the `GetV1ConfigNamespaceName` operationId) request.
	//
	// API to list or watch config objects for a specific gateway in a specific namespace.
	//
	// Returns a wrapper object for the known response body format(s).
	GetV1ConfigNamespaceNameWithResponse(ctx context.Context, namespace string, name string, params *GetV1ConfigNamespaceNameParams, reqEditors ...RequestEditorFn) (*GetV1ConfigNamespaceNameResponse, error)

	// GetV1LicenseStatusWithResponse performs a GET /api/v1/license (the `GetV1LicenseStatus` operationId) request.
	//
	// API to obtain the current licensing status of the server. Note that the dataplane gets the
	// licensing info as part of the dataplane config, this API endpoint serves purely informative
	// purposes to get the license info even when there is still no dataplane provisioned.
	//
	// Returns a wrapper object for the known response body format(s).
	GetV1LicenseStatusWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetV1LicenseStatusResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type GetV1ConfigNamespaceNameParams

type GetV1ConfigNamespaceNameParams struct {
	// Watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications.
	Watch *bool `form:"watch,omitempty" json:"watch,omitempty"`

	// Label A label describing the client, as key=value, repeated per label. The server hands the labels to its config patcher without interpreting them.
	Label *[]string `form:"label,omitempty" json:"label,omitempty"`
}

GetV1ConfigNamespaceNameParams defines parameters for GetV1ConfigNamespaceName.

type GetV1ConfigNamespaceNameResponse

type GetV1ConfigNamespaceNameResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *V1Config
	// JSON404 the response for an HTTP 404 `application/json` response
	JSON404 *V1Error
	// JSON500 the response for an HTTP 500 `application/json` response
	JSON500 *V1Error
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *V1Error
}

func ParseGetV1ConfigNamespaceNameResponse

func ParseGetV1ConfigNamespaceNameResponse(rsp *http.Response) (*GetV1ConfigNamespaceNameResponse, error)

ParseGetV1ConfigNamespaceNameResponse parses an HTTP response from a GetV1ConfigNamespaceNameWithResponse call

func (GetV1ConfigNamespaceNameResponse) ContentType

func (r GetV1ConfigNamespaceNameResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetV1ConfigNamespaceNameResponse) GetBody

func (r GetV1ConfigNamespaceNameResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetV1ConfigNamespaceNameResponse) GetJSON200

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetV1ConfigNamespaceNameResponse) GetJSON404

func (r GetV1ConfigNamespaceNameResponse) GetJSON404() *V1Error

GetJSON404 returns the response for an HTTP 404 `application/json` response

func (GetV1ConfigNamespaceNameResponse) GetJSON500

func (r GetV1ConfigNamespaceNameResponse) GetJSON500() *V1Error

GetJSON500 returns the response for an HTTP 500 `application/json` response

func (GetV1ConfigNamespaceNameResponse) GetJSONDefault

func (r GetV1ConfigNamespaceNameResponse) GetJSONDefault() *V1Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetV1ConfigNamespaceNameResponse) Status

Status returns HTTPResponse.Status

func (GetV1ConfigNamespaceNameResponse) StatusCode

func (r GetV1ConfigNamespaceNameResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetV1LicenseStatusResponse

type GetV1LicenseStatusResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *V1LicenseStatus
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *V1Error
}

func ParseGetV1LicenseStatusResponse

func ParseGetV1LicenseStatusResponse(rsp *http.Response) (*GetV1LicenseStatusResponse, error)

ParseGetV1LicenseStatusResponse parses an HTTP response from a GetV1LicenseStatusWithResponse call

func (GetV1LicenseStatusResponse) ContentType

func (r GetV1LicenseStatusResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (GetV1LicenseStatusResponse) GetBody

func (r GetV1LicenseStatusResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (GetV1LicenseStatusResponse) GetJSON200

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (GetV1LicenseStatusResponse) GetJSONDefault

func (r GetV1LicenseStatusResponse) GetJSONDefault() *V1Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (GetV1LicenseStatusResponse) Status

Status returns HTTPResponse.Status

func (GetV1LicenseStatusResponse) StatusCode

func (r GetV1LicenseStatusResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type ListV1ConfigsNamespaceParams

type ListV1ConfigsNamespaceParams struct {
	// Watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications.
	Watch *bool `form:"watch,omitempty" json:"watch,omitempty"`
}

ListV1ConfigsNamespaceParams defines parameters for ListV1ConfigsNamespace.

type ListV1ConfigsNamespaceResponse

type ListV1ConfigsNamespaceResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *V1ConfigList
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *V1Error
}

func ParseListV1ConfigsNamespaceResponse

func ParseListV1ConfigsNamespaceResponse(rsp *http.Response) (*ListV1ConfigsNamespaceResponse, error)

ParseListV1ConfigsNamespaceResponse parses an HTTP response from a ListV1ConfigsNamespaceWithResponse call

func (ListV1ConfigsNamespaceResponse) ContentType

func (r ListV1ConfigsNamespaceResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListV1ConfigsNamespaceResponse) GetBody

func (r ListV1ConfigsNamespaceResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListV1ConfigsNamespaceResponse) GetJSON200

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListV1ConfigsNamespaceResponse) GetJSONDefault

func (r ListV1ConfigsNamespaceResponse) GetJSONDefault() *V1Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (ListV1ConfigsNamespaceResponse) Status

Status returns HTTPResponse.Status

func (ListV1ConfigsNamespaceResponse) StatusCode

func (r ListV1ConfigsNamespaceResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListV1ConfigsParams

type ListV1ConfigsParams struct {
	// Watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications.
	Watch *bool `form:"watch,omitempty" json:"watch,omitempty"`
}

ListV1ConfigsParams defines parameters for ListV1Configs.

type ListV1ConfigsResponse

type ListV1ConfigsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	// JSON200 the response for an HTTP 200 `application/json` response
	JSON200 *V1ConfigList
	// JSONDefault the response for an HTTP default `application/json` response
	JSONDefault *V1Error
}

func ParseListV1ConfigsResponse

func ParseListV1ConfigsResponse(rsp *http.Response) (*ListV1ConfigsResponse, error)

ParseListV1ConfigsResponse parses an HTTP response from a ListV1ConfigsWithResponse call

func (ListV1ConfigsResponse) ContentType

func (r ListV1ConfigsResponse) ContentType() string

ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers

func (ListV1ConfigsResponse) GetBody

func (r ListV1ConfigsResponse) GetBody() []byte

GetBody returns the raw response body bytes

func (ListV1ConfigsResponse) GetJSON200

func (r ListV1ConfigsResponse) GetJSON200() *V1ConfigList

GetJSON200 returns the response for an HTTP 200 `application/json` response

func (ListV1ConfigsResponse) GetJSONDefault

func (r ListV1ConfigsResponse) GetJSONDefault() *V1Error

GetJSONDefault returns the response for an HTTP default `application/json` response

func (ListV1ConfigsResponse) Status

func (r ListV1ConfigsResponse) Status() string

Status returns HTTPResponse.Status

func (ListV1ConfigsResponse) StatusCode

func (r ListV1ConfigsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

type V1Config

type V1Config = stunnerv2.StunnerConfig

V1Config Config provides a STUNner config. Schema is defined in https://github.com/l7mp/stunner/tree/main/pkg/apis/v2

type V1ConfigList

type V1ConfigList struct {
	// Items Items is the list of Config objects in the list.
	Items []V1Config `json:"items"`

	// Version version defines the versioned schema of this object.
	Version string `json:"version"`
}

V1ConfigList ConfigList is a list of Configs.

type V1Error

type V1Error struct {
	// Code Error code.
	Code int32 `json:"code"`

	// Message Error message.
	Message string `json:"message"`
}

V1Error API error.

type V1LicenseStatus

type V1LicenseStatus = stunnerv2.LicenseStatus

V1LicenseStatus LicenseStatus provides the license status. Schema is defined in https://github.com/l7mp/stunner/tree/main/pkg/apis/v2

Jump to

Keyboard shortcuts

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