interfaces

package
v0.0.0-...-d7ecc2e Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnnotateType

type AnnotateType string
const (
	AnnotateServiceCR      AnnotateType = "annotate svc cr"
	AnnotateServiceCluster AnnotateType = "annotate svc cluster"
	AnnotateServiceShard   AnnotateType = "annotate svc shard"
	AnnotateServiceHost    AnnotateType = "annotate svc host"

	AnnotateExistingPV  AnnotateType = "annotate existing pv"
	AnnotateNewPVC      AnnotateType = "annotate new pvc"
	AnnotateExistingPVC AnnotateType = "annotate existing pvc"

	AnnotatePDB AnnotateType = "annotate pdb"

	AnnotateSTS AnnotateType = "annotate STS"

	AnnotatePodTemplate AnnotateType = "annotate PodTemplate"
)
const (
	AnnotateConfigMapCommon      AnnotateType = "annotate cm common"
	AnnotateConfigMapCommonUsers AnnotateType = "annotate cm common users"
	AnnotateConfigMapHost        AnnotateType = "annotate cm host"
)

type ClusterType

type ClusterType string
const (
	ClusterCHIDefault ClusterType = "chi cluster default"
	ClusterCHKDefault ClusterType = "chk cluster default"
)

type ConfigMapType

type ConfigMapType string
const (
	ConfigMapCommon      ConfigMapType = "common"
	ConfigMapCommonUsers ConfigMapType = "common users"
	ConfigMapHost        ConfigMapType = "host"
	ConfigMapConfig      ConfigMapType = "config"
)

type FilesGroupType

type FilesGroupType string
const (
	FilesGroupCommon FilesGroupType = "FilesGroupType common"
	FilesGroupUsers  FilesGroupType = "FilesGroupType users"
	FilesGroupHost   FilesGroupType = "FilesGroupType host"
)

type HostTemplateType

type HostTemplateType string
const (
	HostTemplateCommon      HostTemplateType = "ht common"
	HostTemplateHostNetwork HostTemplateType = "ht host net"
)

type IAnnotator

type IAnnotator interface {
	Annotate(what AnnotateType, params ...any) map[string]string
}

type IConfigFilesGenerator

type IConfigFilesGenerator interface {
	CreateConfigFiles(what FilesGroupType, params ...any) map[string]string
}

type IConfigMapManager

type IConfigMapManager interface {
	CreateConfigMap(what ConfigMapType, params ...any) *core.ConfigMap
	SetCR(cr api.ICustomResource)
	SetTagger(tagger ITagger)
	SetConfigFilesGenerator(configFilesGenerator IConfigFilesGenerator)
}

type IContainerManager

type IContainerManager interface {
	NewDefaultAppContainer(host *api.Host) core.Container
	GetAppContainer(statefulSet *apps.StatefulSet) (*core.Container, bool)
	EnsureAppContainer(statefulSet *apps.StatefulSet, host *api.Host)
	EnsureLogContainer(statefulSet *apps.StatefulSet)
}

type ICreator

type ICreator interface {
	CreateConfigMap(what ConfigMapType, params ...any) *core.ConfigMap
	CreatePodDisruptionBudget(cluster api.ICluster) *policy.PodDisruptionBudget
	CreatePVC(
		name string,
		namespace string,
		host *api.Host,
		spec *core.PersistentVolumeClaimSpec,
	) *core.PersistentVolumeClaim
	AdjustPVC(
		pvc *core.PersistentVolumeClaim,
		host *api.Host,
		template *api.VolumeClaimTemplate,
	) *core.PersistentVolumeClaim
	CreateClusterSecret(name string) *core.Secret
	CreateService(what ServiceType, params ...any) *core.Service
	CreateStatefulSet(host *api.Host, shutdown bool) *apps.StatefulSet
}

type IEventEmitter

type IEventEmitter interface {
	EventInfo(obj meta.Object, action string, reason string, message string)
	EventWarning(obj meta.Object, action string, reason string, message string)
	EventError(obj meta.Object, action string, reason string, message string)
}

type IKube

type IKube interface {
	CR() IKubeCR
	ConfigMap() IKubeConfigMap
	Deployment() IKubeDeployment
	PDB() IKubePDB
	Event() IKubeEvent
	Pod() IKubePod
	Storage() IKubeStoragePVC
	ReplicaSet() IKubeReplicaSet
	Secret() IKubeSecret
	Service() IKubeService
	STS() IKubeSTS
}

type IKubeCR

type IKubeCR interface {
	Get(ctx context.Context, namespace, name string) (api.ICustomResource, error)
	StatusUpdate(ctx context.Context, cr api.ICustomResource, opts types.UpdateStatusOptions) (err error)
}

type IKubeConfigMap

type IKubeConfigMap interface {
	Create(ctx context.Context, cm *core.ConfigMap) (*core.ConfigMap, error)
	Get(ctx context.Context, namespace, name string) (*core.ConfigMap, error)
	Update(ctx context.Context, cm *core.ConfigMap) (*core.ConfigMap, error)
	Delete(ctx context.Context, namespace, name string) error
	List(ctx context.Context, namespace string, opts meta.ListOptions) ([]core.ConfigMap, error)
}

type IKubeDeployment

type IKubeDeployment interface {
	Get(namespace, name string) (*apps.Deployment, error)
	Update(deployment *apps.Deployment) (*apps.Deployment, error)
}

type IKubeEvent

type IKubeEvent interface {
	Create(ctx context.Context, event *core.Event) (*core.Event, error)
}

type IKubePDB

type IKubePDB interface {
	Create(ctx context.Context, pdb *policy.PodDisruptionBudget) (*policy.PodDisruptionBudget, error)
	Get(ctx context.Context, namespace, name string) (*policy.PodDisruptionBudget, error)
	Update(ctx context.Context, pdb *policy.PodDisruptionBudget) (*policy.PodDisruptionBudget, error)
	Delete(ctx context.Context, namespace, name string) error
	List(ctx context.Context, namespace string, opts meta.ListOptions) ([]policy.PodDisruptionBudget, error)
}

type IKubePVC

type IKubePVC interface {
	Create(ctx context.Context, pvc *core.PersistentVolumeClaim) (*core.PersistentVolumeClaim, error)
	Get(ctx context.Context, namespace, name string) (*core.PersistentVolumeClaim, error)
	Update(ctx context.Context, pvc *core.PersistentVolumeClaim) (*core.PersistentVolumeClaim, error)
	Delete(ctx context.Context, namespace, name string) error
	List(ctx context.Context, namespace string, opts meta.ListOptions) ([]core.PersistentVolumeClaim, error)
	ListForHost(ctx context.Context, host *api.Host) (*core.PersistentVolumeClaimList, error)
}

type IKubePod

type IKubePod interface {
	Get(params ...any) (*core.Pod, error)
	GetAll(obj any) []*core.Pod
	Update(ctx context.Context, pod *core.Pod) (*core.Pod, error)
	Delete(ctx context.Context, namespace, name string) error
}

type IKubeReplicaSet

type IKubeReplicaSet interface {
	Get(ctx context.Context, namespace, name string) (*apps.ReplicaSet, error)
	Update(ctx context.Context, replicaSet *apps.ReplicaSet) (*apps.ReplicaSet, error)
}

type IKubeSTS

type IKubeSTS interface {
	Get(ctx context.Context, params ...any) (*apps.StatefulSet, error)
	Create(ctx context.Context, statefulSet *apps.StatefulSet) (*apps.StatefulSet, error)
	Update(ctx context.Context, sts *apps.StatefulSet) (*apps.StatefulSet, error)
	Delete(ctx context.Context, namespace, name string) error
	List(ctx context.Context, namespace string, opts meta.ListOptions) ([]apps.StatefulSet, error)
}

type IKubeSecret

type IKubeSecret interface {
	Get(ctx context.Context, params ...any) (*core.Secret, error)
	Create(ctx context.Context, svc *core.Secret) (*core.Secret, error)
	Update(ctx context.Context, svc *core.Secret) (*core.Secret, error)
	Delete(ctx context.Context, namespace, name string) error
	List(ctx context.Context, namespace string, opts meta.ListOptions) ([]core.Secret, error)
}

type IKubeService

type IKubeService interface {
	Get(ctx context.Context, params ...any) (*core.Service, error)
	Create(ctx context.Context, svc *core.Service) (*core.Service, error)
	Update(ctx context.Context, svc *core.Service) (*core.Service, error)
	Delete(ctx context.Context, namespace, name string) error
	List(ctx context.Context, namespace string, opts meta.ListOptions) ([]core.Service, error)
}

type IKubeStoragePVC

type IKubeStoragePVC interface {
	IKubePVC
	UpdateOrCreate(ctx context.Context, pvc *core.PersistentVolumeClaim) (*core.PersistentVolumeClaim, error)
}

type ILabeler

type ILabeler interface {
	Label(what LabelType, params ...any) map[string]string
	Selector(what SelectorType, params ...any) map[string]string
	MakeObjectVersion(meta meta.Object, obj interface{})
	GetObjectVersion(meta meta.Object) (string, bool)
	Get(string) string
}

type IMacro

type IMacro interface {
	Get(string) string
	Scope(scope any) IMacro
	Line(line string) string
	Map(_map map[string]string) map[string]string
}

type INameManager

type INameManager interface {
	Names(what NameType, params ...any) []string
	Name(what NameType, params ...any) string
}

type IOwnerReferencesManager

type IOwnerReferencesManager interface {
	CreateOwnerReferences(owner api.ICustomResource) []meta.OwnerReference
}

type IProbeManager

type IProbeManager interface {
	CreateProbe(what ProbeType, host *api.Host) *core.Probe
}

type IServiceManager

type IServiceManager interface {
	CreateService(what ServiceType, params ...any) *core.Service
	SetCR(cr api.ICustomResource)
	SetTagger(tagger ITagger)
}

type ITagger

type ITagger interface {
	Annotate(what AnnotateType, params ...any) map[string]string
	Label(what LabelType, params ...any) map[string]string
	Selector(what SelectorType, params ...any) map[string]string
}

type IVolumeManager

type IVolumeManager interface {
	SetupVolumes(what VolumeType, statefulSet *apps.StatefulSet, host *api.Host)
	SetCR(cr api.ICustomResource)
}

type LabelType

type LabelType string
const (
	LabelConfigMapCommon      LabelType = "Label cm common"
	LabelConfigMapCommonUsers LabelType = "Label cm common users"
	LabelConfigMapHost        LabelType = "Label cm host"
)
const (
	LabelServiceCR      LabelType = "Label svc chi"
	LabelServiceCluster LabelType = "Label svc cluster"
	LabelServiceShard   LabelType = "Label svc shard"
	LabelServiceHost    LabelType = "Label svc host"

	LabelExistingPV  LabelType = "Label existing pv"
	LabelNewPVC      LabelType = "Label new pvc"
	LabelExistingPVC LabelType = "Label existing pvc"

	LabelPDB LabelType = "Label pdb"

	LabelSTS LabelType = "Label STS"

	LabelPodTemplate LabelType = "Label PodTemplate"
)

type NameType

type NameType string
const (
	NameConfigMapHost        NameType = "ConfigMapHost"
	NameConfigMapCommon      NameType = "ConfigMapCommon"
	NameConfigMapCommonUsers NameType = "NameConfigMapCommonUsers"
)
const (
	NameCRService                    NameType = "NameCRService"
	NameCRServiceFQDN                NameType = "NameCRServiceFQDN"
	NameClusterService               NameType = "NameClusterService"
	NameShardService                 NameType = "NameShardService"
	NameShard                        NameType = "NameShard"
	NameReplica                      NameType = "NameReplica"
	NameHost                         NameType = "NameHost"
	NameHostTemplate                 NameType = "NameHostTemplate"
	NameInstanceHostname             NameType = "NameInstanceHostname"
	NameStatefulSet                  NameType = "NameStatefulSet"
	NameStatefulSetService           NameType = "NameStatefulSetService"
	NamePodHostname                  NameType = "NamePodHostname"
	NameFQDN                         NameType = "NameFQDN"
	NameFQDNs                        NameType = "NameFQDNs"
	NamePodHostnameRegexp            NameType = "NamePodHostnameRegexp"
	NamePod                          NameType = "NamePod"
	NamePVCNameByVolumeClaimTemplate NameType = "NamePVCNameByVolumeClaimTemplate"
	NameClusterAutoSecret            NameType = "NameClusterAutoSecret"
)

type ProbeType

type ProbeType string
const (
	ProbeDefaultLiveness  ProbeType = "ProbeDefaultLiveness"
	ProbeDefaultReadiness ProbeType = "ProbeDefaultReadiness"
)

type SelectorType

type SelectorType string
const (
	SelectorCRScope           SelectorType = "SelectorCRScope"
	SelectorCRScopeReady      SelectorType = "SelectorCRScopeReady"
	SelectorClusterScope      SelectorType = "SelectorClusterScope"
	SelectorClusterScopeReady SelectorType = "SelectorClusterScopeReady"
	SelectorShardScopeReady   SelectorType = "SelectorShardScopeReady"
	SelectorHostScope         SelectorType = "getSelectorHostScope"
)

type ServiceType

type ServiceType string
const (
	ServiceCR      ServiceType = "svc chi"
	ServiceCluster ServiceType = "svc cluster"
	ServiceShard   ServiceType = "svc shard"
	ServiceHost    ServiceType = "svc host"
)

type VolumeType

type VolumeType string
const (
	VolumesForConfigMaps          VolumeType = "VolumesForConfigMaps"
	VolumesUserDataWithFixedPaths VolumeType = "VolumesUserDataWithFixedPaths"
)

Jump to

Keyboard shortcuts

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