openapi

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: Apache-2.0 Imports: 12 Imported by: 29

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.

Index

Constants

This section is empty.

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 PathToRawSpec

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

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

Types

type BadRequestResponse

type BadRequestResponse = Error

BadRequestResponse Generic error message, compatible with oauth2.

type ConflictResponse

type ConflictResponse = Error

ConflictResponse Generic error message, compatible with oauth2.

type Error

type Error struct {
	// Error A terse error string expanding on the HTTP error code. Errors are based on the OAuth 2.02 specification, but are expanded with proprietary status codes for APIs other than those specified by OAuth 2.02.
	Error ErrorError `json:"error"`

	// ErrorDescription Verbose message describing the error.
	ErrorDescription string `json:"error_description"`
}

Error Generic error message, compatible with oauth2.

type ErrorError

type ErrorError string

ErrorError A terse error string expanding on the HTTP error code. Errors are based on the OAuth 2.02 specification, but are expanded with proprietary status codes for APIs other than those specified by OAuth 2.02.

const (
	AccessDenied          ErrorError = "access_denied"
	Conflict              ErrorError = "conflict"
	Forbidden             ErrorError = "forbidden"
	InvalidRequest        ErrorError = "invalid_request"
	MethodNotAllowed      ErrorError = "method_not_allowed"
	NotFound              ErrorError = "not_found"
	RequestEntityTooLarge ErrorError = "request_entity_too_large"
	ServerError           ErrorError = "server_error"
	UnsupportedMediaType  ErrorError = "unsupported_media_type"
)

Defines values for ErrorError.

type ForbiddenResponse

type ForbiddenResponse = Error

ForbiddenResponse Generic error message, compatible with oauth2.

type InternalServerErrorResponse

type InternalServerErrorResponse = Error

InternalServerErrorResponse Generic error message, compatible with oauth2.

type KubernetesLabelValue

type KubernetesLabelValue = string

KubernetesLabelValue A valid Kubernetes label value, typically used for resource names that can be indexed in the database.

type NotFoundResponse

type NotFoundResponse = Error

NotFoundResponse Generic error message, compatible with oauth2.

type OrganizationScopedResourceReadMetadata

type OrganizationScopedResourceReadMetadata struct {
	// CreatedBy The user who created the resource.
	CreatedBy *string `json:"createdBy,omitempty"`

	// CreationTime The time the resource was created.
	CreationTime time.Time `json:"creationTime"`

	// DeletionTime The time the resource was deleted.
	DeletionTime *time.Time `json:"deletionTime,omitempty"`

	// Description The resource description, this optionally augments the name with more context.
	Description *string `json:"description,omitempty"`

	// HealthStatus The health state of a resource.
	HealthStatus ResourceHealthStatus `json:"healthStatus"`

	// Id The unique resource ID.
	Id string `json:"id"`

	// ModifiedBy The user who updated the resource.
	ModifiedBy *string `json:"modifiedBy,omitempty"`

	// ModifiedTime The time a resource was updated.
	ModifiedTime *time.Time `json:"modifiedTime,omitempty"`

	// Name A valid Kubernetes label value, typically used for resource names that can be
	// indexed in the database.
	Name KubernetesLabelValue `json:"name"`

	// OrganizationId The organization identifier the resource belongs to.
	OrganizationId string `json:"organizationId"`

	// ProvisioningStatus The provisioning state of a resource.
	ProvisioningStatus ResourceProvisioningStatus `json:"provisioningStatus"`

	// Tags A list of tags.
	Tags *TagList `json:"tags,omitempty"`
}

OrganizationScopedResourceReadMetadata defines model for organizationScopedResourceReadMetadata.

type ProjectScopedResourceReadMetadata

type ProjectScopedResourceReadMetadata struct {
	// CreatedBy The user who created the resource.
	CreatedBy *string `json:"createdBy,omitempty"`

	// CreationTime The time the resource was created.
	CreationTime time.Time `json:"creationTime"`

	// DeletionTime The time the resource was deleted.
	DeletionTime *time.Time `json:"deletionTime,omitempty"`

	// Description The resource description, this optionally augments the name with more context.
	Description *string `json:"description,omitempty"`

	// HealthStatus The health state of a resource.
	HealthStatus ResourceHealthStatus `json:"healthStatus"`

	// Id The unique resource ID.
	Id string `json:"id"`

	// ModifiedBy The user who updated the resource.
	ModifiedBy *string `json:"modifiedBy,omitempty"`

	// ModifiedTime The time a resource was updated.
	ModifiedTime *time.Time `json:"modifiedTime,omitempty"`

	// Name A valid Kubernetes label value, typically used for resource names that can be
	// indexed in the database.
	Name KubernetesLabelValue `json:"name"`

	// OrganizationId The organization identifier the resource belongs to.
	OrganizationId string `json:"organizationId"`

	// ProjectId The project identifier the resource belongs to.
	ProjectId string `json:"projectId"`

	// ProvisioningStatus The provisioning state of a resource.
	ProvisioningStatus ResourceProvisioningStatus `json:"provisioningStatus"`

	// Tags A list of tags.
	Tags *TagList `json:"tags,omitempty"`
}

ProjectScopedResourceReadMetadata defines model for projectScopedResourceReadMetadata.

type ResourceHealthStatus added in v1.1.0

type ResourceHealthStatus string

ResourceHealthStatus The health state of a resource.

const (
	ResourceHealthStatusDegraded ResourceHealthStatus = "degraded"
	ResourceHealthStatusError    ResourceHealthStatus = "error"
	ResourceHealthStatusHealthy  ResourceHealthStatus = "healthy"
	ResourceHealthStatusUnknown  ResourceHealthStatus = "unknown"
)

Defines values for ResourceHealthStatus.

type ResourceMetadata

type ResourceMetadata struct {
	// Description The resource description, this optionally augments the name with more context.
	Description *string `json:"description,omitempty"`

	// Name A valid Kubernetes label value, typically used for resource names that can be
	// indexed in the database.
	Name KubernetesLabelValue `json:"name"`

	// Tags A list of tags.
	Tags *TagList `json:"tags,omitempty"`
}

ResourceMetadata Metadata required for all API resource reads and writes.

type ResourceProvisioningStatus

type ResourceProvisioningStatus string

ResourceProvisioningStatus The provisioning state of a resource.

const (
	ResourceProvisioningStatusDeprovisioning ResourceProvisioningStatus = "deprovisioning"
	ResourceProvisioningStatusError          ResourceProvisioningStatus = "error"
	ResourceProvisioningStatusProvisioned    ResourceProvisioningStatus = "provisioned"
	ResourceProvisioningStatusProvisioning   ResourceProvisioningStatus = "provisioning"
	ResourceProvisioningStatusUnknown        ResourceProvisioningStatus = "unknown"
)

Defines values for ResourceProvisioningStatus.

type ResourceReadMetadata

type ResourceReadMetadata struct {
	// CreatedBy The user who created the resource.
	CreatedBy *string `json:"createdBy,omitempty"`

	// CreationTime The time the resource was created.
	CreationTime time.Time `json:"creationTime"`

	// DeletionTime The time the resource was deleted.
	DeletionTime *time.Time `json:"deletionTime,omitempty"`

	// Description The resource description, this optionally augments the name with more context.
	Description *string `json:"description,omitempty"`

	// HealthStatus The health state of a resource.
	HealthStatus ResourceHealthStatus `json:"healthStatus"`

	// Id The unique resource ID.
	Id string `json:"id"`

	// ModifiedBy The user who updated the resource.
	ModifiedBy *string `json:"modifiedBy,omitempty"`

	// ModifiedTime The time a resource was updated.
	ModifiedTime *time.Time `json:"modifiedTime,omitempty"`

	// Name A valid Kubernetes label value, typically used for resource names that can be
	// indexed in the database.
	Name KubernetesLabelValue `json:"name"`

	// ProvisioningStatus The provisioning state of a resource.
	ProvisioningStatus ResourceProvisioningStatus `json:"provisioningStatus"`

	// Tags A list of tags.
	Tags *TagList `json:"tags,omitempty"`
}

ResourceReadMetadata defines model for resourceReadMetadata.

type ResourceWriteMetadata

type ResourceWriteMetadata = ResourceMetadata

ResourceWriteMetadata Metadata required for all API resource reads and writes.

type Schema

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

Schema abstracts schema access and validation.

func NewSchema

func NewSchema(get SchemaGetter) (*Schema, error)

NewOpenRpi extracts the swagger document. NOTE: this is surprisingly slow, make sure you cache it and reuse it.

func (*Schema) FindRoute

func (s *Schema) FindRoute(r *http.Request) (*routers.Route, map[string]string, error)

FindRoute looks up the route from the specification.

type SchemaGetter

type SchemaGetter func() (*openapi3.T, error)

SchemaGetter allows clients to get their schema from wherever.

type Semver

type Semver = string

Semver A semantic version in the form v1.2.3. Pre-releases and variants are not currently supported.

type StaticResourceMetadata

type StaticResourceMetadata struct {
	// CreatedBy The user who created the resource.
	CreatedBy *string `json:"createdBy,omitempty"`

	// CreationTime The time the resource was created.
	CreationTime time.Time `json:"creationTime"`

	// Description The resource description, this optionally augments the name with more context.
	Description *string `json:"description,omitempty"`

	// Id The unique resource ID.
	Id string `json:"id"`

	// ModifiedBy The user who updated the resource.
	ModifiedBy *string `json:"modifiedBy,omitempty"`

	// ModifiedTime The time a resource was updated.
	ModifiedTime *time.Time `json:"modifiedTime,omitempty"`

	// Name A valid Kubernetes label value, typically used for resource names that can be
	// indexed in the database.
	Name KubernetesLabelValue `json:"name"`

	// Tags A list of tags.
	Tags *TagList `json:"tags,omitempty"`
}

StaticResourceMetadata defines model for staticResourceMetadata.

type Tag added in v0.1.84

type Tag struct {
	// Name A unique tag name.
	Name string `json:"name"`

	// Value The value of the tag.
	Value string `json:"value"`
}

Tag A tag mapping arbitrary names to values. These have no special meaning for any component are are intended for use by end users to add additional context to a resource, for example to categorize it.

type TagList added in v0.1.84

type TagList = []Tag

TagList A list of tags.

type TagSelectorParameter added in v1.4.0

type TagSelectorParameter = []string

TagSelectorParameter defines model for tagSelectorParameter.

type UnauthorizedResponse

type UnauthorizedResponse = Error

UnauthorizedResponse Generic error message, compatible with oauth2.

Jump to

Keyboard shortcuts

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