lib

package
v1.21.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderOpenAPISpec

func RenderOpenAPISpec(cfg Config) (string, error)

RenderOpenAPISpec creates the OpenAPI specification for Swagger.

Types

type Config

type Config struct {
	Scheme             *runtime.Scheme                // Runtime Scheme used for type registration and object instantiation.
	Codecs             serializer.CodecFactory        // Codec factory used for encoding and decoding objects.
	Info               spec.InfoProps                 // Basic information for the OpenAPI specification, such as title, version, etc.
	OpenAPIDefinitions []common.GetOpenAPIDefinitions // Array of functions to obtain OpenAPI definitions.
	Resources          []ResourceWithNamespaceScoped  // List of resources containing GVR and namespace scope information.
	Mapper             *meta.DefaultRESTMapper        // REST mapper for conversion between GVR and GVK.
}

Config is the struct used to configure Swagger information.

func (*Config) GetOpenAPIDefinitions

func (c *Config) GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition

GetOpenAPIDefinitions gets OpenAPI definitions.

type ProxyREST

type ProxyREST struct{}

ProxyREST define proxy endpoint for resources.

func (*ProxyREST) Connect

Connect implement Connect interface.

func (*ProxyREST) ConnectMethods

func (r *ProxyREST) ConnectMethods() []string

ConnectMethods returns the list of HTTP methods handled by Connect.

func (*ProxyREST) Destroy

func (r *ProxyREST) Destroy()

Destroy cleans up its resources on shutdown.

func (*ProxyREST) New

func (r *ProxyREST) New() runtime.Object

New returns an empty cluster proxy subresource.

func (*ProxyREST) NewConnectOptions

func (r *ProxyREST) NewConnectOptions() (runtime.Object, bool, string)

NewConnectOptions returns versioned resource that represents proxy parameters.

type ResourceInfo

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

ResourceInfo is content of StandardREST.

type ResourceWithNamespaceScoped

type ResourceWithNamespaceScoped struct {
	GVR             schema.GroupVersionResource
	NamespaceScoped bool
}

ResourceWithNamespaceScoped contains information about the group, version, resource (GVR), and whether it supports namespace scope.

type StandardREST

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

StandardREST define CRUD api for resources.

func (*StandardREST) ConvertToTable

func (r *StandardREST) ConvertToTable(_ context.Context, _ runtime.Object, _ runtime.Object) (*metav1.Table, error)

ConvertToTable implement ConvertToTable interface.

func (*StandardREST) Create

Create implement Create interface.

func (*StandardREST) Delete

Delete implement Delete interface.

func (*StandardREST) DeleteCollection

DeleteCollection implement DeleteCollection interface.

func (*StandardREST) Destroy

func (r *StandardREST) Destroy()

Destroy cleans up its resources on shutdown.

func (*StandardREST) Get

Get implement Get interface.

func (*StandardREST) GetSingularName

func (r *StandardREST) GetSingularName() string

GetSingularName implements the SingularNameProvider interfaces.

func (*StandardREST) GroupVersionKind

func (r *StandardREST) GroupVersionKind(_ schema.GroupVersion) schema.GroupVersionKind

GroupVersionKind implement GroupVersionKind interface.

func (*StandardREST) List

List implement List interface.

func (*StandardREST) NamespaceScoped

func (r *StandardREST) NamespaceScoped() bool

NamespaceScoped implement NamespaceScoped interface.

func (*StandardREST) New

func (r *StandardREST) New() runtime.Object

New implement New interface.

func (*StandardREST) NewList

func (r *StandardREST) NewList() runtime.Object

NewList implement NewList interface.

func (*StandardREST) Update

Update implement Update interface.

func (*StandardREST) Watch

Watch implement Watch interface.

type StatusInfo

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

StatusInfo is content of StatusREST.

type StatusREST

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

StatusREST define status endpoint for resources.

func (*StatusREST) Destroy

func (r *StatusREST) Destroy()

Destroy cleans up its resources on shutdown.

func (*StatusREST) Get

Get retrieves the status object.

func (*StatusREST) GroupVersionKind

func (r *StatusREST) GroupVersionKind(_ schema.GroupVersion) schema.GroupVersionKind

GroupVersionKind implement GroupVersionKind interface.

func (*StatusREST) New

func (r *StatusREST) New() runtime.Object

New returns Cluster object.

func (*StatusREST) Update

Update alters the status subset of an object.

Jump to

Keyboard shortcuts

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