openapi

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

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

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

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

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

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

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

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

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

Index

Constants

View Source
const (
	Oauth2AuthenticationScopes = "oauth2Authentication.Scopes"
)

Variables

This section is empty.

Functions

func GetSwagger

func GetSwagger() (swagger *openapi3.T, err error)

GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.

func Handler

func Handler(si ServerInterface) http.Handler

Handler creates http.Handler with routing matching OpenAPI spec.

func HandlerFromMux

func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler

HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.

func HandlerFromMuxWithBaseURL

func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler

func HandlerWithOptions

func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler

HandlerWithOptions creates http.Handler with additional options

func NewGetApiV1OrganizationsOrganizationIDProjectsProjectIDApplicationsRequest

func NewGetApiV1OrganizationsOrganizationIDProjectsProjectIDApplicationsRequest(server string, organizationID OrganizationIDParameter, projectID ProjectIDParameter) (*http.Request, error)

NewGetApiV1OrganizationsOrganizationIDProjectsProjectIDApplicationsRequest generates requests for GetApiV1OrganizationsOrganizationIDProjectsProjectIDApplications

func PathToRawSpec

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

Constructs a synthetic filesystem for resolving external references when loading openapi specifications.

Types

type ApplicationDependencies

type ApplicationDependencies = []ApplicationDependency

ApplicationDependencies A set of applications that will be installed before this application.

type ApplicationDependency

type ApplicationDependency struct {
	// Name The application name.
	Name string `json:"name"`
}

ApplicationDependency An application dependency.

type ApplicationRead

type ApplicationRead struct {
	// Metadata Resource metadata valid for all reads.
	Metadata externalRef0.ResourceReadMetadata `json:"metadata"`

	// Spec An application.
	Spec ApplicationSpec `json:"spec"`
}

ApplicationRead defines model for applicationRead.

type ApplicationRecommends

type ApplicationRecommends = []ApplicationDependency

ApplicationRecommends A set of recommended application that may be installed after this application.

type ApplicationSpec

type ApplicationSpec struct {
	// Documentation Documentation link for the application.
	Documentation string `json:"documentation"`

	// HumanReadableName Human readable application name.
	HumanReadableName string `json:"humanReadableName"`

	// Icon A base64 encoded SVG icon.  This should work in both light and dark themes.
	Icon []byte `json:"icon"`

	// License The license under which the application is released.
	License string `json:"license"`

	// Versions A set of application versions.
	Versions ApplicationVersions `json:"versions"`
}

ApplicationSpec An application.

type ApplicationVersion

type ApplicationVersion struct {
	// Dependencies A set of applications that will be installed before this application.
	Dependencies *ApplicationDependencies `json:"dependencies,omitempty"`

	// Recommends A set of recommended application that may be installed after this application.
	Recommends *ApplicationRecommends `json:"recommends,omitempty"`

	// Version The application's Helm chart version.
	Version string `json:"version"`
}

ApplicationVersion An application version.

type ApplicationVersions

type ApplicationVersions = []ApplicationVersion

ApplicationVersions A set of application versions.

type Applications

type Applications = []ApplicationRead

Applications A list of appications.

type ApplicationsResponse

type ApplicationsResponse = Applications

ApplicationsResponse A list of appications.

type ChiServerOptions

type ChiServerOptions struct {
	BaseURL          string
	BaseRouter       chi.Router
	Middlewares      []MiddlewareFunc
	ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

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) GetApiV1OrganizationsOrganizationIDProjectsProjectIDApplications

func (c *Client) GetApiV1OrganizationsOrganizationIDProjectsProjectIDApplications(ctx context.Context, organizationID OrganizationIDParameter, projectID ProjectIDParameter, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// GetApiV1OrganizationsOrganizationIDProjectsProjectIDApplications request
	GetApiV1OrganizationsOrganizationIDProjectsProjectIDApplications(ctx context.Context, organizationID OrganizationIDParameter, projectID ProjectIDParameter, 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) GetApiV1OrganizationsOrganizationIDProjectsProjectIDApplicationsWithResponse

func (c *ClientWithResponses) GetApiV1OrganizationsOrganizationIDProjectsProjectIDApplicationsWithResponse(ctx context.Context, organizationID OrganizationIDParameter, projectID ProjectIDParameter, reqEditors ...RequestEditorFn) (*GetApiV1OrganizationsOrganizationIDProjectsProjectIDApplicationsResponse, error)

GetApiV1OrganizationsOrganizationIDProjectsProjectIDApplicationsWithResponse request returning *GetApiV1OrganizationsOrganizationIDProjectsProjectIDApplicationsResponse

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// GetApiV1OrganizationsOrganizationIDProjectsProjectIDApplicationsWithResponse request
	GetApiV1OrganizationsOrganizationIDProjectsProjectIDApplicationsWithResponse(ctx context.Context, organizationID OrganizationIDParameter, projectID ProjectIDParameter, reqEditors ...RequestEditorFn) (*GetApiV1OrganizationsOrganizationIDProjectsProjectIDApplicationsResponse, error)
}

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

type GetApiV1OrganizationsOrganizationIDProjectsProjectIDApplicationsResponse

type GetApiV1OrganizationsOrganizationIDProjectsProjectIDApplicationsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *ApplicationsResponse
	JSON400      *externalRef0.BadRequestResponse
	JSON401      *externalRef0.UnauthorizedResponse
	JSON500      *externalRef0.InternalServerErrorResponse
}

func ParseGetApiV1OrganizationsOrganizationIDProjectsProjectIDApplicationsResponse

func ParseGetApiV1OrganizationsOrganizationIDProjectsProjectIDApplicationsResponse(rsp *http.Response) (*GetApiV1OrganizationsOrganizationIDProjectsProjectIDApplicationsResponse, error)

ParseGetApiV1OrganizationsOrganizationIDProjectsProjectIDApplicationsResponse parses an HTTP response from a GetApiV1OrganizationsOrganizationIDProjectsProjectIDApplicationsWithResponse call

func (GetApiV1OrganizationsOrganizationIDProjectsProjectIDApplicationsResponse) Status

Status returns HTTPResponse.Status

func (GetApiV1OrganizationsOrganizationIDProjectsProjectIDApplicationsResponse) StatusCode

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 InvalidParamFormatError

type InvalidParamFormatError struct {
	ParamName string
	Err       error
}

func (*InvalidParamFormatError) Error

func (e *InvalidParamFormatError) Error() string

func (*InvalidParamFormatError) Unwrap

func (e *InvalidParamFormatError) Unwrap() error

type KubernetesNameParameter

type KubernetesNameParameter = string

KubernetesNameParameter A Kubernetes name. Must be a valid DNS containing only lower case characters, numbers or hyphens, start and end with a character or number, and be at most 63 characters in length.

type MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

type OrganizationIDParameter

type OrganizationIDParameter = KubernetesNameParameter

OrganizationIDParameter A Kubernetes name. Must be a valid DNS containing only lower case characters, numbers or hyphens, start and end with a character or number, and be at most 63 characters in length.

type ProjectIDParameter

type ProjectIDParameter = KubernetesNameParameter

ProjectIDParameter A Kubernetes name. Must be a valid DNS containing only lower case characters, numbers or hyphens, start and end with a character or number, and be at most 63 characters in length.

type RequestEditorFn

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

RequestEditorFn is the function signature for the RequestEditor callback function

type RequiredHeaderError

type RequiredHeaderError struct {
	ParamName string
	Err       error
}

func (*RequiredHeaderError) Error

func (e *RequiredHeaderError) Error() string

func (*RequiredHeaderError) Unwrap

func (e *RequiredHeaderError) Unwrap() error

type RequiredParamError

type RequiredParamError struct {
	ParamName string
}

func (*RequiredParamError) Error

func (e *RequiredParamError) Error() string

type ServerInterface

type ServerInterface interface {

	// (GET /api/v1/organizations/{organizationID}/projects/{projectID}/applications)
	GetApiV1OrganizationsOrganizationIDProjectsProjectIDApplications(w http.ResponseWriter, r *http.Request, organizationID OrganizationIDParameter, projectID ProjectIDParameter)
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
	ErrorHandlerFunc   func(w http.ResponseWriter, r *http.Request, err error)
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) GetApiV1OrganizationsOrganizationIDProjectsProjectIDApplications

func (siw *ServerInterfaceWrapper) GetApiV1OrganizationsOrganizationIDProjectsProjectIDApplications(w http.ResponseWriter, r *http.Request)

GetApiV1OrganizationsOrganizationIDProjectsProjectIDApplications operation middleware

type TooManyValuesForParamError

type TooManyValuesForParamError struct {
	ParamName string
	Count     int
}

func (*TooManyValuesForParamError) Error

type UnescapedCookieParamError

type UnescapedCookieParamError struct {
	ParamName string
	Err       error
}

func (*UnescapedCookieParamError) Error

func (e *UnescapedCookieParamError) Error() string

func (*UnescapedCookieParamError) Unwrap

func (e *UnescapedCookieParamError) Unwrap() error

type Unimplemented

type Unimplemented struct{}

func (Unimplemented) GetApiV1OrganizationsOrganizationIDProjectsProjectIDApplications

func (_ Unimplemented) GetApiV1OrganizationsOrganizationIDProjectsProjectIDApplications(w http.ResponseWriter, r *http.Request, organizationID OrganizationIDParameter, projectID ProjectIDParameter)

(GET /api/v1/organizations/{organizationID}/projects/{projectID}/applications)

type UnmarshalingParamError

type UnmarshalingParamError struct {
	ParamName string
	Err       error
}

func (*UnmarshalingParamError) Error

func (e *UnmarshalingParamError) Error() string

func (*UnmarshalingParamError) Unwrap

func (e *UnmarshalingParamError) Unwrap() error

Jump to

Keyboard shortcuts

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