adminapi

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Overview

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

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

Index

Constants

View Source
const (
	SessionidScopes = "sessionid.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 PathToRawSpec

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

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

Types

type APIErrorResponse

type APIErrorResponse struct {
	Errors []string `json:"errors"`
}

APIErrorResponse defines model for APIErrorResponse.

type FlowMeta

type FlowMeta struct {
	Data FlowMeta_Data `json:"data"`
	Name string        `json:"name"`
}

FlowMeta defines model for FlowMeta.

type FlowMetaDataAuth

type FlowMetaDataAuth struct {
	Methods *FlowMetaDataAuthMethods `json:"methods,omitempty"`
	Scheme  *FlowMetaDataAuthScheme  `json:"scheme,omitempty"`
}

FlowMetaDataAuth defines model for FlowMetaDataAuth.

type FlowMetaDataAuthMethodBasic

type FlowMetaDataAuthMethodBasic = map[string]interface{}

FlowMetaDataAuthMethodBasic defines model for FlowMetaDataAuthMethodBasic.

type FlowMetaDataAuthMethods

type FlowMetaDataAuthMethods struct {
	Basic *FlowMetaDataAuthMethodBasic `json:"basic,omitempty"`
}

FlowMetaDataAuthMethods defines model for FlowMetaDataAuthMethods.

type FlowMetaDataAuthScheme

type FlowMetaDataAuthScheme struct {
	Mappings *[]FlowMetaDataAuthSchemeMapping `json:"mappings,omitempty"`
}

FlowMetaDataAuthScheme defines model for FlowMetaDataAuthScheme.

type FlowMetaDataAuthSchemeMapping

type FlowMetaDataAuthSchemeMapping struct {
	Authorization *FlowMetaDataAuthSchemeMappingAuthorization `json:"authorization,omitempty"`
	Backend       string                                      `json:"backend"`
	Exempt        *[]string                                   `json:"exempt,omitempty"`
	Method        string                                      `json:"method"`
}

FlowMetaDataAuthSchemeMapping defines model for FlowMetaDataAuthSchemeMapping.

type FlowMetaDataAuthSchemeMappingAuthorization

type FlowMetaDataAuthSchemeMappingAuthorization struct {
	Groups *[]string            `json:"groups,omitempty"`
	Paths  *map[string][]string `json:"paths,omitempty"`
}

FlowMetaDataAuthSchemeMappingAuthorization defines model for FlowMetaDataAuthSchemeMappingAuthorization.

type FlowMetaDataOAS

type FlowMetaDataOAS struct {
	Backends *[]string `json:"backends,omitempty"`
}

FlowMetaDataOAS defines model for FlowMetaDataOAS.

type FlowMetaDataObservability

type FlowMetaDataObservability struct {
	Enabled bool `json:"enabled"`
}

FlowMetaDataObservability defines model for FlowMetaDataObservability.

type FlowMetaDataRouter

type FlowMetaDataRouter struct {
	Backends *[]FlowMetaDataRouterBackend `json:"backends,omitempty"`
}

FlowMetaDataRouter defines model for FlowMetaDataRouter.

type FlowMetaDataRouterBackend

type FlowMetaDataRouterBackend struct {
	Host string `json:"host"`
	Name string `json:"name"`
	Port int    `json:"port"`
}

FlowMetaDataRouterBackend defines model for FlowMetaDataRouterBackend.

type FlowMeta_Data

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

FlowMeta_Data defines model for FlowMeta.Data.

func (FlowMeta_Data) AsFlowMetaDataAuth

func (t FlowMeta_Data) AsFlowMetaDataAuth() (FlowMetaDataAuth, error)

AsFlowMetaDataAuth returns the union data inside the FlowMeta_Data as a FlowMetaDataAuth

func (FlowMeta_Data) AsFlowMetaDataOAS

func (t FlowMeta_Data) AsFlowMetaDataOAS() (FlowMetaDataOAS, error)

AsFlowMetaDataOAS returns the union data inside the FlowMeta_Data as a FlowMetaDataOAS

func (FlowMeta_Data) AsFlowMetaDataObservability

func (t FlowMeta_Data) AsFlowMetaDataObservability() (FlowMetaDataObservability, error)

AsFlowMetaDataObservability returns the union data inside the FlowMeta_Data as a FlowMetaDataObservability

func (FlowMeta_Data) AsFlowMetaDataRouter

func (t FlowMeta_Data) AsFlowMetaDataRouter() (FlowMetaDataRouter, error)

AsFlowMetaDataRouter returns the union data inside the FlowMeta_Data as a FlowMetaDataRouter

func (FlowMeta_Data) AsNoFlowMetaData

func (t FlowMeta_Data) AsNoFlowMetaData() (NoFlowMetaData, error)

AsNoFlowMetaData returns the union data inside the FlowMeta_Data as a NoFlowMetaData

func (*FlowMeta_Data) FromFlowMetaDataAuth

func (t *FlowMeta_Data) FromFlowMetaDataAuth(v FlowMetaDataAuth) error

FromFlowMetaDataAuth overwrites any union data inside the FlowMeta_Data as the provided FlowMetaDataAuth

func (*FlowMeta_Data) FromFlowMetaDataOAS

func (t *FlowMeta_Data) FromFlowMetaDataOAS(v FlowMetaDataOAS) error

FromFlowMetaDataOAS overwrites any union data inside the FlowMeta_Data as the provided FlowMetaDataOAS

func (*FlowMeta_Data) FromFlowMetaDataObservability

func (t *FlowMeta_Data) FromFlowMetaDataObservability(v FlowMetaDataObservability) error

FromFlowMetaDataObservability overwrites any union data inside the FlowMeta_Data as the provided FlowMetaDataObservability

func (*FlowMeta_Data) FromFlowMetaDataRouter

func (t *FlowMeta_Data) FromFlowMetaDataRouter(v FlowMetaDataRouter) error

FromFlowMetaDataRouter overwrites any union data inside the FlowMeta_Data as the provided FlowMetaDataRouter

func (*FlowMeta_Data) FromNoFlowMetaData

func (t *FlowMeta_Data) FromNoFlowMetaData(v NoFlowMetaData) error

FromNoFlowMetaData overwrites any union data inside the FlowMeta_Data as the provided NoFlowMetaData

func (FlowMeta_Data) MarshalJSON

func (t FlowMeta_Data) MarshalJSON() ([]byte, error)

func (*FlowMeta_Data) MergeFlowMetaDataAuth

func (t *FlowMeta_Data) MergeFlowMetaDataAuth(v FlowMetaDataAuth) error

MergeFlowMetaDataAuth performs a merge with any union data inside the FlowMeta_Data, using the provided FlowMetaDataAuth

func (*FlowMeta_Data) MergeFlowMetaDataOAS

func (t *FlowMeta_Data) MergeFlowMetaDataOAS(v FlowMetaDataOAS) error

MergeFlowMetaDataOAS performs a merge with any union data inside the FlowMeta_Data, using the provided FlowMetaDataOAS

func (*FlowMeta_Data) MergeFlowMetaDataObservability

func (t *FlowMeta_Data) MergeFlowMetaDataObservability(v FlowMetaDataObservability) error

MergeFlowMetaDataObservability performs a merge with any union data inside the FlowMeta_Data, using the provided FlowMetaDataObservability

func (*FlowMeta_Data) MergeFlowMetaDataRouter

func (t *FlowMeta_Data) MergeFlowMetaDataRouter(v FlowMetaDataRouter) error

MergeFlowMetaDataRouter performs a merge with any union data inside the FlowMeta_Data, using the provided FlowMetaDataRouter

func (*FlowMeta_Data) MergeNoFlowMetaData

func (t *FlowMeta_Data) MergeNoFlowMetaData(v NoFlowMetaData) error

MergeNoFlowMetaData performs a merge with any union data inside the FlowMeta_Data, using the provided NoFlowMetaData

func (*FlowMeta_Data) UnmarshalJSON

func (t *FlowMeta_Data) UnmarshalJSON(b []byte) error

type GetBackendOAS200ApplicationyamlResponse

type GetBackendOAS200ApplicationyamlResponse struct {
	Body          io.Reader
	ContentLength int64
}

func (GetBackendOAS200ApplicationyamlResponse) VisitGetBackendOASResponse

func (response GetBackendOAS200ApplicationyamlResponse) VisitGetBackendOASResponse(w http.ResponseWriter) error

type GetBackendOAS404JSONResponse

type GetBackendOAS404JSONResponse APIErrorResponse

func (GetBackendOAS404JSONResponse) VisitGetBackendOASResponse

func (response GetBackendOAS404JSONResponse) VisitGetBackendOASResponse(w http.ResponseWriter) error

type GetBackendOAS500JSONResponse

type GetBackendOAS500JSONResponse APIErrorResponse

func (GetBackendOAS500JSONResponse) VisitGetBackendOASResponse

func (response GetBackendOAS500JSONResponse) VisitGetBackendOASResponse(w http.ResponseWriter) error

type GetBackendOASRequestObject

type GetBackendOASRequestObject struct {
	Backend string `json:"backend"`
}

type GetBackendOASResponseObject

type GetBackendOASResponseObject interface {
	VisitGetBackendOASResponse(w http.ResponseWriter) error
}

type GetFlow200JSONResponse

type GetFlow200JSONResponse []FlowMeta

func (GetFlow200JSONResponse) VisitGetFlowResponse

func (response GetFlow200JSONResponse) VisitGetFlowResponse(w http.ResponseWriter) error

type GetFlow500JSONResponse

type GetFlow500JSONResponse APIErrorResponse

func (GetFlow500JSONResponse) VisitGetFlowResponse

func (response GetFlow500JSONResponse) VisitGetFlowResponse(w http.ResponseWriter) error

type GetFlowRequestObject

type GetFlowRequestObject struct {
}

type GetFlowResponseObject

type GetFlowResponseObject interface {
	VisitGetFlowResponse(w http.ResponseWriter) error
}

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 LoginSuperuser204Response

type LoginSuperuser204Response struct {
	Headers LoginSuperuser204ResponseHeaders
}

func (LoginSuperuser204Response) VisitLoginSuperuserResponse

func (response LoginSuperuser204Response) VisitLoginSuperuserResponse(w http.ResponseWriter) error

type LoginSuperuser204ResponseHeaders

type LoginSuperuser204ResponseHeaders struct {
	XKrbSession string
}

type LoginSuperuser400JSONResponse

type LoginSuperuser400JSONResponse APIErrorResponse

func (LoginSuperuser400JSONResponse) VisitLoginSuperuserResponse

func (response LoginSuperuser400JSONResponse) VisitLoginSuperuserResponse(w http.ResponseWriter) error

type LoginSuperuser401JSONResponse

type LoginSuperuser401JSONResponse APIErrorResponse

func (LoginSuperuser401JSONResponse) VisitLoginSuperuserResponse

func (response LoginSuperuser401JSONResponse) VisitLoginSuperuserResponse(w http.ResponseWriter) error

type LoginSuperuser429JSONResponse

type LoginSuperuser429JSONResponse APIErrorResponse

func (LoginSuperuser429JSONResponse) VisitLoginSuperuserResponse

func (response LoginSuperuser429JSONResponse) VisitLoginSuperuserResponse(w http.ResponseWriter) error

type LoginSuperuser500JSONResponse

type LoginSuperuser500JSONResponse APIErrorResponse

func (LoginSuperuser500JSONResponse) VisitLoginSuperuserResponse

func (response LoginSuperuser500JSONResponse) VisitLoginSuperuserResponse(w http.ResponseWriter) error

type LoginSuperuserJSONBody

type LoginSuperuserJSONBody struct {
	ClientId     string `json:"clientId"`
	ClientSecret string `json:"clientSecret"`
}

LoginSuperuserJSONBody defines parameters for LoginSuperuser.

type LoginSuperuserJSONRequestBody

type LoginSuperuserJSONRequestBody LoginSuperuserJSONBody

LoginSuperuserJSONRequestBody defines body for LoginSuperuser for application/json ContentType.

type LoginSuperuserRequestObject

type LoginSuperuserRequestObject struct {
	Body *LoginSuperuserJSONRequestBody
}

type LoginSuperuserResponseObject

type LoginSuperuserResponseObject interface {
	VisitLoginSuperuserResponse(w http.ResponseWriter) error
}

type LogoutSuperuser204Response

type LogoutSuperuser204Response struct {
}

func (LogoutSuperuser204Response) VisitLogoutSuperuserResponse

func (response LogoutSuperuser204Response) VisitLogoutSuperuserResponse(w http.ResponseWriter) error

type LogoutSuperuser500JSONResponse

type LogoutSuperuser500JSONResponse APIErrorResponse

func (LogoutSuperuser500JSONResponse) VisitLogoutSuperuserResponse

func (response LogoutSuperuser500JSONResponse) VisitLogoutSuperuserResponse(w http.ResponseWriter) error

type LogoutSuperuserRequestObject

type LogoutSuperuserRequestObject struct {
}

type LogoutSuperuserResponseObject

type LogoutSuperuserResponseObject interface {
	VisitLogoutSuperuserResponse(w http.ResponseWriter) error
}

type MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

type NoFlowMetaData

type NoFlowMetaData = map[string]interface{}

NoFlowMetaData No metadata for the flow component.

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 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/admin/flow)
	GetFlow(w http.ResponseWriter, r *http.Request)

	// (GET /api/admin/oas/{backend})
	GetBackendOAS(w http.ResponseWriter, r *http.Request, backend string)

	// (POST /api/admin/superuser/login)
	LoginSuperuser(w http.ResponseWriter, r *http.Request)

	// (POST /api/admin/superuser/logout)
	LogoutSuperuser(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) GetBackendOAS

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

GetBackendOAS operation middleware

func (*ServerInterfaceWrapper) GetFlow

GetFlow operation middleware

func (*ServerInterfaceWrapper) LoginSuperuser

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

LoginSuperuser operation middleware

func (*ServerInterfaceWrapper) LogoutSuperuser

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

LogoutSuperuser 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 StrictServerInterface

type StrictServerInterface interface {

	// (GET /api/admin/flow)
	GetFlow(ctx context.Context, request GetFlowRequestObject) (GetFlowResponseObject, error)

	// (GET /api/admin/oas/{backend})
	GetBackendOAS(ctx context.Context, request GetBackendOASRequestObject) (GetBackendOASResponseObject, error)

	// (POST /api/admin/superuser/login)
	LoginSuperuser(ctx context.Context, request LoginSuperuserRequestObject) (LoginSuperuserResponseObject, error)

	// (POST /api/admin/superuser/logout)
	LogoutSuperuser(ctx context.Context, request LogoutSuperuserRequestObject) (LogoutSuperuserResponseObject, error)
}

StrictServerInterface represents all server handlers.

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