adminapi

package
v0.0.0-...-0eef58a Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: Apache-2.0 Imports: 11 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.5.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 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 CertificateResponse

type CertificateResponse struct {
	Count    *int       `json:"count,omitempty" yaml:"count,omitempty"`
	Id       *string    `json:"id,omitempty" yaml:"id,omitempty"`
	Issuer   *string    `json:"issuer,omitempty" yaml:"issuer,omitempty"`
	Name     *string    `json:"name,omitempty" yaml:"name,omitempty"`
	NotAfter *time.Time `json:"notAfter,omitempty" yaml:"notAfter,omitempty"`
	Status   *string    `json:"status,omitempty" yaml:"status,omitempty"`
	Subject  *string    `json:"subject,omitempty" yaml:"subject,omitempty"`
}

CertificateResponse defines model for CertificateResponse.

type ConfigDumpAPIItem

type ConfigDumpAPIItem struct {
	Configuration *map[string]interface{} `json:"configuration,omitempty" yaml:"configuration,omitempty"`
	Id            *openapi_types.UUID     `json:"id,omitempty" yaml:"id,omitempty"`

	// Metadata Metadata for API in config dump
	Metadata *ConfigDumpAPIMetadata `json:"metadata,omitempty" yaml:"metadata,omitempty"`
}

ConfigDumpAPIItem API item in config dump response

type ConfigDumpAPIMetadata

type ConfigDumpAPIMetadata struct {
	CreatedAt  *time.Time                   `json:"createdAt,omitempty" yaml:"createdAt,omitempty"`
	DeployedAt *time.Time                   `json:"deployedAt,omitempty" yaml:"deployedAt,omitempty"`
	Status     *ConfigDumpAPIMetadataStatus `json:"status,omitempty" yaml:"status,omitempty"`
	UpdatedAt  *time.Time                   `json:"updatedAt,omitempty" yaml:"updatedAt,omitempty"`
}

ConfigDumpAPIMetadata Metadata for API in config dump

type ConfigDumpAPIMetadataStatus

type ConfigDumpAPIMetadataStatus string

ConfigDumpAPIMetadataStatus defines model for ConfigDumpAPIMetadata.Status.

const (
	Deployed   ConfigDumpAPIMetadataStatus = "deployed"
	Failed     ConfigDumpAPIMetadataStatus = "failed"
	Pending    ConfigDumpAPIMetadataStatus = "pending"
	Undeployed ConfigDumpAPIMetadataStatus = "undeployed"
)

Defines values for ConfigDumpAPIMetadataStatus.

type ConfigDumpResponse

type ConfigDumpResponse struct {
	Apis         *[]ConfigDumpAPIItem      `json:"apis,omitempty" yaml:"apis,omitempty"`
	Certificates *[]CertificateResponse    `json:"certificates,omitempty" yaml:"certificates,omitempty"`
	Policies     *[]map[string]interface{} `json:"policies,omitempty" yaml:"policies,omitempty"`
	Statistics   *struct {
		TotalApis             *int `json:"totalApis,omitempty" yaml:"totalApis,omitempty"`
		TotalCertificateBytes *int `json:"totalCertificateBytes,omitempty" yaml:"totalCertificateBytes,omitempty"`
		TotalCertificates     *int `json:"totalCertificates,omitempty" yaml:"totalCertificates,omitempty"`
		TotalPolicies         *int `json:"totalPolicies,omitempty" yaml:"totalPolicies,omitempty"`
	} `json:"statistics,omitempty" yaml:"statistics,omitempty"`
	Status    *string    `json:"status,omitempty" yaml:"status,omitempty"`
	Timestamp *time.Time `json:"timestamp,omitempty" yaml:"timestamp,omitempty"`

	// XdsSync xDS sync metadata included in config dump
	XdsSync *ConfigDumpXDSSync `json:"xds_sync,omitempty" yaml:"xds_sync,omitempty"`
}

ConfigDumpResponse defines model for ConfigDumpResponse.

type ConfigDumpXDSSync

type ConfigDumpXDSSync struct {
	// PolicyChainVersion Latest policy chain version published by the controller
	PolicyChainVersion *string `json:"policy_chain_version,omitempty" yaml:"policy_chain_version,omitempty"`
}

ConfigDumpXDSSync xDS sync metadata included in config dump

type ErrorResponse

type ErrorResponse struct {
	Message string `json:"message" yaml:"message"`
	Status  string `json:"status" yaml:"status"`
}

ErrorResponse defines model for ErrorResponse.

type HealthResponse

type HealthResponse struct {
	// Status Health status ("healthy")
	Status *string `json:"status,omitempty" yaml:"status,omitempty"`

	// Timestamp Timestamp of the health check
	Timestamp *time.Time `json:"timestamp,omitempty" yaml:"timestamp,omitempty"`
}

HealthResponse defines model for HealthResponse.

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 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 {
	// Dump current configuration state
	// (GET /config_dump)
	GetConfigDump(w http.ResponseWriter, r *http.Request)
	// Health check
	// (GET /health)
	GetHealth(w http.ResponseWriter, r *http.Request)
	// Get xDS policy sync status
	// (GET /xds_sync_status)
	GetXDSSyncStatus(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) GetConfigDump

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

GetConfigDump operation middleware

func (*ServerInterfaceWrapper) GetHealth

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

GetHealth operation middleware

func (*ServerInterfaceWrapper) GetXDSSyncStatus

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

GetXDSSyncStatus operation middleware

type StdHTTPServerOptions

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

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

type XDSSyncStatusResponse

type XDSSyncStatusResponse struct {
	Component *string `json:"component,omitempty" yaml:"component,omitempty"`

	// PolicyChainVersion Latest policy chain version published by the controller
	PolicyChainVersion *string    `json:"policy_chain_version,omitempty" yaml:"policy_chain_version,omitempty"`
	Timestamp          *time.Time `json:"timestamp,omitempty" yaml:"timestamp,omitempty"`
}

XDSSyncStatusResponse defines model for XDSSyncStatusResponse.

Jump to

Keyboard shortcuts

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