object

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchCronjobs

func FetchCronjobs(ctx context.Context, Client client.Client, includeRef, excludeRef, namespace string) (*batchv1.CronJobList, error)

func FetchDeployments

func FetchDeployments(ctx context.Context, Client client.Client, includeRef, excludeRef, namespace string) (*appsv1.DeploymentList, error)

func FetchReplicaSets

func FetchReplicaSets(ctx context.Context, Client client.Client, includeRef, excludeRef, namespace string) (*appsv1.ReplicaSetList, error)

func FetchStatefulsets

func FetchStatefulsets(ctx context.Context, Client client.Client, includeRef, excludeRef, namespace string) (*appsv1.StatefulSetList, error)

func GetCronjob

func GetCronjob(ctx context.Context, Client client.Client, resource StatusResource) (*batchv1.CronJob, error)

func GetCronjobListNames

func GetCronjobListNames(objects *batchv1.CronJobList) []string

func GetDeployment

func GetDeployment(ctx context.Context, Client client.Client, resource ReplicaResource) (*appsv1.Deployment, error)

func GetDeploymentListNames

func GetDeploymentListNames(objects *appsv1.DeploymentList) []string

func GetReplicaSet

func GetReplicaSet(ctx context.Context, Client client.Client, resource ReplicaResource) (*appsv1.ReplicaSet, error)

func GetReplicaSetListNames

func GetReplicaSetListNames(objects *appsv1.ReplicaSetList) []string

func GetStatefulSet

func GetStatefulSet(ctx context.Context, Client client.Client, resource ReplicaResource) (*appsv1.StatefulSet, error)

func GetStatefulsetListNames

func GetStatefulsetListNames(objects *appsv1.StatefulSetList) []string

Types

type Object

type Object struct {
	Client     client.Client
	IncludeRef string
	ExcludeRef string
	Namespace  string
}

func NewObject

func NewObject(Client client.Client, includeRef, excludeRef, namespace string) Object

type ReplicaResource

type ReplicaResource struct {
	Resource
	ResourceReplicas int32 `json:"replicas"`
}

func NewReplicaResource

func NewReplicaResource(resourceKind, resourceName, resourceNamespace string, resourceReplica int32) ReplicaResource

func (ReplicaResource) AddToList

func (o ReplicaResource) AddToList(replicasMap ReplicaResourceMap)

func (ReplicaResource) GetName

func (o ReplicaResource) GetName() string

func (ReplicaResource) GetNamespace

func (o ReplicaResource) GetNamespace() string

func (ReplicaResource) PutToSleep

func (o ReplicaResource) PutToSleep(ctx context.Context, Client client.Client) []string

func (ReplicaResource) Sleep

func (o ReplicaResource) Sleep(ctx context.Context, Client client.Client) (int32, error)

func (ReplicaResource) UpdateClient

func (o ReplicaResource) UpdateClient(ctx context.Context, Client client.Client) error

func (ReplicaResource) Wake

func (o ReplicaResource) Wake(ctx context.Context, Client client.Client) error

type ReplicaResourceMap

type ReplicaResourceMap struct {
	Items map[string][]ReplicaResource
}

func NewReplicaResourceMap

func NewReplicaResourceMap() ReplicaResourceMap

func (ReplicaResourceMap) CastItems

func (rm ReplicaResourceMap) CastItems(kind string) []ResourceInt

func (ReplicaResourceMap) GetLength

func (rm ReplicaResourceMap) GetLength(itemName string) int

type Resource

type Resource struct {
	ResourceName      string `json:"name"`
	ResourceKind      string `json:"kind"`
	ResourceNamespace string `json:"namespace"`
}

type ResourceInt

type ResourceInt interface {
	PutToSleep(ctx context.Context, Client client.Client) []string
	UpdateClient(ctx context.Context, Client client.Client) error
	Wake(ctx context.Context, Client client.Client) error
	GetName() string
	GetNamespace() string
}

func CastReplicaToGeneral

func CastReplicaToGeneral(resource []ReplicaResource) []ResourceInt

func CastStatusToGeneral

func CastStatusToGeneral(resource []StatusResource) []ResourceInt

type ResourceMap

type ResourceMap interface {
	GetLength(itemName string) int
	CastItems(kind string) []ResourceInt
}

type StatusResource

type StatusResource struct {
	Resource
	ResourceStatus *bool `json:"suspended"`
}

func NewStatusResource

func NewStatusResource(resourceKind, resourceName, resourceNamespace string, resourceStatus bool) StatusResource

func (StatusResource) AddToList

func (o StatusResource) AddToList(statusMap StatusResourceMap)

func (StatusResource) GetName

func (o StatusResource) GetName() string

func (StatusResource) GetNamespace

func (o StatusResource) GetNamespace() string

func (StatusResource) PutToSleep

func (o StatusResource) PutToSleep(ctx context.Context, Client client.Client) []string

func (StatusResource) Sleep

func (o StatusResource) Sleep(ctx context.Context, Client client.Client) (*bool, error)

func (StatusResource) UpdateClient

func (o StatusResource) UpdateClient(ctx context.Context, Client client.Client) error

func (StatusResource) Wake

func (o StatusResource) Wake(ctx context.Context, Client client.Client) error

type StatusResourceMap

type StatusResourceMap struct {
	Items map[string][]StatusResource
}

func NewStatusResourceMap

func NewStatusResourceMap() StatusResourceMap

func (StatusResourceMap) CastItems

func (rm StatusResourceMap) CastItems(kind string) []ResourceInt

func (StatusResourceMap) GetLength

func (rm StatusResourceMap) GetLength(itemName string) int

Jump to

Keyboard shortcuts

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