openapi

package
v0.0.0-...-58efce0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateSpec

func GenerateSpec(cfg Config) (*spec.Swagger, error)

GenerateSpec creates a Swagger specification out of the configuration.

Types

type CDStorage

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

func NewCDStorage

func NewCDStorage(cfg ResourceInfo) *CDStorage

func (*CDStorage) Create

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

func (*CDStorage) Delete

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

Deleter

func (*CDStorage) GroupVersionKind

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

func (*CDStorage) NamespaceScoped

func (r *CDStorage) NamespaceScoped() bool

func (*CDStorage) New

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

Getter

type Config

type Config struct {
	Scheme *runtime.Scheme
	Codecs serializer.CodecFactory

	Info                spec.InfoProps
	SecurityDefinitions *spec.SecurityDefinitions
	OpenAPIDefinitions  []common.GetOpenAPIDefinitions
	Resources           []TypeInfo
	GetterResources     []TypeInfo
	ListerResources     []TypeInfo
	CDResources         []TypeInfo
	RDResources         []TypeInfo
}

Config is the OpenAPI API generator configuration.

func (*Config) GetDefinitions

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

GetDefinitions extracts the OpenAPI definitions from the configuration.

type GetterStorage

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

func NewGetterStorage

func NewGetterStorage(cfg ResourceInfo) *GetterStorage

func (*GetterStorage) Get

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

func (*GetterStorage) GroupVersionKind

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

func (*GetterStorage) NamespaceScoped

func (r *GetterStorage) NamespaceScoped() bool

func (*GetterStorage) New

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

Getter

type ListerStorage

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

func NewListerStorage

func NewListerStorage(cfg ResourceInfo) *ListerStorage

func (*ListerStorage) ConvertToTable

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

func (*ListerStorage) Get

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

func (*ListerStorage) GroupVersionKind

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

func (*ListerStorage) List

func (*ListerStorage) NamespaceScoped

func (r *ListerStorage) NamespaceScoped() bool

func (*ListerStorage) New

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

Getter

func (*ListerStorage) NewList

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

Lister

type RDStorage

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

func NewRDStorage

func NewRDStorage(cfg ResourceInfo) *RDStorage

func (*RDStorage) ConvertToTable

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

func (*RDStorage) Delete

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

Deleter

func (*RDStorage) Get

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

func (*RDStorage) GroupVersionKind

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

func (*RDStorage) List

func (*RDStorage) NamespaceScoped

func (r *RDStorage) NamespaceScoped() bool

func (*RDStorage) New

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

Getter

func (*RDStorage) NewList

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

Lister

type ResourceInfo

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

type StandardStorage

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

func NewStandardStorage

func NewStandardStorage(cfg ResourceInfo) *StandardStorage

func (*StandardStorage) ConvertToTable

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

func (*StandardStorage) Create

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

func (*StandardStorage) Delete

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

GracefulDeleter

func (*StandardStorage) DeleteCollection

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

CollectionDeleter

func (*StandardStorage) Get

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

func (*StandardStorage) GroupVersionKind

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

func (*StandardStorage) List

func (*StandardStorage) NamespaceScoped

func (r *StandardStorage) NamespaceScoped() bool

func (*StandardStorage) New

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

Getter

func (*StandardStorage) NewList

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

Lister

func (*StandardStorage) Update

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

CreaterUpdater

func (*StandardStorage) Watch

Watcher

type TypeInfo

type TypeInfo struct {
	GroupVersion    schema.GroupVersion
	Resource        string
	Kind            string
	NamespaceScoped bool
}

TypeInfo represents the declaration of a resource.

type VersionResource

type VersionResource struct {
	Version  string
	Resource string
}

VersionResource is the declaration of a version resource.

Jump to

Keyboard shortcuts

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