lib

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2023 License: Apache-2.0 Imports: 22 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 create openapi spec of swagger.

Types

type Config

type Config struct {
	Scheme             *runtime.Scheme
	Codecs             serializer.CodecFactory
	Info               spec.InfoProps
	OpenAPIDefinitions []common.GetOpenAPIDefinitions
	Resources          []ResourceWithNamespaceScoped
	Mapper             *meta.DefaultRESTMapper
}

Config is used to configure swagger information.

func (*Config) GetOpenAPIDefinitions

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

GetOpenAPIDefinitions get openapi definitions.

type ProxyREST

type ProxyREST struct{}

ProxyREST define proxy endpoint for resources.

func (*ProxyREST) Connect

func (r *ProxyREST) Connect(ctx context.Context, id string, options runtime.Object, responder rest.Responder) (http.Handler, error)

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 added in v1.4.0

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 contain gvr and NamespaceScoped of a resource.

type StandardREST

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

StandardREST define CRUD api for resources.

func (*StandardREST) ConvertToTable

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

ConvertToTable implement ConvertToTable interface.

func (*StandardREST) Create

func (r *StandardREST) Create(ctx context.Context, obj runtime.Object, createValidation rest.ValidateObjectFunc, options *metav1.CreateOptions) (runtime.Object, error)

Create implement Create interface.

func (*StandardREST) Delete

func (r *StandardREST) Delete(ctx context.Context, name string, deleteValidation rest.ValidateObjectFunc, options *metav1.DeleteOptions) (runtime.Object, bool, error)

Delete implement Delete interface.

func (*StandardREST) DeleteCollection

func (r *StandardREST) DeleteCollection(ctx context.Context, deleteValidation rest.ValidateObjectFunc, options *metav1.DeleteOptions, listOptions *metainternalversion.ListOptions) (runtime.Object, error)

DeleteCollection implement DeleteCollection interface.

func (*StandardREST) Destroy added in v1.4.0

func (r *StandardREST) Destroy()

Destroy cleans up its resources on shutdown.

func (*StandardREST) Get

func (r *StandardREST) Get(ctx context.Context, name string, options *metav1.GetOptions) (runtime.Object, error)

Get implement Get interface.

func (*StandardREST) GroupVersionKind

func (r *StandardREST) GroupVersionKind(containingGV 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

func (r *StandardREST) Update(ctx context.Context, name string, objInfo rest.UpdatedObjectInfo, createValidation rest.ValidateObjectFunc, updateValidation rest.ValidateObjectUpdateFunc, forceAllowCreate bool, options *metav1.UpdateOptions) (runtime.Object, bool, error)

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 added in v1.4.0

func (r *StatusREST) Destroy()

Destroy cleans up its resources on shutdown.

func (*StatusREST) Get

func (r *StatusREST) Get(ctx context.Context, name string, options *metav1.GetOptions) (runtime.Object, error)

Get retrieves the status object.

func (*StatusREST) GroupVersionKind

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

GroupVersionKind implement GroupVersionKind interface.

func (*StatusREST) New

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

New returns Cluster object.

func (*StatusREST) Update

func (r *StatusREST) Update(ctx context.Context, name string, objInfo rest.UpdatedObjectInfo, createValidation rest.ValidateObjectFunc, updateValidation rest.ValidateObjectUpdateFunc, forceAllowCreate bool, options *metav1.UpdateOptions) (runtime.Object, bool, error)

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