Documentation
¶
Index ¶
- Variables
- func ExtractRawToMap(fieldName string, raw []byte) (map[string]interface{}, error)
- func FromUnstructured(obj *unstructured.Unstructured, v interface{}) error
- func ToJson(obj runtime.Object) (gqlschema.JSON, error)
- func ToStringPtr(val interface{}) *string
- func ToUnstructured(v interface{}) (*unstructured.Unstructured, error)
- type Appendable
- type Converter
- type EventHandler
- type EventHandlerProvider
- type GenericService
- func (s *GenericService) Delete(name string, res runtime.Object) error
- func (s *GenericService) DeleteInNamespace(namespace, name string, res runtime.Object) error
- func (s *GenericService) Get(name string, result interface{}) error
- func (s *GenericService) GetInNamespace(name, namespace string, result interface{}) error
- func (s *GenericService) List(result Appendable) error
- func (s *GenericService) ListInNamespace(namespace string, result Appendable) error
- func (s *GenericService) UpdateInNamespace(name, namespace string, result interface{}, update func() error) error
- type GenericServiceFactory
- type Listener
- type Module
- type Notifier
- type Service
- type ServiceBase
- type ServiceCreator
- type ServiceCreators
- type ServiceFactory
- type Unsubscribe
Constants ¶
This section is empty.
Variables ¶
View Source
var NotFound = fmt.Errorf("resource not found")
Functions ¶
func ExtractRawToMap ¶
func FromUnstructured ¶
func FromUnstructured(obj *unstructured.Unstructured, v interface{}) error
func ToStringPtr ¶
func ToStringPtr(val interface{}) *string
func ToUnstructured ¶
func ToUnstructured(v interface{}) (*unstructured.Unstructured, error)
Types ¶
type Appendable ¶
type Appendable interface {
Append() interface{}
}
type EventHandler ¶
type EventHandler interface { K8sResource() interface{} ShouldNotify() bool Notify(gqlschema.SubscriptionEventType) }
type EventHandlerProvider ¶
type EventHandlerProvider func() EventHandler
type GenericService ¶
type GenericService struct {
ServiceBase
}
func (*GenericService) Delete ¶
func (s *GenericService) Delete(name string, res runtime.Object) error
func (*GenericService) DeleteInNamespace ¶
func (s *GenericService) DeleteInNamespace(namespace, name string, res runtime.Object) error
func (*GenericService) Get ¶
func (s *GenericService) Get(name string, result interface{}) error
func (*GenericService) GetInNamespace ¶
func (s *GenericService) GetInNamespace(name, namespace string, result interface{}) error
func (*GenericService) List ¶
func (s *GenericService) List(result Appendable) error
func (*GenericService) ListInNamespace ¶
func (s *GenericService) ListInNamespace(namespace string, result Appendable) error
func (*GenericService) UpdateInNamespace ¶
func (s *GenericService) UpdateInNamespace(name, namespace string, result interface{}, update func() error) error
type GenericServiceFactory ¶
type GenericServiceFactory struct { Client dynamic.Interface InformerFactory dynamicinformer.DynamicSharedInformerFactory }
func NewGenericServiceFactory ¶
func NewGenericServiceFactory(client dynamic.Interface, informerFactory dynamicinformer.DynamicSharedInformerFactory) *GenericServiceFactory
func (*GenericServiceFactory) ForResource ¶
func (f *GenericServiceFactory) ForResource(gvr schema.GroupVersionResource) *GenericService
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
func NewListener ¶
func NewListener(handler EventHandlerProvider) *Listener
type Module ¶
func NewModule ¶
func NewModule(name string, factory *GenericServiceFactory, serviceCreators ServiceCreators) *Module
func (*Module) Service ¶
func (m *Module) Service(gvr schema.GroupVersionResource) *GenericService
type Notifier ¶
func NewNotifier ¶
func NewNotifier() *Notifier
func (*Notifier) AddListener ¶
func (*Notifier) DeleteListener ¶
type Service ¶
type Service struct { Client dynamic.NamespaceableResourceInterface Informer cache.SharedIndexInformer // contains filtered or unexported fields }
func (*Service) FindInNamespace ¶
func (*Service) ListInIndex ¶
type ServiceBase ¶
type ServiceBase interface { ListByIndex(index, key string, result Appendable) error GetByKey(key string, result interface{}) error AddIndexers(indexers cache.Indexers) error Create(obj interface{}, result interface{}) error Apply(obj interface{}, result interface{}) error GVR() schema.GroupVersionResource DeleteInNamespace(name, namespace string) error Delete(name string) error Subscribe(handler EventHandlerProvider) (Unsubscribe, error) }
type ServiceCreator ¶
type ServiceCreator func(factory *GenericServiceFactory) (*GenericService, error)
type ServiceCreators ¶
type ServiceCreators map[schema.GroupVersionResource]ServiceCreator
type ServiceFactory ¶
type ServiceFactory struct { Client dynamic.Interface InformerFactory dynamicinformer.DynamicSharedInformerFactory }
func NewServiceFactory ¶
func NewServiceFactory(client dynamic.Interface, informerFactory dynamicinformer.DynamicSharedInformerFactory) *ServiceFactory
func (*ServiceFactory) ForResource ¶
func (f *ServiceFactory) ForResource(gvr schema.GroupVersionResource) *Service
type Unsubscribe ¶
type Unsubscribe func()
Source Files
¶
Click to show internal directories.
Click to hide internal directories.