service

package
v0.0.0-...-4786a4a Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IResourceService

type IResourceService interface {
	Get(namespace, name string) (*UnstructuredExtend, error)
	List(namespace string, selector string) (*UnstructuredListExtend, error)
	Apply(namespace, name string, unstructuredExtend *UnstructuredExtend) (*UnstructuredExtend, bool, error)
}

type Interface

type Interface interface {
	ApplyGVR(namespace, name string, gvr *schema.GroupVersionResource, unstructuredExtend *UnstructuredExtend) (*UnstructuredExtend, bool, error)
	ListGVR(namespace string, gvr schema.GroupVersionResource, selector string) (*UnstructuredListExtend, error)
	List(namespace string, resource k8s.ResourceType, selector string) (*UnstructuredListExtend, error)
	ListLimit(namespace string, resourceType k8s.ResourceType, flag string, pos, size int64, selector string) (*UnstructuredListExtend, error)
	Get(namespace string, resource k8s.ResourceType, name string, subresources ...string) (*UnstructuredExtend, error)
	Apply(namespace string, resource k8s.ResourceType, name string, unstructuredExtend *UnstructuredExtend) (*UnstructuredExtend, bool, error)
	ForceUpdate(namespace string, resource k8s.ResourceType, name string, unstructuredExtend *UnstructuredExtend) (*UnstructuredExtend, error)
	Delete(namespace string, resource k8s.ResourceType, name string) error
	Watch(namespace string, resource k8s.ResourceType, resourceVersion string, selector string) (<-chan watch.Event, error)
	Patch(namespace string, resource k8s.ResourceType, name string, data []byte) (*UnstructuredExtend, error)
	RESETClient() rest.Interface
	ClientSet() *kubernetes.Clientset
	DiscoveryClient() *discovery.DiscoveryClient
	Install(k8s.ResourceType, IResourceService)
}

type ObjectPatcher

type ObjectPatcher interface {
	Set(path string, value interface{}) error
	Get(path string) (value interface{}, err error)
}

type Service

type Service struct {
	k8s.Interface
	// contains filtered or unexported fields
}

func NewService

func NewService(k8sInterface k8s.Interface) *Service

func (*Service) Apply

func (s *Service) Apply(namespace string, resource k8s.ResourceType, name string, unstructuredExtend *UnstructuredExtend) (*UnstructuredExtend, bool, error)

func (*Service) ApplyGVR

func (s *Service) ApplyGVR(namespace, name string, gvr *schema.GroupVersionResource, unstructuredExtend *UnstructuredExtend) (*UnstructuredExtend, bool, error)

func (*Service) DiscoveryClient

func (s *Service) DiscoveryClient() *discovery.DiscoveryClient

func (*Service) ForceUpdate

func (s *Service) ForceUpdate(namespace string, resource k8s.ResourceType, name string, unstructuredExtend *UnstructuredExtend) (*UnstructuredExtend, error)

func (*Service) Get

func (s *Service) Get(namespace string, resource k8s.ResourceType, name string, subresources ...string) (*UnstructuredExtend, error)

func (*Service) Install

func (s *Service) Install(resourceType k8s.ResourceType, r IResourceService)

func (*Service) List

func (s *Service) List(namespace string, resource k8s.ResourceType, selector string) (*UnstructuredListExtend, error)

func (*Service) ListGVR

func (s *Service) ListGVR(namespace string, gvr schema.GroupVersionResource, selector string) (*UnstructuredListExtend, error)

func (*Service) ListLimit

func (s *Service) ListLimit(namespace string, resourceType k8s.ResourceType, flag string, pos, size int64, selector string) (*UnstructuredListExtend, error)

func (*Service) Patch

func (s *Service) Patch(namespace string, resource k8s.ResourceType, name string, data []byte) (*UnstructuredExtend, error)

func (*Service) RESETClient

func (s *Service) RESETClient() rest.Interface

func (*Service) Watch

func (s *Service) Watch(namespace string, resource k8s.ResourceType, resourceVersion string, selector string) (<-chan watch.Event, error)

type UnstructuredExtend

type UnstructuredExtend struct {
	*unstructured.Unstructured
}

func (*UnstructuredExtend) Get

func (u *UnstructuredExtend) Get(path string) (interface{}, error)

u.Get("metadata.name")

func (*UnstructuredExtend) Set

func (u *UnstructuredExtend) Set(path string, value interface{}) error

u.Set("metadata.labels","abc","merge/replace")

type UnstructuredListExtend

type UnstructuredListExtend struct {
	*unstructured.UnstructuredList
}

func (*UnstructuredListExtend) Get

func (ul *UnstructuredListExtend) Get(path string) (interface{}, error)

ul.Get("0.metadata.labels","abc")

func (*UnstructuredListExtend) Set

func (ul *UnstructuredListExtend) Set(path string, value interface{}) error

ul.Set("0.metadata.labels","abc")

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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