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.5.1 DO NOT EDIT.
Index ¶
- Variables
- func ErrorHandler(logger *slog.Logger, debug bool) func(w http.ResponseWriter, r *http.Request, err error)
- func GetSwagger() (swagger *openapi3.T, err error)
- func Handler(si ServerInterface) http.Handler
- func HandlerFromMux(si ServerInterface, m ServeMux) http.Handler
- func HandlerFromMuxWithBaseURL(si ServerInterface, m ServeMux, baseURL string) http.Handler
- func HandlerWithOptions(si ServerInterface, options StdHTTPServerOptions) http.Handler
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- func RequestErrorHandler() func(w http.ResponseWriter, r *http.Request, err error)
- type ArchiveBucket200JSONResponse
- type ArchiveBucket404JSONResponse
- type ArchiveBucket500JSONResponse
- type ArchiveBucketRequestObject
- type ArchiveBucketResponseObject
- type BucketDetails
- type BucketDetailsFiltersLengthMode
- type BucketListItem
- type CreateBucket201JSONResponse
- type CreateBucket500JSONResponse
- type CreateBucketJSONBody
- type CreateBucketJSONBodyFiltersLengthMode
- type CreateBucketJSONRequestBody
- type CreateBucketRequestObject
- type CreateBucketResponseObject
- type GenerateName200JSONResponse
- type GenerateName400JSONResponse
- type GenerateName500JSONResponse
- type GenerateNameJSONBody
- type GenerateNameJSONBodyFiltersLengthMode
- type GenerateNameJSONRequestBody
- type GenerateNameRequestObject
- type GenerateNameResponseObject
- type GetBucketDetails200JSONResponse
- type GetBucketDetails404JSONResponse
- type GetBucketDetails500JSONResponse
- type GetBucketDetailsRequestObject
- type GetBucketDetailsResponseObject
- type Handlers
- func (s *Handlers) ArchiveBucket(ctx context.Context, request ArchiveBucketRequestObject) (ArchiveBucketResponseObject, error)
- func (s *Handlers) CreateBucket(ctx context.Context, request CreateBucketRequestObject) (CreateBucketResponseObject, error)
- func (s *Handlers) GenerateName(ctx context.Context, request GenerateNameRequestObject) (GenerateNameResponseObject, error)
- func (s *Handlers) GetBucketDetails(ctx context.Context, request GetBucketDetailsRequestObject) (GetBucketDetailsResponseObject, error)
- func (s *Handlers) ListBuckets(ctx context.Context, request ListBucketsRequestObject) (ListBucketsResponseObject, error)
- func (s *Handlers) PopBucketName(ctx context.Context, request PopBucketNameRequestObject) (PopBucketNameResponseObject, error)
- func (s *Handlers) RecoverBucket(ctx context.Context, request RecoverBucketRequestObject) (RecoverBucketResponseObject, error)
- func (s *Handlers) UpdateBucket(ctx context.Context, request UpdateBucketRequestObject) (UpdateBucketResponseObject, error)
- type InvalidParamFormatError
- type ListBuckets200JSONResponse
- type ListBuckets500JSONResponse
- type ListBucketsParams
- type ListBucketsRequestObject
- type ListBucketsResponseObject
- type MiddlewareFunc
- type PopBucketName200JSONResponse
- type PopBucketName404JSONResponse
- type PopBucketName409JSONResponse
- type PopBucketName500JSONResponse
- type PopBucketNameRequestObject
- type PopBucketNameResponseObject
- type ProblemDetail
- type RecoverBucket200JSONResponse
- type RecoverBucket404JSONResponse
- type RecoverBucket500JSONResponse
- type RecoverBucketRequestObject
- type RecoverBucketResponseObject
- type RequiredHeaderError
- type RequiredParamError
- type ServeMux
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) ArchiveBucket(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) CreateBucket(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GenerateName(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetBucketDetails(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListBuckets(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) PopBucketName(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) RecoverBucket(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) UpdateBucket(w http.ResponseWriter, r *http.Request)
- type StdHTTPServerOptions
- type StrictHTTPServerOptions
- type StrictHandlerFunc
- type StrictMiddlewareFunc
- type StrictServerInterface
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type UnmarshalingParamError
- type UpdateBucket200JSONResponse
- type UpdateBucket400JSONResponse
- type UpdateBucket404JSONResponse
- type UpdateBucket409JSONResponse
- type UpdateBucket500JSONResponse
- type UpdateBucketJSONBody
- type UpdateBucketJSONRequestBody
- type UpdateBucketRequestObject
- type UpdateBucketResponseObject
Constants ¶
This section is empty.
Variables ¶
var ErrArchived = errors.New("the bucket is archived")
Functions ¶
func ErrorHandler ¶
func ErrorHandler(logger *slog.Logger, debug bool) func(w http.ResponseWriter, r *http.Request, err error)
ErrorHandler creates a response error handler for the strict server that converts Go errors into RFC 7807 ProblemDetail JSON responses.
In debug mode, the detail field includes the error message and type. In production mode, a generic error message is returned to avoid leaking implementation details.
func GetSwagger ¶
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 PathToRawSpec ¶
Constructs a synthetic filesystem for resolving external references when loading openapi specifications.
func RequestErrorHandler ¶
func RequestErrorHandler() func(w http.ResponseWriter, r *http.Request, err error)
RequestErrorHandler creates a handler for request parsing errors (malformed JSON, invalid types, etc.). These errors result in 400 Bad Request responses with ProblemDetail.
Types ¶
type ArchiveBucket200JSONResponse ¶
type ArchiveBucket200JSONResponse BucketDetails
func (ArchiveBucket200JSONResponse) VisitArchiveBucketResponse ¶
func (response ArchiveBucket200JSONResponse) VisitArchiveBucketResponse(w http.ResponseWriter) error
type ArchiveBucket404JSONResponse ¶
type ArchiveBucket404JSONResponse ProblemDetail
func (ArchiveBucket404JSONResponse) VisitArchiveBucketResponse ¶
func (response ArchiveBucket404JSONResponse) VisitArchiveBucketResponse(w http.ResponseWriter) error
type ArchiveBucket500JSONResponse ¶
type ArchiveBucket500JSONResponse ProblemDetail
func (ArchiveBucket500JSONResponse) VisitArchiveBucketResponse ¶
func (response ArchiveBucket500JSONResponse) VisitArchiveBucketResponse(w http.ResponseWriter) error
type ArchiveBucketRequestObject ¶
type ArchiveBucketRequestObject struct {
Id int32 `json:"id"`
}
type ArchiveBucketResponseObject ¶
type ArchiveBucketResponseObject interface {
VisitArchiveBucketResponse(w http.ResponseWriter) error
}
type BucketDetails ¶
type BucketDetails struct {
// ArchivedAt Timestamp when the bucket was archived
ArchivedAt *time.Time `json:"archived_at"`
// CreatedAt Timestamp when the bucket was created
CreatedAt time.Time `json:"created_at"`
// Description Description of the bucket
Description string `json:"description"`
// Filters Filter configuration for this bucket
Filters struct {
// Length Length constraint value (null if not enabled)
Length *int `json:"length"`
// LengthEnabled Whether length filtering is enabled
LengthEnabled bool `json:"length_enabled"`
// LengthMode Mode for length constraint
LengthMode *BucketDetailsFiltersLengthMode `json:"length_mode,omitempty"`
} `json:"filters"`
// Id Unique identifier for the bucket
Id int32 `json:"id"`
// Name Name of the bucket
Name string `json:"name"`
// RemainingPairs Number of names remaining in the bucket
RemainingPairs int64 `json:"remaining_pairs"`
// UpdatedAt Timestamp when the bucket was last updated
UpdatedAt *time.Time `json:"updated_at"`
}
BucketDetails defines model for BucketDetails.
type BucketDetailsFiltersLengthMode ¶
type BucketDetailsFiltersLengthMode string
BucketDetailsFiltersLengthMode Mode for length constraint
const ( BucketDetailsFiltersLengthModeExactly BucketDetailsFiltersLengthMode = "exactly" BucketDetailsFiltersLengthModeUpto BucketDetailsFiltersLengthMode = "upto" )
Defines values for BucketDetailsFiltersLengthMode.
type BucketListItem ¶
type BucketListItem struct {
// ArchivedAt Timestamp when the bucket was archived
ArchivedAt *time.Time `json:"archived_at"`
// CreatedAt Timestamp when the bucket was created
CreatedAt time.Time `json:"created_at"`
// Description Description of the bucket
Description string `json:"description"`
// Id Unique identifier for the bucket
Id int32 `json:"id"`
// Name Name of the bucket
Name string `json:"name"`
// UpdatedAt Timestamp when the bucket was last updated
UpdatedAt *time.Time `json:"updated_at"`
}
BucketListItem defines model for BucketListItem.
type CreateBucket201JSONResponse ¶
type CreateBucket201JSONResponse BucketDetails
func (CreateBucket201JSONResponse) VisitCreateBucketResponse ¶
func (response CreateBucket201JSONResponse) VisitCreateBucketResponse(w http.ResponseWriter) error
type CreateBucket500JSONResponse ¶
type CreateBucket500JSONResponse ProblemDetail
func (CreateBucket500JSONResponse) VisitCreateBucketResponse ¶
func (response CreateBucket500JSONResponse) VisitCreateBucketResponse(w http.ResponseWriter) error
type CreateBucketJSONBody ¶
type CreateBucketJSONBody struct {
// Description Description of the bucket
Description *string `json:"description,omitempty"`
// Filters Optional filters for name generation. If not provided, names are generated without constraints.
Filters *struct {
// Length Length constraint for generated names (required if length_enabled is true)
Length *int `json:"length,omitempty"`
// LengthEnabled Whether length filtering is enabled
LengthEnabled *bool `json:"length_enabled,omitempty"`
// LengthMode Mode for length constraint
LengthMode *CreateBucketJSONBodyFiltersLengthMode `json:"length_mode,omitempty"`
} `json:"filters,omitempty"`
// Name Name of the bucket
Name string `json:"name"`
}
CreateBucketJSONBody defines parameters for CreateBucket.
type CreateBucketJSONBodyFiltersLengthMode ¶
type CreateBucketJSONBodyFiltersLengthMode string
CreateBucketJSONBodyFiltersLengthMode defines parameters for CreateBucket.
const ( CreateBucketJSONBodyFiltersLengthModeExactly CreateBucketJSONBodyFiltersLengthMode = "exactly" CreateBucketJSONBodyFiltersLengthModeUpto CreateBucketJSONBodyFiltersLengthMode = "upto" )
Defines values for CreateBucketJSONBodyFiltersLengthMode.
type CreateBucketJSONRequestBody ¶
type CreateBucketJSONRequestBody CreateBucketJSONBody
CreateBucketJSONRequestBody defines body for CreateBucket for application/json ContentType.
type CreateBucketRequestObject ¶
type CreateBucketRequestObject struct {
Body *CreateBucketJSONRequestBody
}
type CreateBucketResponseObject ¶
type CreateBucketResponseObject interface {
VisitCreateBucketResponse(w http.ResponseWriter) error
}
type GenerateName200JSONResponse ¶
type GenerateName200JSONResponse struct {
// Name The generated server name
Name string `json:"name"`
}
func (GenerateName200JSONResponse) VisitGenerateNameResponse ¶
func (response GenerateName200JSONResponse) VisitGenerateNameResponse(w http.ResponseWriter) error
type GenerateName400JSONResponse ¶
type GenerateName400JSONResponse ProblemDetail
func (GenerateName400JSONResponse) VisitGenerateNameResponse ¶
func (response GenerateName400JSONResponse) VisitGenerateNameResponse(w http.ResponseWriter) error
type GenerateName500JSONResponse ¶
type GenerateName500JSONResponse ProblemDetail
func (GenerateName500JSONResponse) VisitGenerateNameResponse ¶
func (response GenerateName500JSONResponse) VisitGenerateNameResponse(w http.ResponseWriter) error
type GenerateNameJSONBody ¶
type GenerateNameJSONBody struct {
// Filters Optional filters for name generation. If not provided, names are generated without constraints.
Filters *struct {
// Length Length constraint for generated names (required if length_enabled is true)
Length *int `json:"length,omitempty"`
// LengthEnabled Whether length filtering is enabled
LengthEnabled *bool `json:"length_enabled,omitempty"`
// LengthMode Mode for length constraint
LengthMode *GenerateNameJSONBodyFiltersLengthMode `json:"length_mode,omitempty"`
} `json:"filters,omitempty"`
}
GenerateNameJSONBody defines parameters for GenerateName.
type GenerateNameJSONBodyFiltersLengthMode ¶
type GenerateNameJSONBodyFiltersLengthMode string
GenerateNameJSONBodyFiltersLengthMode defines parameters for GenerateName.
const ( Exactly GenerateNameJSONBodyFiltersLengthMode = "exactly" Upto GenerateNameJSONBodyFiltersLengthMode = "upto" )
Defines values for GenerateNameJSONBodyFiltersLengthMode.
type GenerateNameJSONRequestBody ¶
type GenerateNameJSONRequestBody GenerateNameJSONBody
GenerateNameJSONRequestBody defines body for GenerateName for application/json ContentType.
type GenerateNameRequestObject ¶
type GenerateNameRequestObject struct {
Body *GenerateNameJSONRequestBody
}
type GenerateNameResponseObject ¶
type GenerateNameResponseObject interface {
VisitGenerateNameResponse(w http.ResponseWriter) error
}
type GetBucketDetails200JSONResponse ¶
type GetBucketDetails200JSONResponse BucketDetails
func (GetBucketDetails200JSONResponse) VisitGetBucketDetailsResponse ¶
func (response GetBucketDetails200JSONResponse) VisitGetBucketDetailsResponse(w http.ResponseWriter) error
type GetBucketDetails404JSONResponse ¶
type GetBucketDetails404JSONResponse ProblemDetail
func (GetBucketDetails404JSONResponse) VisitGetBucketDetailsResponse ¶
func (response GetBucketDetails404JSONResponse) VisitGetBucketDetailsResponse(w http.ResponseWriter) error
type GetBucketDetails500JSONResponse ¶
type GetBucketDetails500JSONResponse ProblemDetail
func (GetBucketDetails500JSONResponse) VisitGetBucketDetailsResponse ¶
func (response GetBucketDetails500JSONResponse) VisitGetBucketDetailsResponse(w http.ResponseWriter) error
type GetBucketDetailsRequestObject ¶
type GetBucketDetailsRequestObject struct {
Id int32 `json:"id"`
}
type GetBucketDetailsResponseObject ¶
type GetBucketDetailsResponseObject interface {
VisitGetBucketDetailsResponse(w http.ResponseWriter) error
}
type Handlers ¶
type Handlers struct {
// contains filtered or unexported fields
}
func New ¶
func New(generator *namemyserver.Generator, bucketStore namemyserver.BucketStore) *Handlers
func (*Handlers) ArchiveBucket ¶
func (s *Handlers) ArchiveBucket( ctx context.Context, request ArchiveBucketRequestObject, ) (ArchiveBucketResponseObject, error)
func (*Handlers) CreateBucket ¶
func (s *Handlers) CreateBucket( ctx context.Context, request CreateBucketRequestObject, ) (CreateBucketResponseObject, error)
func (*Handlers) GenerateName ¶
func (s *Handlers) GenerateName( ctx context.Context, request GenerateNameRequestObject, ) (GenerateNameResponseObject, error)
func (*Handlers) GetBucketDetails ¶
func (s *Handlers) GetBucketDetails( ctx context.Context, request GetBucketDetailsRequestObject, ) (GetBucketDetailsResponseObject, error)
func (*Handlers) ListBuckets ¶
func (s *Handlers) ListBuckets( ctx context.Context, request ListBucketsRequestObject, ) (ListBucketsResponseObject, error)
func (*Handlers) PopBucketName ¶
func (s *Handlers) PopBucketName( ctx context.Context, request PopBucketNameRequestObject, ) (PopBucketNameResponseObject, error)
func (*Handlers) RecoverBucket ¶
func (s *Handlers) RecoverBucket( ctx context.Context, request RecoverBucketRequestObject, ) (RecoverBucketResponseObject, error)
func (*Handlers) UpdateBucket ¶
func (s *Handlers) UpdateBucket( ctx context.Context, request UpdateBucketRequestObject, ) (UpdateBucketResponseObject, error)
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type ListBuckets200JSONResponse ¶
type ListBuckets200JSONResponse struct {
Buckets []BucketListItem `json:"buckets"`
}
func (ListBuckets200JSONResponse) VisitListBucketsResponse ¶
func (response ListBuckets200JSONResponse) VisitListBucketsResponse(w http.ResponseWriter) error
type ListBuckets500JSONResponse ¶
type ListBuckets500JSONResponse ProblemDetail
func (ListBuckets500JSONResponse) VisitListBucketsResponse ¶
func (response ListBuckets500JSONResponse) VisitListBucketsResponse(w http.ResponseWriter) error
type ListBucketsParams ¶
type ListBucketsParams struct {
// Archived If present (regardless of value), returns only archived buckets
Archived *string `form:"archived,omitempty" json:"archived,omitempty"`
}
ListBucketsParams defines parameters for ListBuckets.
type ListBucketsRequestObject ¶
type ListBucketsRequestObject struct {
Params ListBucketsParams
}
type ListBucketsResponseObject ¶
type ListBucketsResponseObject interface {
VisitListBucketsResponse(w http.ResponseWriter) error
}
type PopBucketName200JSONResponse ¶
type PopBucketName200JSONResponse struct {
// Name The popped server name
Name string `json:"name"`
}
func (PopBucketName200JSONResponse) VisitPopBucketNameResponse ¶
func (response PopBucketName200JSONResponse) VisitPopBucketNameResponse(w http.ResponseWriter) error
type PopBucketName404JSONResponse ¶
type PopBucketName404JSONResponse ProblemDetail
func (PopBucketName404JSONResponse) VisitPopBucketNameResponse ¶
func (response PopBucketName404JSONResponse) VisitPopBucketNameResponse(w http.ResponseWriter) error
type PopBucketName409JSONResponse ¶
type PopBucketName409JSONResponse ProblemDetail
func (PopBucketName409JSONResponse) VisitPopBucketNameResponse ¶
func (response PopBucketName409JSONResponse) VisitPopBucketNameResponse(w http.ResponseWriter) error
type PopBucketName500JSONResponse ¶
type PopBucketName500JSONResponse ProblemDetail
func (PopBucketName500JSONResponse) VisitPopBucketNameResponse ¶
func (response PopBucketName500JSONResponse) VisitPopBucketNameResponse(w http.ResponseWriter) error
type PopBucketNameRequestObject ¶
type PopBucketNameRequestObject struct {
Id int32 `json:"id"`
}
type PopBucketNameResponseObject ¶
type PopBucketNameResponseObject interface {
VisitPopBucketNameResponse(w http.ResponseWriter) error
}
type ProblemDetail ¶
type ProblemDetail struct {
// Detail A human-readable explanation specific to this occurrence
Detail *string `json:"detail,omitempty"`
// Status HTTP status code
Status int `json:"status"`
// Title A short, human-readable summary of the problem
Title string `json:"title"`
// Type A URI reference that identifies the problem type
Type string `json:"type"`
}
ProblemDetail RFC 7807 Problem Details for HTTP APIs
type RecoverBucket200JSONResponse ¶
type RecoverBucket200JSONResponse BucketDetails
func (RecoverBucket200JSONResponse) VisitRecoverBucketResponse ¶
func (response RecoverBucket200JSONResponse) VisitRecoverBucketResponse(w http.ResponseWriter) error
type RecoverBucket404JSONResponse ¶
type RecoverBucket404JSONResponse ProblemDetail
func (RecoverBucket404JSONResponse) VisitRecoverBucketResponse ¶
func (response RecoverBucket404JSONResponse) VisitRecoverBucketResponse(w http.ResponseWriter) error
type RecoverBucket500JSONResponse ¶
type RecoverBucket500JSONResponse ProblemDetail
func (RecoverBucket500JSONResponse) VisitRecoverBucketResponse ¶
func (response RecoverBucket500JSONResponse) VisitRecoverBucketResponse(w http.ResponseWriter) error
type RecoverBucketRequestObject ¶
type RecoverBucketRequestObject struct {
Id int32 `json:"id"`
}
type RecoverBucketResponseObject ¶
type RecoverBucketResponseObject interface {
VisitRecoverBucketResponse(w http.ResponseWriter) error
}
type RequiredHeaderError ¶
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 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 {
// List all buckets
// (GET /v1alpha1/buckets)
ListBuckets(w http.ResponseWriter, r *http.Request, params ListBucketsParams)
// Create a new bucket
// (POST /v1alpha1/buckets)
CreateBucket(w http.ResponseWriter, r *http.Request)
// Get bucket details
// (GET /v1alpha1/buckets/{id})
GetBucketDetails(w http.ResponseWriter, r *http.Request, id int32)
// Update bucket
// (PATCH /v1alpha1/buckets/{id})
UpdateBucket(w http.ResponseWriter, r *http.Request, id int32)
// Archive a bucket
// (POST /v1alpha1/buckets/{id}/archive)
ArchiveBucket(w http.ResponseWriter, r *http.Request, id int32)
// Pop a name from bucket
// (POST /v1alpha1/buckets/{id}/pop)
PopBucketName(w http.ResponseWriter, r *http.Request, id int32)
// Recover an archived bucket
// (POST /v1alpha1/buckets/{id}/recover)
RecoverBucket(w http.ResponseWriter, r *http.Request, id int32)
// Generate a random server name
// (POST /v1alpha1/generate)
GenerateName(w http.ResponseWriter, r *http.Request)
}
ServerInterface represents all server handlers.
func NewStrictHandler ¶
func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface
func NewStrictHandlerWithOptions ¶
func NewStrictHandlerWithOptions(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc, options StrictHTTPServerOptions) ServerInterface
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) ArchiveBucket ¶
func (siw *ServerInterfaceWrapper) ArchiveBucket(w http.ResponseWriter, r *http.Request)
ArchiveBucket operation middleware
func (*ServerInterfaceWrapper) CreateBucket ¶
func (siw *ServerInterfaceWrapper) CreateBucket(w http.ResponseWriter, r *http.Request)
CreateBucket operation middleware
func (*ServerInterfaceWrapper) GenerateName ¶
func (siw *ServerInterfaceWrapper) GenerateName(w http.ResponseWriter, r *http.Request)
GenerateName operation middleware
func (*ServerInterfaceWrapper) GetBucketDetails ¶
func (siw *ServerInterfaceWrapper) GetBucketDetails(w http.ResponseWriter, r *http.Request)
GetBucketDetails operation middleware
func (*ServerInterfaceWrapper) ListBuckets ¶
func (siw *ServerInterfaceWrapper) ListBuckets(w http.ResponseWriter, r *http.Request)
ListBuckets operation middleware
func (*ServerInterfaceWrapper) PopBucketName ¶
func (siw *ServerInterfaceWrapper) PopBucketName(w http.ResponseWriter, r *http.Request)
PopBucketName operation middleware
func (*ServerInterfaceWrapper) RecoverBucket ¶
func (siw *ServerInterfaceWrapper) RecoverBucket(w http.ResponseWriter, r *http.Request)
RecoverBucket operation middleware
func (*ServerInterfaceWrapper) UpdateBucket ¶
func (siw *ServerInterfaceWrapper) UpdateBucket(w http.ResponseWriter, r *http.Request)
UpdateBucket operation middleware
type StdHTTPServerOptions ¶
type StdHTTPServerOptions struct {
BaseURL string
BaseRouter ServeMux
Middlewares []MiddlewareFunc
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
type StrictHTTPServerOptions ¶
type StrictHTTPServerOptions struct {
RequestErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
ResponseErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
type StrictHandlerFunc ¶
type StrictHandlerFunc = strictnethttp.StrictHTTPHandlerFunc
type StrictMiddlewareFunc ¶
type StrictMiddlewareFunc = strictnethttp.StrictHTTPMiddlewareFunc
type StrictServerInterface ¶
type StrictServerInterface interface {
// List all buckets
// (GET /v1alpha1/buckets)
ListBuckets(ctx context.Context, request ListBucketsRequestObject) (ListBucketsResponseObject, error)
// Create a new bucket
// (POST /v1alpha1/buckets)
CreateBucket(ctx context.Context, request CreateBucketRequestObject) (CreateBucketResponseObject, error)
// Get bucket details
// (GET /v1alpha1/buckets/{id})
GetBucketDetails(ctx context.Context, request GetBucketDetailsRequestObject) (GetBucketDetailsResponseObject, error)
// Update bucket
// (PATCH /v1alpha1/buckets/{id})
UpdateBucket(ctx context.Context, request UpdateBucketRequestObject) (UpdateBucketResponseObject, error)
// Archive a bucket
// (POST /v1alpha1/buckets/{id}/archive)
ArchiveBucket(ctx context.Context, request ArchiveBucketRequestObject) (ArchiveBucketResponseObject, error)
// Pop a name from bucket
// (POST /v1alpha1/buckets/{id}/pop)
PopBucketName(ctx context.Context, request PopBucketNameRequestObject) (PopBucketNameResponseObject, error)
// Recover an archived bucket
// (POST /v1alpha1/buckets/{id}/recover)
RecoverBucket(ctx context.Context, request RecoverBucketRequestObject) (RecoverBucketResponseObject, error)
// Generate a random server name
// (POST /v1alpha1/generate)
GenerateName(ctx context.Context, request GenerateNameRequestObject) (GenerateNameResponseObject, error)
}
StrictServerInterface represents all server handlers.
type TooManyValuesForParamError ¶
func (*TooManyValuesForParamError) Error ¶
func (e *TooManyValuesForParamError) Error() string
type UnescapedCookieParamError ¶
func (*UnescapedCookieParamError) Error ¶
func (e *UnescapedCookieParamError) Error() string
func (*UnescapedCookieParamError) Unwrap ¶
func (e *UnescapedCookieParamError) Unwrap() error
type UnmarshalingParamError ¶
func (*UnmarshalingParamError) Error ¶
func (e *UnmarshalingParamError) Error() string
func (*UnmarshalingParamError) Unwrap ¶
func (e *UnmarshalingParamError) Unwrap() error
type UpdateBucket200JSONResponse ¶
type UpdateBucket200JSONResponse BucketDetails
func (UpdateBucket200JSONResponse) VisitUpdateBucketResponse ¶
func (response UpdateBucket200JSONResponse) VisitUpdateBucketResponse(w http.ResponseWriter) error
type UpdateBucket400JSONResponse ¶
type UpdateBucket400JSONResponse ProblemDetail
func (UpdateBucket400JSONResponse) VisitUpdateBucketResponse ¶
func (response UpdateBucket400JSONResponse) VisitUpdateBucketResponse(w http.ResponseWriter) error
type UpdateBucket404JSONResponse ¶
type UpdateBucket404JSONResponse ProblemDetail
func (UpdateBucket404JSONResponse) VisitUpdateBucketResponse ¶
func (response UpdateBucket404JSONResponse) VisitUpdateBucketResponse(w http.ResponseWriter) error
type UpdateBucket409JSONResponse ¶
type UpdateBucket409JSONResponse ProblemDetail
func (UpdateBucket409JSONResponse) VisitUpdateBucketResponse ¶
func (response UpdateBucket409JSONResponse) VisitUpdateBucketResponse(w http.ResponseWriter) error
type UpdateBucket500JSONResponse ¶
type UpdateBucket500JSONResponse ProblemDetail
func (UpdateBucket500JSONResponse) VisitUpdateBucketResponse ¶
func (response UpdateBucket500JSONResponse) VisitUpdateBucketResponse(w http.ResponseWriter) error
type UpdateBucketJSONBody ¶
type UpdateBucketJSONBody struct {
// Description New description for the bucket. Use empty string to clear the description.
Description *string `json:"description,omitempty"`
}
UpdateBucketJSONBody defines parameters for UpdateBucket.
type UpdateBucketJSONRequestBody ¶
type UpdateBucketJSONRequestBody UpdateBucketJSONBody
UpdateBucketJSONRequestBody defines body for UpdateBucket for application/json ContentType.
type UpdateBucketRequestObject ¶
type UpdateBucketRequestObject struct {
Id int32 `json:"id"`
Body *UpdateBucketJSONRequestBody
}
type UpdateBucketResponseObject ¶
type UpdateBucketResponseObject interface {
VisitUpdateBucketResponse(w http.ResponseWriter) error
}