Documentation ¶
Index ¶
- func GetOpenAPIDefinitions(builders []APIGroupBuilder) common.GetOpenAPIDefinitions
- func GetPathOperations(path *spec3.Path) []*spec3.Operation
- func InstallAPIs(scheme *runtime.Scheme, codecs serializer.CodecFactory, ...) error
- func SetupConfig(scheme *runtime.Scheme, serverConfig *genericapiserver.RecommendedConfig, ...) error
- type APIGroupBuilder
- type APIRegistrar
- type APIRouteHandler
- type APIRoutes
- type OpenAPIPostProcessor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetOpenAPIDefinitions ¶
func GetOpenAPIDefinitions(builders []APIGroupBuilder) common.GetOpenAPIDefinitions
This should eventually live in grafana-app-sdk
func InstallAPIs ¶
func InstallAPIs( scheme *runtime.Scheme, codecs serializer.CodecFactory, server *genericapiserver.GenericAPIServer, optsGetter generic.RESTOptionsGetter, builders []APIGroupBuilder, dualWrite bool, ) error
func SetupConfig ¶
func SetupConfig( scheme *runtime.Scheme, serverConfig *genericapiserver.RecommendedConfig, builders []APIGroupBuilder, buildTimestamp int64, buildVersion string, buildCommit string, buildBranch string, ) error
Types ¶
type APIGroupBuilder ¶
type APIGroupBuilder interface { // Get the main group name GetGroupVersion() schema.GroupVersion // Add the kinds to the server scheme InstallSchema(scheme *runtime.Scheme) error // Build the group+version behavior GetAPIGroupInfo( scheme *runtime.Scheme, codecs serializer.CodecFactory, optsGetter generic.RESTOptionsGetter, dualWrite bool, ) (*genericapiserver.APIGroupInfo, error) // Get OpenAPI definitions GetOpenAPIDefinitions() common.GetOpenAPIDefinitions // Get the API routes for each version GetAPIRoutes() *APIRoutes // Optionally add an authorization hook // Standard namespace checking will happen before this is called, specifically // the namespace must matches an org|stack that the user belongs to GetAuthorizer() authorizer.Authorizer }
TODO: this (or something like it) belongs in grafana-app-sdk, but lets keep it here while we iterate on a few simple examples
type APIRegistrar ¶
type APIRegistrar interface {
RegisterAPI(builder APIGroupBuilder)
}
type APIRouteHandler ¶
type APIRouteHandler struct { Path string // added to the appropriate level Spec *spec3.PathProps // Exposed in the open api service discovery Handler http.HandlerFunc // when Level = resource, the resource will be available in context }
This is used to implement dynamic sub-resources like pods/x/logs
type APIRoutes ¶
type APIRoutes struct { // Root handlers are registered directly after the apiVersion identifier Root []APIRouteHandler // Namespace handlers are mounted under the namespace Namespace []APIRouteHandler }
APIRoutes define explicit HTTP handlers in an apiserver TBD: is this actually necessary -- there may be more k8s native options for this
Click to show internal directories.
Click to hide internal directories.