Documentation ¶
Index ¶
- func RenderOpenAPISpec(cfg Config) (string, error)
- type Config
- type ProxyREST
- type ResourceInfo
- type ResourceWithNamespaceScoped
- type StandardREST
- func (r *StandardREST) ConvertToTable(ctx context.Context, object runtime.Object, tableOptions runtime.Object) (*metav1.Table, error)
- func (r *StandardREST) Create(ctx context.Context, obj runtime.Object, ...) (runtime.Object, error)
- func (r *StandardREST) Delete(ctx context.Context, name string, deleteValidation rest.ValidateObjectFunc, ...) (runtime.Object, bool, error)
- func (r *StandardREST) DeleteCollection(ctx context.Context, deleteValidation rest.ValidateObjectFunc, ...) (runtime.Object, error)
- func (r *StandardREST) Get(ctx context.Context, name string, options *metav1.GetOptions) (runtime.Object, error)
- func (r *StandardREST) GroupVersionKind(containingGV schema.GroupVersion) schema.GroupVersionKind
- func (r *StandardREST) List(ctx context.Context, options *metainternalversion.ListOptions) (runtime.Object, error)
- func (r *StandardREST) NamespaceScoped() bool
- func (r *StandardREST) New() runtime.Object
- func (r *StandardREST) NewList() runtime.Object
- func (r *StandardREST) Update(ctx context.Context, name string, objInfo rest.UpdatedObjectInfo, ...) (runtime.Object, bool, error)
- func (r *StandardREST) Watch(ctx context.Context, options *metainternalversion.ListOptions) (watch.Interface, error)
- type StatusInfo
- type StatusREST
- func (r *StatusREST) Get(ctx context.Context, name string, options *metav1.GetOptions) (runtime.Object, error)
- func (r *StatusREST) GroupVersionKind(containingGV schema.GroupVersion) schema.GroupVersionKind
- func (r *StatusREST) New() runtime.Object
- func (r *StatusREST) Update(ctx context.Context, name string, objInfo rest.UpdatedObjectInfo, ...) (runtime.Object, bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenderOpenAPISpec ¶
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 ¶
ConnectMethods returns the list of HTTP methods handled by Connect.
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) 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 ¶
func (r *StandardREST) List(ctx context.Context, options *metainternalversion.ListOptions) (runtime.Object, error)
List implement List interface.
func (*StandardREST) NamespaceScoped ¶
func (r *StandardREST) NamespaceScoped() bool
NamespaceScoped implement NamespaceScoped 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 ¶
func (r *StandardREST) Watch(ctx context.Context, options *metainternalversion.ListOptions) (watch.Interface, error)
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) 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) 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.