v1alpha1

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2020 License: Apache-2.0 Imports: 8 Imported by: 6

Documentation

Index

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 NewBuilder

func NewBuilder() *Builder

NewBuilder returns new instance of Builder

func (*Builder) Build

func (b *Builder) Build() (*corev1.Service, error)

Build returns the Service API instance

func (*Builder) WithAnnotations

func (b *Builder) WithAnnotations(annotations map[string]string) *Builder

WithAnnotations merges existing annotations if any with the ones that are provided here

func (*Builder) WithAnnotationsNew

func (b *Builder) WithAnnotationsNew(annotations map[string]string) *Builder

WithAnnotationsNew resets existing annotaions if any with ones that are provided here

func (*Builder) WithGenerateName

func (b *Builder) WithGenerateName(name string) *Builder

WithGenerateName sets the GenerateName field of Service with provided value

func (*Builder) WithLabels

func (b *Builder) WithLabels(labels map[string]string) *Builder

WithLabels merges existing labels if any with the ones that are provided here

func (*Builder) WithLabelsNew

func (b *Builder) WithLabelsNew(labels map[string]string) *Builder

WithLabelsNew resets existing labels if any with ones that are provided here

func (*Builder) WithName

func (b *Builder) WithName(name string) *Builder

WithName sets the Name field of Service with provided value.

func (*Builder) WithNamespace

func (b *Builder) WithNamespace(namespace string) *Builder

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

func (b *Builder) WithSelectors(selectors map[string]string) *Builder

WithSelectors merges existing selectors if any with the ones that are provided here

func (*Builder) WithSelectorsNew

func (b *Builder) WithSelectorsNew(selectors map[string]string) *Builder

WithSelectorsNew resets existing selectors if any with ones that are provided here

func (*Builder) WithType

func (b *Builder) WithType(svcType corev1.ServiceType) *Builder

WithType sets the Type field of Service with provided arguments

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) Create

func (k *Kubeclient) Create(service *corev1.Service) (*corev1.Service, error)

Create creates a service in specified namespace in kubernetes cluster

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) Update

func (k *Kubeclient) Update(service *corev1.Service) (*corev1.Service, error)

Update updates a service in specified namespace in kubernetes cluster

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

type Predicate func(*Service) bool

Predicate defines an abstraction to determine conditional checks against the provided service instance

func ContainsName

func ContainsName(name string) Predicate

ContainsName is filter function to filter service's based on the name

func IsNil

func IsNil() Predicate

IsNil is predicate to filter out nil Service instances

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

func NewForAPIObject(obj *corev1.Service,
	opts ...serviceBuildOption) *Service

NewForAPIObject returns a new instance of Service

func (*Service) IsNil

func (s *Service) IsNil() bool

IsNil returns true if the Service instance is nil

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

Jump to

Keyboard shortcuts

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