Documentation ¶
Index ¶
- func GetNestedString(obj map[string]interface{}, fields ...string) string
- type Builder
- type CreateFn
- type CreateOption
- type CreateOptionFn
- type DeleteFn
- type DeleteOption
- type DeleteOptionFn
- type GetFn
- type GetOption
- type GetOptionFn
- type Kubeclient
- func (k *Kubeclient) Create(u *unstructured.Unstructured, opts ...CreateOptionFn) error
- func (k *Kubeclient) CreateAllOrNone(u ...*unstructured.Unstructured) []error
- func (k *Kubeclient) Delete(u *unstructured.Unstructured, opts ...DeleteOptionFn) error
- func (k *Kubeclient) DeleteAll(u ...*unstructured.Unstructured) []error
- func (k *Kubeclient) Get(name string, opts ...GetOptionFn) (*unstructured.Unstructured, error)
- type KubeclientBuildOption
- type ListBuilder
- type Unstruct
- type UnstructList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetNestedString ¶
GetNestedString returns the string value of a nested field.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder enables building of an Unstructured instance
func BuilderForObject ¶
func BuilderForObject(obj *unstructured.Unstructured) *Builder
BuilderForObject returns a new instance of Unstruct Builder by making use of the provided object
func BuilderForYaml ¶
BuilderForYaml returns a new instance of Unstruct Builder by making use of the provided YAML
func (*Builder) BuildAPIUnstructured ¶
func (b *Builder) BuildAPIUnstructured() (*unstructured.Unstructured, error)
BuildAPIUnstructured returns the Unstruct object created by the Builder
type CreateFn ¶
type CreateFn func( cli dynamic.Interface, obj *unstructured.Unstructured, opts *CreateOption, ) (*unstructured.Unstructured, error)
CreateFn is a typed function that abstracts creating of unstructured object
type CreateOption ¶
type CreateOption struct { *metav1.CreateOptions // contains filtered or unexported fields }
CreateOption holds the kubernetes option to create a resource
func NewCreateOption ¶
func NewCreateOption(cOpts ...CreateOptionFn) *CreateOption
NewCreateOption returns a new instance of CreateOption
type CreateOptionFn ¶
type CreateOptionFn func(*CreateOption)
CreateOptionFn abstracts the construction of CreateOption
func WithCreateOption ¶
func WithCreateOption(opt metav1.CreateOptions) CreateOptionFn
WithCreateOption is CreateOptionFn to provide kubernetes createOption for creating a resource
func WithCreateSubResources ¶
func WithCreateSubResources(r ...string) CreateOptionFn
WithCreateSubResources is CreateOptionFn to kubernetes subresources during resource creation
type DeleteFn ¶
type DeleteFn func( cli dynamic.Interface, obj *unstructured.Unstructured, opt *DeleteOption, ) error
DeleteFn is a typed function that abstract deletion of unstructured object
type DeleteOption ¶
type DeleteOption struct { *metav1.DeleteOptions // contains filtered or unexported fields }
DeleteOption holds kubernetes options to delete a resource
func NewDeleteOption ¶
func NewDeleteOption(dOpts ...DeleteOptionFn) *DeleteOption
NewDeleteOption returns a new instance of DeleteOption
type DeleteOptionFn ¶
type DeleteOptionFn func(*DeleteOption)
DeleteOptionFn abstracts the construvtion of delete option
func WithDeleteOption ¶
func WithDeleteOption(deleteOpt *metav1.DeleteOptions) DeleteOptionFn
WithDeleteOption is a DeleteOptionFn to provide kubernetes delete option
func WithDeleteSubResources ¶
func WithDeleteSubResources(r ...string) DeleteOptionFn
WithDeleteSubResources is a DeleteOptionFn to provide subresources during delete
type GetFn ¶
type GetFn func( cli dynamic.Interface, name string, namespace string, opt *GetOption, ) (*unstructured.Unstructured, error)
GetFn is a typed function that abstracts fetching of unstructured object
type GetOption ¶
type GetOption struct { *metav1.GetOptions // contains filtered or unexported fields }
GetOption holds the kubernetes options to get a resource
func NewGetOption ¶
func NewGetOption(gOpts ...GetOptionFn) *GetOption
NewGetOption returns a new instance of GetOption
type GetOptionFn ¶
type GetOptionFn func(*GetOption)
GetOptionFn abstracts the construction of GetOption
func WithGetNamespace ¶
func WithGetNamespace(namespace string) GetOptionFn
WithGetNamespace is a GetOptionFn to provide namespace
func WithGetOption ¶
func WithGetOption(getOption metav1.GetOptions) GetOptionFn
WithGetOption is a GetOptionsFn to provide kubernetes getoption
func WithGetSubResources ¶
func WithGetSubResources(r ...string) GetOptionFn
WithGetSubResources is a GetOptionFn to provide subresources
func WithGroupVersionResource ¶
func WithGroupVersionResource(r schema.GroupVersionResource) GetOptionFn
WithGroupVersionResource is a GetOptionFn to provide GroupResourceVersion
type Kubeclient ¶
type Kubeclient struct {
// contains filtered or unexported fields
}
Kubeclient enables kubernetes API operations on catalog instance
func NewKubeClient ¶
func NewKubeClient(opts ...KubeclientBuildOption) *Kubeclient
NewKubeClient returns a new instance of Kubeclient meant for catalog operations
func (*Kubeclient) Create ¶
func (k *Kubeclient) Create(u *unstructured.Unstructured, opts ...CreateOptionFn) error
Create creates an unstructured instance at kubernetes cluster
func (*Kubeclient) CreateAllOrNone ¶
func (k *Kubeclient) CreateAllOrNone(u ...*unstructured.Unstructured) []error
CreateAllOrNone creates all the provided unstructured instances at kubernetes cluster or none in case of any error
func (*Kubeclient) Delete ¶
func (k *Kubeclient) Delete(u *unstructured.Unstructured, opts ...DeleteOptionFn) error
Delete deletes the unstructured instance from kubernetes cluster
func (*Kubeclient) DeleteAll ¶
func (k *Kubeclient) DeleteAll(u ...*unstructured.Unstructured) []error
DeleteAll deletes all the provided unstructured instances at kubernetes cluster
func (*Kubeclient) Get ¶
func (k *Kubeclient) Get(name string, opts ...GetOptionFn) (*unstructured.Unstructured, error)
Get returns an unstructured instance from kubernetes cluster
type KubeclientBuildOption ¶
type KubeclientBuildOption func(*Kubeclient)
KubeclientBuildOption defines the abstraction to build a Kubeclient instance
func WithClient ¶
func WithClient(c dynamic.Interface) KubeclientBuildOption
WithClient sets the kubernetes client against the Kubeclient instance
func WithKubeConfigPath ¶
func WithKubeConfigPath(kubeConfigPath string) KubeclientBuildOption
WithKubeConfigPath sets kubeconfig path against this client instance
type ListBuilder ¶
type ListBuilder struct {
// contains filtered or unexported fields
}
ListBuilder enables building a list of an Unstruct instance
func ListBuilderForObjects ¶
func ListBuilderForObjects(objs ...*unstructured.Unstructured) *ListBuilder
ListBuilderForObjects returns a mew instance of list Unstruct Builder by making use of the provided Unstructured object
func ListBuilderForYamls ¶
func ListBuilderForYamls(yamls ...string) *ListBuilder
ListBuilderForYamls returns a new instance of list Unstruct Builder by making use of the provided YAMLs
func (*ListBuilder) Build ¶
func (l *ListBuilder) Build() ([]*Unstruct, error)
Build returns the list of Unstruct objects created by the Builder
type Unstruct ¶
type Unstruct struct {
Object *unstructured.Unstructured
}
Unstruct holds an object of Unstructured
func (*Unstruct) GetUnstructured ¶
func (u *Unstruct) GetUnstructured() *unstructured.Unstructured
GetUnstructured converts Unstruct object to API's Unstructured
type UnstructList ¶
type UnstructList struct {
Items []*Unstruct
}
UnstructList contains a list of Unstructured items
func FromURL ¶
func FromURL(url string) (UnstructList, error)
FromURL provides the unstructured objects from given url