openapi

package
v0.1.87 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 13 Imported by: 27

Documentation

Overview

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

Code generated by github.com/deepmap/oapi-codegen version v1.16.2 DO NOT EDIT.

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

Code generated by github.com/deepmap/oapi-codegen version v1.16.2 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 OAuth2 specification, but are expanded with proprietary status codes for APIs other than those specified by OAuth2.
	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 OAuth2 specification, but are expanded with proprietary status codes for APIs other than those specified by OAuth2.

const (
	AccessDenied            ErrorError = "access_denied"
	Conflict                ErrorError = "conflict"
	Forbidden               ErrorError = "forbidden"
	InvalidClient           ErrorError = "invalid_client"
	InvalidGrant            ErrorError = "invalid_grant"
	InvalidRequest          ErrorError = "invalid_request"
	InvalidScope            ErrorError = "invalid_scope"
	MethodNotAllowed        ErrorError = "method_not_allowed"
	NotFound                ErrorError = "not_found"
	ServerError             ErrorError = "server_error"
	TemporarilyUnavailable  ErrorError = "temporarily_unavailable"
	UnauthorizedClient      ErrorError = "unauthorized_client"
	UnsupportedGrantType    ErrorError = "unsupported_grant_type"
	UnsupportedMediaType    ErrorError = "unsupported_media_type"
	UnsupportedResponseType ErrorError = "unsupported_response_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 Kubenetes 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"`

	// 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 Kubenetes 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"`

	// 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 Kubenetes 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 ResourceMetadata

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

	// Name A valid Kubenetes 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 Resource metadata valid 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"`

	// 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 Kubenetes 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 Resource metadata valid 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.

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 Kubenetes 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 An arbitrary tag name and value.

type TagList added in v0.1.84

type TagList = []Tag

TagList A list of tags.

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