Documentation ¶
Index ¶
- func RenderOpenAPISpec(cfg Config) (string, error)
- type Config
- type ProxyREST
- func (r *ProxyREST) Connect(_ context.Context, _ string, _ runtime.Object, _ rest.Responder) (http.Handler, error)
- func (r *ProxyREST) ConnectMethods() []string
- func (r *ProxyREST) Destroy()
- func (r *ProxyREST) New() runtime.Object
- func (r *ProxyREST) NewConnectOptions() (runtime.Object, bool, string)
- type ResourceInfo
- type ResourceWithNamespaceScoped
- type StandardREST
- func (r *StandardREST) ConvertToTable(_ context.Context, _ runtime.Object, _ runtime.Object) (*metav1.Table, error)
- func (r *StandardREST) Create(_ context.Context, _ runtime.Object, _ rest.ValidateObjectFunc, ...) (runtime.Object, error)
- func (r *StandardREST) Delete(_ context.Context, _ string, _ rest.ValidateObjectFunc, ...) (runtime.Object, bool, error)
- func (r *StandardREST) DeleteCollection(_ context.Context, _ rest.ValidateObjectFunc, _ *metav1.DeleteOptions, ...) (runtime.Object, error)
- func (r *StandardREST) Destroy()
- func (r *StandardREST) Get(_ context.Context, _ string, _ *metav1.GetOptions) (runtime.Object, error)
- func (r *StandardREST) GetSingularName() string
- func (r *StandardREST) GroupVersionKind(_ schema.GroupVersion) schema.GroupVersionKind
- func (r *StandardREST) List(_ context.Context, _ *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(_ context.Context, _ string, _ rest.UpdatedObjectInfo, ...) (runtime.Object, bool, error)
- func (r *StandardREST) Watch(_ context.Context, _ *metainternalversion.ListOptions) (watch.Interface, error)
- type StatusInfo
- type StatusREST
- func (r *StatusREST) Destroy()
- func (r *StatusREST) Get(_ context.Context, _ string, _ *metav1.GetOptions) (runtime.Object, error)
- func (r *StatusREST) GroupVersionKind(_ schema.GroupVersion) schema.GroupVersionKind
- func (r *StatusREST) New() runtime.Object
- func (r *StatusREST) Update(_ context.Context, _ string, _ 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(_ context.Context, _ string, _ runtime.Object, _ rest.Responder) (http.Handler, error)
Connect implement Connect interface.
func (*ProxyREST) ConnectMethods ¶
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.
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(_ context.Context, _ runtime.Object, _ runtime.Object) (*metav1.Table, error)
ConvertToTable implement ConvertToTable interface.
func (*StandardREST) Create ¶
func (r *StandardREST) Create(_ context.Context, _ runtime.Object, _ rest.ValidateObjectFunc, _ *metav1.CreateOptions) (runtime.Object, error)
Create implement Create interface.
func (*StandardREST) Delete ¶
func (r *StandardREST) Delete(_ context.Context, _ string, _ rest.ValidateObjectFunc, _ *metav1.DeleteOptions) (runtime.Object, bool, error)
Delete implement Delete interface.
func (*StandardREST) DeleteCollection ¶
func (r *StandardREST) DeleteCollection(_ context.Context, _ rest.ValidateObjectFunc, _ *metav1.DeleteOptions, _ *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(_ context.Context, _ string, _ *metav1.GetOptions) (runtime.Object, error)
Get implement Get interface.
func (*StandardREST) GetSingularName ¶ added in v1.7.0
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 ¶
func (r *StandardREST) List(_ context.Context, _ *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(_ context.Context, _ string, _ rest.UpdatedObjectInfo, _ rest.ValidateObjectFunc, _ rest.ValidateObjectUpdateFunc, _ bool, _ *metav1.UpdateOptions) (runtime.Object, bool, error)
Update implement Update interface.
func (*StandardREST) Watch ¶
func (r *StandardREST) Watch(_ context.Context, _ *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) Destroy ¶ added in v1.4.0
func (r *StatusREST) Destroy()
Destroy cleans up its resources on shutdown.
func (*StatusREST) Get ¶
func (r *StatusREST) Get(_ context.Context, _ string, _ *metav1.GetOptions) (runtime.Object, error)
Get retrieves the status object.
func (*StatusREST) GroupVersionKind ¶
func (r *StatusREST) GroupVersionKind(_ schema.GroupVersion) schema.GroupVersionKind
GroupVersionKind implement GroupVersionKind interface.
func (*StatusREST) Update ¶
func (r *StatusREST) Update(_ context.Context, _ string, _ rest.UpdatedObjectInfo, _ rest.ValidateObjectFunc, _ rest.ValidateObjectUpdateFunc, _ bool, _ *metav1.UpdateOptions) (runtime.Object, bool, error)
Update alters the status subset of an object.