Documentation ¶
Index ¶
- type Builder
- func (b *Builder) Build() (*corev1.Service, error)
- func (b *Builder) WithAnnotations(annotations map[string]string) *Builder
- func (b *Builder) WithAnnotationsNew(annotations map[string]string) *Builder
- func (b *Builder) WithGenerateName(name string) *Builder
- func (b *Builder) WithLabels(labels map[string]string) *Builder
- func (b *Builder) WithLabelsNew(labels map[string]string) *Builder
- func (b *Builder) WithName(name string) *Builder
- func (b *Builder) WithNamespace(namespace string) *Builder
- func (b *Builder) WithOwnerReferenceNew(ownerRefernce []metav1.OwnerReference) *Builder
- func (b *Builder) WithPorts(ports []corev1.ServicePort) *Builder
- func (b *Builder) WithSelectors(selectors map[string]string) *Builder
- func (b *Builder) WithSelectorsNew(selectors map[string]string) *Builder
- func (b *Builder) WithType(svcType corev1.ServiceType) *Builder
- type Kubeclient
- func (k *Kubeclient) Create(service *corev1.Service) (*corev1.Service, error)
- func (k *Kubeclient) Delete(name string, options *metav1.DeleteOptions) error
- func (k *Kubeclient) Get(name string, opts metav1.GetOptions) (*corev1.Service, error)
- func (k *Kubeclient) GetRaw(name string, opts metav1.GetOptions) ([]byte, error)
- func (k *Kubeclient) List(opts metav1.ListOptions) (*corev1.ServiceList, error)
- func (k *Kubeclient) ListRaw(opts metav1.ListOptions) ([]byte, error)
- func (k *Kubeclient) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (*corev1.Service, error)
- func (k *Kubeclient) Update(service *corev1.Service) (*corev1.Service, error)
- func (k *Kubeclient) WithNamespace(namespace string) *Kubeclient
- type KubeclientBuildOption
- type Predicate
- type Service
- type ServiceList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder is the builder object for Service
func (*Builder) WithAnnotations ¶
WithAnnotations merges existing annotations if any with the ones that are provided here
func (*Builder) WithAnnotationsNew ¶
WithAnnotationsNew resets existing annotaions if any with ones that are provided here
func (*Builder) WithGenerateName ¶
WithGenerateName sets the GenerateName field of Service with provided value
func (*Builder) WithLabels ¶
WithLabels merges existing labels if any with the ones that are provided here
func (*Builder) WithLabelsNew ¶
WithLabelsNew resets existing labels if any with ones that are provided here
func (*Builder) WithNamespace ¶
WithNamespace sets the Namespace field of Service provided arguments
func (*Builder) WithOwnerReferenceNew ¶
func (b *Builder) WithOwnerReferenceNew(ownerRefernce []metav1.OwnerReference) *Builder
WithOwnerReferenceNew sets ownerrefernce if any with ones that are provided here
func (*Builder) WithPorts ¶
func (b *Builder) WithPorts(ports []corev1.ServicePort) *Builder
WithPorts sets the Ports field of Service with provided arguments
func (*Builder) WithSelectors ¶
WithSelectors merges existing selectors if any with the ones that are provided here
func (*Builder) WithSelectorsNew ¶
WithSelectorsNew resets existing selectors if any with ones that are provided here
type Kubeclient ¶
type Kubeclient struct {
// contains filtered or unexported fields
}
Kubeclient enables kubernetes API operations on service instance
func NewKubeClient ¶
func NewKubeClient(opts ...KubeclientBuildOption) *Kubeclient
NewKubeClient returns a new instance of kubeclient meant for service, caller can configure it with different kubeclientBuildOption
func (*Kubeclient) Delete ¶
func (k *Kubeclient) Delete(name string, options *metav1.DeleteOptions) error
Delete returns service object for given name
func (*Kubeclient) Get ¶
func (k *Kubeclient) Get(name string, opts metav1.GetOptions) ( *corev1.Service, error)
Get returns service object for given name
func (*Kubeclient) GetRaw ¶
func (k *Kubeclient) GetRaw(name string, opts metav1.GetOptions) ( []byte, error)
GetRaw returns service object for given name in byte format
func (*Kubeclient) List ¶
func (k *Kubeclient) List(opts metav1.ListOptions) ( *corev1.ServiceList, error)
List returns list of services
func (*Kubeclient) ListRaw ¶
func (k *Kubeclient) ListRaw(opts metav1.ListOptions) ([]byte, error)
ListRaw returns list of services in byte format
func (*Kubeclient) Patch ¶
func (k *Kubeclient) Patch( name string, pt types.PatchType, data []byte, subresources ...string, ) (*corev1.Service, error)
Patch patches service object for given name
func (*Kubeclient) WithNamespace ¶
func (k *Kubeclient) WithNamespace(namespace string) *Kubeclient
WithNamespace set namespace in kubeclient object
type KubeclientBuildOption ¶
type KubeclientBuildOption func(*Kubeclient)
KubeclientBuildOption defines the abstraction to build a kubeclient instance
func WithClientset ¶
func WithClientset(c *kubernetes.Clientset) KubeclientBuildOption
WithClientset sets the kubernetes client against the kubeclient instance
func WithKubeConfigPath ¶
func WithKubeConfigPath(path string) KubeclientBuildOption
WithKubeConfigPath sets the kubeConfig path against client instance
func WithNamespace ¶
func WithNamespace(namespace string) KubeclientBuildOption
WithNamespace set namespace in kubeclient object
type Predicate ¶
Predicate defines an abstraction to determine conditional checks against the provided service instance
func ContainsName ¶
ContainsName is filter function to filter service's based on the name
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is a wrapper over service api object. It provides build, validations and other common logic to be used by various feature specific callers.
func NewForAPIObject ¶
NewForAPIObject returns a new instance of Service
type ServiceList ¶
type ServiceList struct {
// contains filtered or unexported fields
}
ServiceList is a wrapper over service api object. It provides build, validations and other common logic to be used by various feature specific callers.
func (*ServiceList) Len ¶
func (s *ServiceList) Len() int
Len returns the number of items present in the ServiceList
func (*ServiceList) ToAPIList ¶
func (s *ServiceList) ToAPIList() *corev1.ServiceList
ToAPIList converts ServiceList to API ServiceList