api

package
v0.7.57 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: GPL-3.0 Imports: 21 Imported by: 0

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.4.1 DO NOT EDIT.

Index

Constants

View Source
const (
	ApiKeyAuthScopes = "ApiKeyAuth.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, m ServeMux) http.Handler

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

func HandlerFromMuxWithBaseURL

func HandlerFromMuxWithBaseURL(si ServerInterface, m ServeMux, baseURL string) http.Handler

func HandlerWithOptions

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

HandlerWithOptions creates http.Handler with additional options

func NewGetApiSchemaJsonSchemaIdentifierChannelChannelRequest

func NewGetApiSchemaJsonSchemaIdentifierChannelChannelRequest(server string, identifier string, channel string) (*http.Request, error)

NewGetApiSchemaJsonSchemaIdentifierChannelChannelRequest generates requests for GetApiSchemaJsonSchemaIdentifierChannelChannel

func NewGetApiSchemaJsonSchemaIdentifierLatestRequest

func NewGetApiSchemaJsonSchemaIdentifierLatestRequest(server string, identifier string) (*http.Request, error)

NewGetApiSchemaJsonSchemaIdentifierLatestRequest generates requests for GetApiSchemaJsonSchemaIdentifierLatest

func NewGetApiSchemaJsonSchemaIdentifierLatestVersionRequest added in v0.4.0

func NewGetApiSchemaJsonSchemaIdentifierLatestVersionRequest(server string, identifier string) (*http.Request, error)

NewGetApiSchemaJsonSchemaIdentifierLatestVersionRequest generates requests for GetApiSchemaJsonSchemaIdentifierLatestVersion

func NewGetApiSchemaJsonSchemaIdentifierRequest

func NewGetApiSchemaJsonSchemaIdentifierRequest(server string, identifier string) (*http.Request, error)

NewGetApiSchemaJsonSchemaIdentifierRequest generates requests for GetApiSchemaJsonSchemaIdentifier

func NewGetApiSchemaJsonSchemaIdentifierVersionVersionRequest

func NewGetApiSchemaJsonSchemaIdentifierVersionVersionRequest(server string, identifier string, version string) (*http.Request, error)

NewGetApiSchemaJsonSchemaIdentifierVersionVersionRequest generates requests for GetApiSchemaJsonSchemaIdentifierVersionVersion

func NewGetApiSpecYmlRequest added in v0.2.0

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

NewGetApiSpecYmlRequest generates requests for GetApiSpecYml

func NewGetUiConfigRequest added in v0.2.0

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

NewGetUiConfigRequest generates requests for GetUiConfig

func NewListJSONSchemasRequest

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

NewListJSONSchemasRequest generates requests for ListJSONSchemas

func NewPostApiSchemaJsonSchemaIdentifierVersionVersionRequest

func NewPostApiSchemaJsonSchemaIdentifierVersionVersionRequest(server string, identifier string, version string, body PostApiSchemaJsonSchemaIdentifierVersionVersionJSONRequestBody) (*http.Request, error)

NewPostApiSchemaJsonSchemaIdentifierVersionVersionRequest calls the generic PostApiSchemaJsonSchemaIdentifierVersionVersion builder with application/json body

func NewPostApiSchemaJsonSchemaIdentifierVersionVersionRequestWithBody

func NewPostApiSchemaJsonSchemaIdentifierVersionVersionRequestWithBody(server string, identifier string, version string, contentType string, body io.Reader) (*http.Request, error)

NewPostApiSchemaJsonSchemaIdentifierVersionVersionRequestWithBody generates requests for PostApiSchemaJsonSchemaIdentifierVersionVersion with any type of body

func NewServeMux

func NewServeMux(ctx *SchemaNestApiContext) (*http.ServeMux, error)

func PathToRawSpec

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

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

func SendError added in v0.1.0

func SendError(w http.ResponseWriter, status int, error string)

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

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

func (*Client) GetApiSchemaJsonSchemaIdentifierChannelChannel

func (c *Client) GetApiSchemaJsonSchemaIdentifierChannelChannel(ctx context.Context, identifier string, channel string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetApiSchemaJsonSchemaIdentifierLatest

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

func (*Client) GetApiSchemaJsonSchemaIdentifierLatestVersion added in v0.4.0

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

func (*Client) GetApiSchemaJsonSchemaIdentifierVersionVersion

func (c *Client) GetApiSchemaJsonSchemaIdentifierVersionVersion(ctx context.Context, identifier string, version string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetApiSpecYml added in v0.2.0

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

func (*Client) GetUiConfig added in v0.2.0

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

func (*Client) ListJSONSchemas

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

func (*Client) PostApiSchemaJsonSchemaIdentifierVersionVersion

func (c *Client) PostApiSchemaJsonSchemaIdentifierVersionVersion(ctx context.Context, identifier string, version string, body PostApiSchemaJsonSchemaIdentifierVersionVersionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PostApiSchemaJsonSchemaIdentifierVersionVersionWithBody

func (c *Client) PostApiSchemaJsonSchemaIdentifierVersionVersionWithBody(ctx context.Context, identifier string, version string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// GetApiSpecYml request
	GetApiSpecYml(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListJSONSchemas request
	ListJSONSchemas(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetApiSchemaJsonSchemaIdentifier request
	GetApiSchemaJsonSchemaIdentifier(ctx context.Context, identifier string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetApiSchemaJsonSchemaIdentifierChannelChannel request
	GetApiSchemaJsonSchemaIdentifierChannelChannel(ctx context.Context, identifier string, channel string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetApiSchemaJsonSchemaIdentifierLatest request
	GetApiSchemaJsonSchemaIdentifierLatest(ctx context.Context, identifier string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetApiSchemaJsonSchemaIdentifierLatestVersion request
	GetApiSchemaJsonSchemaIdentifierLatestVersion(ctx context.Context, identifier string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetApiSchemaJsonSchemaIdentifierVersionVersion request
	GetApiSchemaJsonSchemaIdentifierVersionVersion(ctx context.Context, identifier string, version string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PostApiSchemaJsonSchemaIdentifierVersionVersionWithBody request with any body
	PostApiSchemaJsonSchemaIdentifierVersionVersionWithBody(ctx context.Context, identifier string, version string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	PostApiSchemaJsonSchemaIdentifierVersionVersion(ctx context.Context, identifier string, version string, body PostApiSchemaJsonSchemaIdentifierVersionVersionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetUiConfig request
	GetUiConfig(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) GetApiSchemaJsonSchemaIdentifierChannelChannelWithResponse

func (c *ClientWithResponses) GetApiSchemaJsonSchemaIdentifierChannelChannelWithResponse(ctx context.Context, identifier string, channel string, reqEditors ...RequestEditorFn) (*GetApiSchemaJsonSchemaIdentifierChannelChannelResponse, error)

GetApiSchemaJsonSchemaIdentifierChannelChannelWithResponse request returning *GetApiSchemaJsonSchemaIdentifierChannelChannelResponse

func (*ClientWithResponses) GetApiSchemaJsonSchemaIdentifierLatestVersionWithResponse added in v0.4.0

func (c *ClientWithResponses) GetApiSchemaJsonSchemaIdentifierLatestVersionWithResponse(ctx context.Context, identifier string, reqEditors ...RequestEditorFn) (*GetApiSchemaJsonSchemaIdentifierLatestVersionResponse, error)

GetApiSchemaJsonSchemaIdentifierLatestVersionWithResponse request returning *GetApiSchemaJsonSchemaIdentifierLatestVersionResponse

func (*ClientWithResponses) GetApiSchemaJsonSchemaIdentifierLatestWithResponse

func (c *ClientWithResponses) GetApiSchemaJsonSchemaIdentifierLatestWithResponse(ctx context.Context, identifier string, reqEditors ...RequestEditorFn) (*GetApiSchemaJsonSchemaIdentifierLatestResponse, error)

GetApiSchemaJsonSchemaIdentifierLatestWithResponse request returning *GetApiSchemaJsonSchemaIdentifierLatestResponse

func (*ClientWithResponses) GetApiSchemaJsonSchemaIdentifierVersionVersionWithResponse

func (c *ClientWithResponses) GetApiSchemaJsonSchemaIdentifierVersionVersionWithResponse(ctx context.Context, identifier string, version string, reqEditors ...RequestEditorFn) (*GetApiSchemaJsonSchemaIdentifierVersionVersionResponse, error)

GetApiSchemaJsonSchemaIdentifierVersionVersionWithResponse request returning *GetApiSchemaJsonSchemaIdentifierVersionVersionResponse

func (*ClientWithResponses) GetApiSchemaJsonSchemaIdentifierWithResponse

func (c *ClientWithResponses) GetApiSchemaJsonSchemaIdentifierWithResponse(ctx context.Context, identifier string, reqEditors ...RequestEditorFn) (*GetApiSchemaJsonSchemaIdentifierResponse, error)

GetApiSchemaJsonSchemaIdentifierWithResponse request returning *GetApiSchemaJsonSchemaIdentifierResponse

func (*ClientWithResponses) GetApiSpecYmlWithResponse added in v0.2.0

func (c *ClientWithResponses) GetApiSpecYmlWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetApiSpecYmlResponse, error)

GetApiSpecYmlWithResponse request returning *GetApiSpecYmlResponse

func (*ClientWithResponses) GetUiConfigWithResponse added in v0.2.0

func (c *ClientWithResponses) GetUiConfigWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetUiConfigResponse, error)

GetUiConfigWithResponse request returning *GetUiConfigResponse

func (*ClientWithResponses) ListJSONSchemasWithResponse

func (c *ClientWithResponses) ListJSONSchemasWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListJSONSchemasResponse, error)

ListJSONSchemasWithResponse request returning *ListJSONSchemasResponse

func (*ClientWithResponses) PostApiSchemaJsonSchemaIdentifierVersionVersionWithBodyWithResponse

func (c *ClientWithResponses) PostApiSchemaJsonSchemaIdentifierVersionVersionWithBodyWithResponse(ctx context.Context, identifier string, version string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostApiSchemaJsonSchemaIdentifierVersionVersionResponse, error)

PostApiSchemaJsonSchemaIdentifierVersionVersionWithBodyWithResponse request with arbitrary body returning *PostApiSchemaJsonSchemaIdentifierVersionVersionResponse

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// GetApiSpecYmlWithResponse request
	GetApiSpecYmlWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetApiSpecYmlResponse, error)

	// ListJSONSchemasWithResponse request
	ListJSONSchemasWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListJSONSchemasResponse, error)

	// GetApiSchemaJsonSchemaIdentifierWithResponse request
	GetApiSchemaJsonSchemaIdentifierWithResponse(ctx context.Context, identifier string, reqEditors ...RequestEditorFn) (*GetApiSchemaJsonSchemaIdentifierResponse, error)

	// GetApiSchemaJsonSchemaIdentifierChannelChannelWithResponse request
	GetApiSchemaJsonSchemaIdentifierChannelChannelWithResponse(ctx context.Context, identifier string, channel string, reqEditors ...RequestEditorFn) (*GetApiSchemaJsonSchemaIdentifierChannelChannelResponse, error)

	// GetApiSchemaJsonSchemaIdentifierLatestWithResponse request
	GetApiSchemaJsonSchemaIdentifierLatestWithResponse(ctx context.Context, identifier string, reqEditors ...RequestEditorFn) (*GetApiSchemaJsonSchemaIdentifierLatestResponse, error)

	// GetApiSchemaJsonSchemaIdentifierLatestVersionWithResponse request
	GetApiSchemaJsonSchemaIdentifierLatestVersionWithResponse(ctx context.Context, identifier string, reqEditors ...RequestEditorFn) (*GetApiSchemaJsonSchemaIdentifierLatestVersionResponse, error)

	// GetApiSchemaJsonSchemaIdentifierVersionVersionWithResponse request
	GetApiSchemaJsonSchemaIdentifierVersionVersionWithResponse(ctx context.Context, identifier string, version string, reqEditors ...RequestEditorFn) (*GetApiSchemaJsonSchemaIdentifierVersionVersionResponse, error)

	// PostApiSchemaJsonSchemaIdentifierVersionVersionWithBodyWithResponse request with any body
	PostApiSchemaJsonSchemaIdentifierVersionVersionWithBodyWithResponse(ctx context.Context, identifier string, version string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostApiSchemaJsonSchemaIdentifierVersionVersionResponse, error)

	PostApiSchemaJsonSchemaIdentifierVersionVersionWithResponse(ctx context.Context, identifier string, version string, body PostApiSchemaJsonSchemaIdentifierVersionVersionJSONRequestBody, reqEditors ...RequestEditorFn) (*PostApiSchemaJsonSchemaIdentifierVersionVersionResponse, error)

	// GetUiConfigWithResponse request
	GetUiConfigWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetUiConfigResponse, error)
}

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

type Error

type Error struct {
	// Error Error message
	Error string `json:"error"`
}

Error defines model for Error.

type GetApiSchemaJsonSchemaIdentifierChannelChannelResponse

type GetApiSchemaJsonSchemaIdentifierChannelChannelResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *map[string]interface{}
}

func ParseGetApiSchemaJsonSchemaIdentifierChannelChannelResponse

func ParseGetApiSchemaJsonSchemaIdentifierChannelChannelResponse(rsp *http.Response) (*GetApiSchemaJsonSchemaIdentifierChannelChannelResponse, error)

ParseGetApiSchemaJsonSchemaIdentifierChannelChannelResponse parses an HTTP response from a GetApiSchemaJsonSchemaIdentifierChannelChannelWithResponse call

func (GetApiSchemaJsonSchemaIdentifierChannelChannelResponse) Status

Status returns HTTPResponse.Status

func (GetApiSchemaJsonSchemaIdentifierChannelChannelResponse) StatusCode

StatusCode returns HTTPResponse.StatusCode

type GetApiSchemaJsonSchemaIdentifierLatestResponse

type GetApiSchemaJsonSchemaIdentifierLatestResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *map[string]interface{}
}

func ParseGetApiSchemaJsonSchemaIdentifierLatestResponse

func ParseGetApiSchemaJsonSchemaIdentifierLatestResponse(rsp *http.Response) (*GetApiSchemaJsonSchemaIdentifierLatestResponse, error)

ParseGetApiSchemaJsonSchemaIdentifierLatestResponse parses an HTTP response from a GetApiSchemaJsonSchemaIdentifierLatestWithResponse call

func (GetApiSchemaJsonSchemaIdentifierLatestResponse) Status

Status returns HTTPResponse.Status

func (GetApiSchemaJsonSchemaIdentifierLatestResponse) StatusCode

StatusCode returns HTTPResponse.StatusCode

type GetApiSchemaJsonSchemaIdentifierLatestVersionResponse added in v0.4.0

type GetApiSchemaJsonSchemaIdentifierLatestVersionResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *VersionParts
}

func ParseGetApiSchemaJsonSchemaIdentifierLatestVersionResponse added in v0.4.0

func ParseGetApiSchemaJsonSchemaIdentifierLatestVersionResponse(rsp *http.Response) (*GetApiSchemaJsonSchemaIdentifierLatestVersionResponse, error)

ParseGetApiSchemaJsonSchemaIdentifierLatestVersionResponse parses an HTTP response from a GetApiSchemaJsonSchemaIdentifierLatestVersionWithResponse call

func (GetApiSchemaJsonSchemaIdentifierLatestVersionResponse) Status added in v0.4.0

Status returns HTTPResponse.Status

func (GetApiSchemaJsonSchemaIdentifierLatestVersionResponse) StatusCode added in v0.4.0

StatusCode returns HTTPResponse.StatusCode

type GetApiSchemaJsonSchemaIdentifierResponse

type GetApiSchemaJsonSchemaIdentifierResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *JsonSchemaList
}

func ParseGetApiSchemaJsonSchemaIdentifierResponse

func ParseGetApiSchemaJsonSchemaIdentifierResponse(rsp *http.Response) (*GetApiSchemaJsonSchemaIdentifierResponse, error)

ParseGetApiSchemaJsonSchemaIdentifierResponse parses an HTTP response from a GetApiSchemaJsonSchemaIdentifierWithResponse call

func (GetApiSchemaJsonSchemaIdentifierResponse) Status

Status returns HTTPResponse.Status

func (GetApiSchemaJsonSchemaIdentifierResponse) StatusCode

StatusCode returns HTTPResponse.StatusCode

type GetApiSchemaJsonSchemaIdentifierVersionVersionResponse

type GetApiSchemaJsonSchemaIdentifierVersionVersionResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *map[string]interface{}
}

func ParseGetApiSchemaJsonSchemaIdentifierVersionVersionResponse

func ParseGetApiSchemaJsonSchemaIdentifierVersionVersionResponse(rsp *http.Response) (*GetApiSchemaJsonSchemaIdentifierVersionVersionResponse, error)

ParseGetApiSchemaJsonSchemaIdentifierVersionVersionResponse parses an HTTP response from a GetApiSchemaJsonSchemaIdentifierVersionVersionWithResponse call

func (GetApiSchemaJsonSchemaIdentifierVersionVersionResponse) Status

Status returns HTTPResponse.Status

func (GetApiSchemaJsonSchemaIdentifierVersionVersionResponse) StatusCode

StatusCode returns HTTPResponse.StatusCode

type GetApiSpecYmlResponse added in v0.2.0

type GetApiSpecYmlResponse struct {
	Body         []byte
	HTTPResponse *http.Response
}

func ParseGetApiSpecYmlResponse added in v0.2.0

func ParseGetApiSpecYmlResponse(rsp *http.Response) (*GetApiSpecYmlResponse, error)

ParseGetApiSpecYmlResponse parses an HTTP response from a GetApiSpecYmlWithResponse call

func (GetApiSpecYmlResponse) Status added in v0.2.0

func (r GetApiSpecYmlResponse) Status() string

Status returns HTTPResponse.Status

func (GetApiSpecYmlResponse) StatusCode added in v0.2.0

func (r GetApiSpecYmlResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetUiConfigResponse added in v0.2.0

type GetUiConfigResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *UIConfig
}

func ParseGetUiConfigResponse added in v0.2.0

func ParseGetUiConfigResponse(rsp *http.Response) (*GetUiConfigResponse, error)

ParseGetUiConfigResponse parses an HTTP response from a GetUiConfigWithResponse call

func (GetUiConfigResponse) Status added in v0.2.0

func (r GetUiConfigResponse) Status() string

Status returns HTTPResponse.Status

func (GetUiConfigResponse) StatusCode added in v0.2.0

func (r GetUiConfigResponse) 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 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 JsonSchemaDetails added in v0.1.0

type JsonSchemaDetails struct {
	// Description Description for the
	Description *string            `json:"description,omitempty"`
	Versions    JsonSchemaVersions `json:"versions"`
}

JsonSchemaDetails defines model for JsonSchemaDetails.

type JsonSchemaInfo

type JsonSchemaInfo struct {
	// Description Description for the schema as set by the latest version
	Description string `json:"description"`

	// Identifier Identifier for the schema
	Identifier string `json:"identifier"`

	// LatestVersion Version seperated into its parts
	LatestVersion VersionParts `json:"latestVersion"`
}

JsonSchemaInfo defines model for JsonSchemaInfo.

type JsonSchemaList

type JsonSchemaList = []JsonSchemaInfo

JsonSchemaList defines model for JsonSchemaList.

type JsonSchemaVersion

type JsonSchemaVersion struct {
	Version string `json:"version"`
}

JsonSchemaVersion defines model for JsonSchemaVersion.

type JsonSchemaVersions

type JsonSchemaVersions = []JsonSchemaVersion

JsonSchemaVersions defines model for JsonSchemaVersions.

type ListJSONSchemasResponse

type ListJSONSchemasResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *JsonSchemaDetails
}

func ParseListJSONSchemasResponse

func ParseListJSONSchemasResponse(rsp *http.Response) (*ListJSONSchemasResponse, error)

ParseListJSONSchemasResponse parses an HTTP response from a ListJSONSchemasWithResponse call

func (ListJSONSchemasResponse) Status

func (r ListJSONSchemasResponse) Status() string

Status returns HTTPResponse.Status

func (ListJSONSchemasResponse) StatusCode

func (r ListJSONSchemasResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

type PostApiSchemaJsonSchemaIdentifierVersionVersionJSONBody

type PostApiSchemaJsonSchemaIdentifierVersionVersionJSONBody = map[string]interface{}

PostApiSchemaJsonSchemaIdentifierVersionVersionJSONBody defines parameters for PostApiSchemaJsonSchemaIdentifierVersionVersion.

type PostApiSchemaJsonSchemaIdentifierVersionVersionJSONRequestBody

type PostApiSchemaJsonSchemaIdentifierVersionVersionJSONRequestBody = PostApiSchemaJsonSchemaIdentifierVersionVersionJSONBody

PostApiSchemaJsonSchemaIdentifierVersionVersionJSONRequestBody defines body for PostApiSchemaJsonSchemaIdentifierVersionVersion for application/json ContentType.

type PostApiSchemaJsonSchemaIdentifierVersionVersionResponse

type PostApiSchemaJsonSchemaIdentifierVersionVersionResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON409      *Error
}

func ParsePostApiSchemaJsonSchemaIdentifierVersionVersionResponse

func ParsePostApiSchemaJsonSchemaIdentifierVersionVersionResponse(rsp *http.Response) (*PostApiSchemaJsonSchemaIdentifierVersionVersionResponse, error)

ParsePostApiSchemaJsonSchemaIdentifierVersionVersionResponse parses an HTTP response from a PostApiSchemaJsonSchemaIdentifierVersionVersionWithResponse call

func (PostApiSchemaJsonSchemaIdentifierVersionVersionResponse) Status

Status returns HTTPResponse.Status

func (PostApiSchemaJsonSchemaIdentifierVersionVersionResponse) StatusCode

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 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 SchemaNestApi

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

func NewSchemaNestApi

func NewSchemaNestApi(ctx *SchemaNestApiContext) *SchemaNestApi

func (*SchemaNestApi) GetApiSchemaJsonSchemaIdentifier

func (s *SchemaNestApi) GetApiSchemaJsonSchemaIdentifier(w http.ResponseWriter, r *http.Request, identifier string)

func (*SchemaNestApi) GetApiSchemaJsonSchemaIdentifierChannelChannel

func (s *SchemaNestApi) GetApiSchemaJsonSchemaIdentifierChannelChannel(w http.ResponseWriter, r *http.Request, identifier string, channelIdentifier string)

func (*SchemaNestApi) GetApiSchemaJsonSchemaIdentifierLatest

func (s *SchemaNestApi) GetApiSchemaJsonSchemaIdentifierLatest(w http.ResponseWriter, r *http.Request, identifier string)

func (*SchemaNestApi) GetApiSchemaJsonSchemaIdentifierLatestVersion added in v0.4.0

func (s *SchemaNestApi) GetApiSchemaJsonSchemaIdentifierLatestVersion(w http.ResponseWriter, r *http.Request, identifier string)

func (*SchemaNestApi) GetApiSchemaJsonSchemaIdentifierVersionVersion

func (s *SchemaNestApi) GetApiSchemaJsonSchemaIdentifierVersionVersion(w http.ResponseWriter, r *http.Request, identifier string, version string)

func (*SchemaNestApi) GetApiSpecYml added in v0.2.0

func (s *SchemaNestApi) GetApiSpecYml(w http.ResponseWriter, r *http.Request)

func (*SchemaNestApi) GetUiConfig added in v0.2.0

func (s *SchemaNestApi) GetUiConfig(w http.ResponseWriter, r *http.Request)

func (*SchemaNestApi) ListJSONSchemas

func (s *SchemaNestApi) ListJSONSchemas(w http.ResponseWriter, r *http.Request)

func (*SchemaNestApi) PostApiSchemaJsonSchemaIdentifierVersionVersion

func (s *SchemaNestApi) PostApiSchemaJsonSchemaIdentifierVersionVersion(w http.ResponseWriter, r *http.Request, identifier string, version string)

type SchemaNestApiContext

type SchemaNestApiContext struct {
	JsonSchemaRepository        json_schema.JsonSchemaRepository
	JsonSchemaVersionRepository json_schema.JsonSchemaVersionRepository
	Config                      *config.Config
}

type ServeMux

type ServeMux interface {
	HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
	ServeHTTP(w http.ResponseWriter, r *http.Request)
}

ServeMux is an abstraction of http.ServeMux.

type ServerInterface

type ServerInterface interface {

	// (GET /api-spec.yml)
	GetApiSpecYml(w http.ResponseWriter, r *http.Request)
	// List all available JSON schemas
	// (GET /api/schema/json-schema)
	ListJSONSchemas(w http.ResponseWriter, r *http.Request)
	// Get versions of a json schema
	// (GET /api/schema/json-schema/{identifier})
	GetApiSchemaJsonSchemaIdentifier(w http.ResponseWriter, r *http.Request, identifier string)
	// Get latest version of a JSON schema for a channel
	// (GET /api/schema/json-schema/{identifier}/channel/{channel})
	GetApiSchemaJsonSchemaIdentifierChannelChannel(w http.ResponseWriter, r *http.Request, identifier string, channel string)
	// Get latest version of a JSON schema
	// (GET /api/schema/json-schema/{identifier}/latest)
	GetApiSchemaJsonSchemaIdentifierLatest(w http.ResponseWriter, r *http.Request, identifier string)
	// Get the version of the latest JSON Schema
	// (GET /api/schema/json-schema/{identifier}/latest-version)
	GetApiSchemaJsonSchemaIdentifierLatestVersion(w http.ResponseWriter, r *http.Request, identifier string)
	// Get latest version of a JSON schema
	// (GET /api/schema/json-schema/{identifier}/version/{version})
	GetApiSchemaJsonSchemaIdentifierVersionVersion(w http.ResponseWriter, r *http.Request, identifier string, version string)
	// Create a new json schema for a version
	// (POST /api/schema/json-schema/{identifier}/version/{version})
	PostApiSchemaJsonSchemaIdentifierVersionVersion(w http.ResponseWriter, r *http.Request, identifier string, version string)
	// Get the UI configuration
	// (GET /ui-config)
	GetUiConfig(w http.ResponseWriter, r *http.Request)
}

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

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

GetApiSchemaJsonSchemaIdentifier operation middleware

func (*ServerInterfaceWrapper) GetApiSchemaJsonSchemaIdentifierChannelChannel

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

GetApiSchemaJsonSchemaIdentifierChannelChannel operation middleware

func (*ServerInterfaceWrapper) GetApiSchemaJsonSchemaIdentifierLatest

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

GetApiSchemaJsonSchemaIdentifierLatest operation middleware

func (*ServerInterfaceWrapper) GetApiSchemaJsonSchemaIdentifierLatestVersion added in v0.4.0

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

GetApiSchemaJsonSchemaIdentifierLatestVersion operation middleware

func (*ServerInterfaceWrapper) GetApiSchemaJsonSchemaIdentifierVersionVersion

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

GetApiSchemaJsonSchemaIdentifierVersionVersion operation middleware

func (*ServerInterfaceWrapper) GetApiSpecYml added in v0.2.0

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

GetApiSpecYml operation middleware

func (*ServerInterfaceWrapper) GetUiConfig added in v0.2.0

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

GetUiConfig operation middleware

func (*ServerInterfaceWrapper) ListJSONSchemas

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

ListJSONSchemas operation middleware

func (*ServerInterfaceWrapper) PostApiSchemaJsonSchemaIdentifierVersionVersion

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

PostApiSchemaJsonSchemaIdentifierVersionVersion operation middleware

type StdHTTPServerOptions

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

type TooManyValuesForParamError

type TooManyValuesForParamError struct {
	ParamName string
	Count     int
}

func (*TooManyValuesForParamError) Error

type UIConfig added in v0.2.0

type UIConfig struct {
	// ApiKeyAuthEnabled Whether API Key authentication has been enabled
	ApiKeyAuthEnabled bool `json:"apiKeyAuthEnabled"`
}

UIConfig defines model for UIConfig.

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 UnmarshalingParamError

type UnmarshalingParamError struct {
	ParamName string
	Err       error
}

func (*UnmarshalingParamError) Error

func (e *UnmarshalingParamError) Error() string

func (*UnmarshalingParamError) Unwrap

func (e *UnmarshalingParamError) Unwrap() error

type VersionParts added in v0.1.0

type VersionParts struct {
	// Major Semantic major version
	Major int `json:"major"`

	// Minor Semantic minor version
	Minor int `json:"minor"`

	// Patch Semantic patch version
	Patch int `json:"patch"`
}

VersionParts Version seperated into its parts

Jump to

Keyboard shortcuts

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