admin

package
v0.0.0-...-eb0e78d Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 12 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

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

View Source
const (
	BasicAuthScopes = "basicAuth.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 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 ForbiddenResponse

type ForbiddenResponse struct {
	// Code Error code, e.g. "forbidden".
	Code    string `json:"code" yaml:"code"`
	Message string `json:"message" yaml:"message"`
}

ForbiddenResponse defines model for ForbiddenResponse.

type HealthCheck

type HealthCheck struct {
	// Error Generic reason the check is down; present only when down
	Error *string `json:"error,omitempty" yaml:"error,omitempty"`

	// Since When the check started failing; present only when down
	Since *time.Time `json:"since,omitempty" yaml:"since,omitempty"`

	// Status Whether the dependency is usable
	Status HealthCheckStatus `json:"status" yaml:"status"`

	// Warning Generic note on a check that is up but under strain, such as an exhausted connection pool; present only while it applies, and never makes the check down
	Warning *string `json:"warning,omitempty" yaml:"warning,omitempty"`
}

HealthCheck defines model for HealthCheck.

type HealthCheckStatus

type HealthCheckStatus string

HealthCheckStatus Whether the dependency is usable

const (
	Down HealthCheckStatus = "down"
	Up   HealthCheckStatus = "up"
)

Defines values for HealthCheckStatus.

type HealthForbiddenResponse

type HealthForbiddenResponse struct {
	Status HealthForbiddenResponseStatus `json:"status" yaml:"status"`
}

HealthForbiddenResponse Answer to a client outside the allowed set; it carries no check detail

type HealthForbiddenResponseStatus

type HealthForbiddenResponseStatus string

HealthForbiddenResponseStatus defines model for HealthForbiddenResponse.Status.

const (
	Forbidden HealthForbiddenResponseStatus = "forbidden"
)

Defines values for HealthForbiddenResponseStatus.

type HealthResponse

type HealthResponse struct {
	// Checks Result of each dependency check, keyed by check name (for example `database`)
	Checks *map[string]HealthCheck `json:"checks,omitempty" yaml:"checks,omitempty"`

	// Status Health status ("healthy" when every check is up, otherwise "unhealthy")
	Status HealthResponseStatus `json:"status" yaml:"status"`

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

HealthResponse defines model for HealthResponse.

type HealthResponseStatus

type HealthResponseStatus string

HealthResponseStatus Health status ("healthy" when every check is up, otherwise "unhealthy")

const (
	Healthy   HealthResponseStatus = "healthy"
	Unhealthy HealthResponseStatus = "unhealthy"
)

Defines values for HealthResponseStatus.

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)
	// Liveness check
	// (GET /health)
	GetHealth(w http.ResponseWriter, r *http.Request)
	// Readiness check
	// (GET /ready)
	GetReady(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) GetReady

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

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

type UnauthorizedResponse struct {
	// Code Error code, e.g. "authentication_failed".
	Code    string `json:"code" yaml:"code"`
	Message string `json:"message" yaml:"message"`
}

UnauthorizedResponse defines model for UnauthorizedResponse.

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