api

package
v0.0.0-...-8ff41f6 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

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

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

Index

Constants

View Source
const (
	APIKeyAuthScopes = "APIKeyAuth.Scopes"
	CookieAuthScopes = "CookieAuth.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 PathToRawSpec

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

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

Types

type APIKey

type APIKey struct {
	Id  int    `json:"id"`
	Key string `json:"key"`
}

APIKey defines model for APIKey.

type APIKeyInit

type APIKeyInit struct {
	Scopes []string `json:"scopes"`
}

APIKeyInit defines model for APIKeyInit.

type APIKeyInitBody

type APIKeyInitBody = APIKeyInit

APIKeyInitBody defines model for APIKeyInitBody.

type APIKeyResponse

type APIKeyResponse = APIKey

APIKeyResponse defines model for APIKeyResponse.

type APIKeyUpdate

type APIKeyUpdate struct {
	Id     int      `json:"id"`
	Scopes []string `json:"scopes"`
}

APIKeyUpdate defines model for APIKeyUpdate.

type APIKeyUpdateBody

type APIKeyUpdateBody = APIKeyUpdate

APIKeyUpdateBody defines model for APIKeyUpdateBody.

type ChiServerOptions

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

type DeleteKeysParams

type DeleteKeysParams struct {
	Id int `form:"id" json:"id"`
}

DeleteKeysParams defines parameters for DeleteKeys.

type ErrorResponse

type ErrorResponse = ExpectedError

ErrorResponse defines model for ErrorResponse.

type ExpectedError

type ExpectedError struct {
	// Code the error code of the responses
	Code int `json:"code"`

	// Message Error message
	Message string `json:"message"`
}

ExpectedError defines model for ExpectedError.

type GetCoveragePathParams

type GetCoveragePathParams struct {
	// Format Specifies the desired format
	Format *GetCoveragePathParamsFormat `form:"format,omitempty" json:"format,omitempty"`
}

GetCoveragePathParams defines parameters for GetCoveragePath.

type GetCoveragePathParamsFormat

type GetCoveragePathParamsFormat string

GetCoveragePathParamsFormat defines parameters for GetCoveragePath.

const (
	Raw GetCoveragePathParamsFormat = "raw"
	Svg GetCoveragePathParamsFormat = "svg"
)

Defines values for GetCoveragePathParamsFormat.

type GetKeysParams

type GetKeysParams struct {
	Id int `form:"id" json:"id"`
}

GetKeysParams defines parameters for GetKeys.

type HealthCheck

type HealthCheck = string

HealthCheck Information on the health of the service

type HealthCheckResponse

type HealthCheckResponse = HealthCheck

HealthCheckResponse Information on the health of the service

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 MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

type PostCoveragePathJSONBody

type PostCoveragePathJSONBody struct {
	Cover string `json:"cover"`
}

PostCoveragePathJSONBody defines parameters for PostCoveragePath.

type PostCoveragePathJSONRequestBody

type PostCoveragePathJSONRequestBody PostCoveragePathJSONBody

PostCoveragePathJSONRequestBody defines body for PostCoveragePath for application/json ContentType.

type PostKeysJSONRequestBody

type PostKeysJSONRequestBody = APIKeyInit

PostKeysJSONRequestBody defines body for PostKeys for application/json ContentType.

type PostUsersSigninJSONRequestBody

type PostUsersSigninJSONRequestBody = SigninData

PostUsersSigninJSONRequestBody defines body for PostUsersSignin for application/json ContentType.

type PostUsersSignupJSONRequestBody

type PostUsersSignupJSONRequestBody = SigninData

PostUsersSignupJSONRequestBody defines body for PostUsersSignup for application/json ContentType.

type PutKeysJSONRequestBody

type PutKeysJSONRequestBody = APIKeyUpdate

PutKeysJSONRequestBody defines body for PutKeys for application/json ContentType.

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 Server

type Server struct{}

func (Server) DeleteCoveragePath

func (s Server) DeleteCoveragePath(w http.ResponseWriter, r *http.Request, path string)

func (Server) DeleteKeys

func (s Server) DeleteKeys(w http.ResponseWriter, r *http.Request, params DeleteKeysParams)

func (Server) GetCoveragePath

func (s Server) GetCoveragePath(w http.ResponseWriter, r *http.Request, path string, params GetCoveragePathParams)

func (Server) GetHealth

func (s Server) GetHealth(w http.ResponseWriter, r *http.Request)

func (Server) GetKeys

func (s Server) GetKeys(w http.ResponseWriter, r *http.Request, params GetKeysParams)

func (Server) PostCoveragePath

func (s Server) PostCoveragePath(w http.ResponseWriter, r *http.Request, path string)

func (Server) PostKeys

func (s Server) PostKeys(w http.ResponseWriter, r *http.Request)

func (Server) PostUsersSignin

func (s Server) PostUsersSignin(w http.ResponseWriter, r *http.Request)

func (Server) PostUsersSignout

func (s Server) PostUsersSignout(w http.ResponseWriter, r *http.Request)

func (Server) PostUsersSignup

func (s Server) PostUsersSignup(w http.ResponseWriter, r *http.Request)

func (Server) PutKeys

func (s Server) PutKeys(w http.ResponseWriter, r *http.Request)

type ServerInterface

type ServerInterface interface {

	// (DELETE /coverage/{path})
	DeleteCoveragePath(w http.ResponseWriter, r *http.Request, path string)

	// (GET /coverage/{path})
	GetCoveragePath(w http.ResponseWriter, r *http.Request, path string, params GetCoveragePathParams)

	// (POST /coverage/{path})
	PostCoveragePath(w http.ResponseWriter, r *http.Request, path string)

	// (GET /health)
	GetHealth(w http.ResponseWriter, r *http.Request)

	// (DELETE /keys)
	DeleteKeys(w http.ResponseWriter, r *http.Request, params DeleteKeysParams)

	// (GET /keys)
	GetKeys(w http.ResponseWriter, r *http.Request, params GetKeysParams)

	// (POST /keys)
	PostKeys(w http.ResponseWriter, r *http.Request)

	// (PUT /keys)
	PutKeys(w http.ResponseWriter, r *http.Request)

	// (POST /users/signin)
	PostUsersSignin(w http.ResponseWriter, r *http.Request)

	// (POST /users/signout)
	PostUsersSignout(w http.ResponseWriter, r *http.Request)

	// (POST /users/signup)
	PostUsersSignup(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) DeleteCoveragePath

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

DeleteCoveragePath operation middleware

func (*ServerInterfaceWrapper) DeleteKeys

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

DeleteKeys operation middleware

func (*ServerInterfaceWrapper) GetCoveragePath

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

GetCoveragePath operation middleware

func (*ServerInterfaceWrapper) GetHealth

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

GetHealth operation middleware

func (*ServerInterfaceWrapper) GetKeys

GetKeys operation middleware

func (*ServerInterfaceWrapper) PostCoveragePath

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

PostCoveragePath operation middleware

func (*ServerInterfaceWrapper) PostKeys

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

PostKeys operation middleware

func (*ServerInterfaceWrapper) PostUsersSignin

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

PostUsersSignin operation middleware

func (*ServerInterfaceWrapper) PostUsersSignout

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

PostUsersSignout operation middleware

func (*ServerInterfaceWrapper) PostUsersSignup

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

PostUsersSignup operation middleware

func (*ServerInterfaceWrapper) PutKeys

PutKeys operation middleware

type SigninData

type SigninData struct {
	// Password Password used to sign in
	Password string `json:"password"`

	// Username Username used to sign in
	Username string `json:"username"`
}

SigninData Data used to sign in

type SigninDataBody

type SigninDataBody = SigninData

SigninDataBody Data used to sign in

type Success

type Success struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

Success Operation was a success

type SuccessResponse

type SuccessResponse = Success

SuccessResponse Operation was a success

type SuccessfulSigninResponse

type SuccessfulSigninResponse = Success

SuccessfulSigninResponse Operation was a success

type SuccessfulSignoutResponse

type SuccessfulSignoutResponse = Success

SuccessfulSignoutResponse Operation was a success

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

func (_ Unimplemented) DeleteCoveragePath(w http.ResponseWriter, r *http.Request, path string)

(DELETE /coverage/{path})

func (Unimplemented) DeleteKeys

func (_ Unimplemented) DeleteKeys(w http.ResponseWriter, r *http.Request, params DeleteKeysParams)

(DELETE /keys)

func (Unimplemented) GetCoveragePath

func (_ Unimplemented) GetCoveragePath(w http.ResponseWriter, r *http.Request, path string, params GetCoveragePathParams)

(GET /coverage/{path})

func (Unimplemented) GetHealth

func (_ Unimplemented) GetHealth(w http.ResponseWriter, r *http.Request)

(GET /health)

func (Unimplemented) GetKeys

func (_ Unimplemented) GetKeys(w http.ResponseWriter, r *http.Request, params GetKeysParams)

(GET /keys)

func (Unimplemented) PostCoveragePath

func (_ Unimplemented) PostCoveragePath(w http.ResponseWriter, r *http.Request, path string)

(POST /coverage/{path})

func (Unimplemented) PostKeys

func (_ Unimplemented) PostKeys(w http.ResponseWriter, r *http.Request)

(POST /keys)

func (Unimplemented) PostUsersSignin

func (_ Unimplemented) PostUsersSignin(w http.ResponseWriter, r *http.Request)

(POST /users/signin)

func (Unimplemented) PostUsersSignout

func (_ Unimplemented) PostUsersSignout(w http.ResponseWriter, r *http.Request)

(POST /users/signout)

func (Unimplemented) PostUsersSignup

func (_ Unimplemented) PostUsersSignup(w http.ResponseWriter, r *http.Request)

(POST /users/signup)

func (Unimplemented) PutKeys

func (_ Unimplemented) PutKeys(w http.ResponseWriter, r *http.Request)

(PUT /keys)

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