Documentation ¶
Index ¶
- Constants
- func FindContainer(containers []apiv1.Container, name string) *apiv1.Container
- func GetConfigMapName(nats v1alpha1.NATS) string
- func GetDestinationRuleGVR() schema.GroupVersionResource
- func GetDestinationRuleName(nats v1alpha1.NATS) string
- func GetFreePort() (int, error)
- func GetPodDisruptionBudgetName(nats v1alpha1.NATS) string
- func GetRandK8sName(length int) string
- func GetRandString(length int) string
- func GetSecretName(nats v1alpha1.NATS) string
- func GetServiceName(nats v1alpha1.NATS) string
- func GetStatefulSetName(nats v1alpha1.NATS) string
- func NewDestinationRuleCRD() *apiextensionsv1.CustomResourceDefinition
- func NewLogger() (*zap.Logger, error)
- func NewNATSCR(opts ...NATSOption) *v1alpha1.NATS
- func NewNATSStatefulSetUnStruct(opts ...Option) *unstructured.Unstructured
- func NewNamespace(name string) *apiv1.Namespace
- func NewPVC(name, namespace string, labels map[string]string) *apiv1.PersistentVolumeClaim
- func NewSecret(opts ...Option) *apiv1.Secret
- func NewSecretUnStruct(opts ...Option) *unstructured.Unstructured
- func NewStatefulSet(name, namespace string, labels map[string]string) *appsv1.StatefulSet
- func NewSugaredLogger() (*zap.SugaredLogger, error)
- type NATSOption
- func WithNATSAnnotations(annotations map[string]string) NATSOption
- func WithNATSCRDefaults() NATSOption
- func WithNATSCRFinalizer(finalizer string) NATSOption
- func WithNATSCRName(name string) NATSOption
- func WithNATSCRNamespace(namespace string) NATSOption
- func WithNATSCRStatusInitialized() NATSOption
- func WithNATSClusterSize(size int) NATSOption
- func WithNATSEmptySpec() NATSOption
- func WithNATSFileStorage(fileStorage v1alpha1.FileStorage) NATSOption
- func WithNATSLabels(labels map[string]string) NATSOption
- func WithNATSLogging(debug, trace bool) NATSOption
- func WithNATSMemStorage(memStorage v1alpha1.MemStorage) NATSOption
- func WithNATSResources(resources corev1.ResourceRequirements) NATSOption
- func WithNATSStateError() NATSOption
- func WithNATSStateProcessing() NATSOption
- func WithNATSStateReady() NATSOption
- type Option
- func WithName(name string) Option
- func WithNamespace(namespace string) Option
- func WithSpecReplicas(replicas int) Option
- func WithStatefulSetStatusCurrentReplicas(replicas int) Option
- func WithStatefulSetStatusReadyReplicas(replicas int) Option
- func WithStatefulSetStatusUpdatedReplicas(replicas int) Option
Constants ¶
View Source
const ( NameFormat = "name-%s" NamespaceFormat = "namespace-%s" StatefulSetNameFormat = "%s-nats" ConfigMapNameFormat = "%s-nats-config" SecretNameFormat = "%s-nats-secret" //nolint:gosec // only for test purpose ServiceNameFormat = "%s-nats" PodDisruptionBudgetNameFormat = "%s-nats" DestinationRuleNameFormat = "%s-nats" )
Variables ¶
This section is empty.
Functions ¶
func GetConfigMapName ¶
func GetDestinationRuleGVR ¶
func GetDestinationRuleGVR() schema.GroupVersionResource
func GetDestinationRuleName ¶
func GetFreePort ¶
GetFreePort determines a free port on the host. It does so by delegating the job to net.ListenTCP. Then providing a port of 0 to net.ListenTCP, it will automatically choose a port for us.
func GetPodDisruptionBudgetName ¶ added in v0.1.0
func GetRandK8sName ¶
GetRandK8sName returns a valid name for K8s objects.
func GetRandString ¶
GetRandString returns a random string of the given length.
func GetSecretName ¶
func GetServiceName ¶
func GetStatefulSetName ¶
func NewDestinationRuleCRD ¶
func NewDestinationRuleCRD() *apiextensionsv1.CustomResourceDefinition
func NewNATSCR ¶
func NewNATSCR(opts ...NATSOption) *v1alpha1.NATS
func NewNATSStatefulSetUnStruct ¶
func NewNATSStatefulSetUnStruct(opts ...Option) *unstructured.Unstructured
func NewNamespace ¶
func NewPVC ¶
func NewPVC(name, namespace string, labels map[string]string) *apiv1.PersistentVolumeClaim
NewPVC creates a new PVC object with the given name, namespace, and label.
func NewSecretUnStruct ¶
func NewSecretUnStruct(opts ...Option) *unstructured.Unstructured
func NewStatefulSet ¶
func NewStatefulSet(name, namespace string, labels map[string]string) *appsv1.StatefulSet
func NewSugaredLogger ¶
func NewSugaredLogger() (*zap.SugaredLogger, error)
Types ¶
type NATSOption ¶
func WithNATSAnnotations ¶
func WithNATSAnnotations(annotations map[string]string) NATSOption
func WithNATSCRDefaults ¶
func WithNATSCRDefaults() NATSOption
func WithNATSCRFinalizer ¶
func WithNATSCRFinalizer(finalizer string) NATSOption
func WithNATSCRName ¶
func WithNATSCRName(name string) NATSOption
func WithNATSCRNamespace ¶
func WithNATSCRNamespace(namespace string) NATSOption
func WithNATSCRStatusInitialized ¶
func WithNATSCRStatusInitialized() NATSOption
func WithNATSClusterSize ¶
func WithNATSClusterSize(size int) NATSOption
func WithNATSEmptySpec ¶
func WithNATSEmptySpec() NATSOption
func WithNATSFileStorage ¶
func WithNATSFileStorage(fileStorage v1alpha1.FileStorage) NATSOption
func WithNATSLabels ¶
func WithNATSLabels(labels map[string]string) NATSOption
func WithNATSLogging ¶
func WithNATSLogging(debug, trace bool) NATSOption
func WithNATSMemStorage ¶
func WithNATSMemStorage(memStorage v1alpha1.MemStorage) NATSOption
func WithNATSResources ¶
func WithNATSResources(resources corev1.ResourceRequirements) NATSOption
func WithNATSStateError ¶ added in v1.0.2
func WithNATSStateError() NATSOption
func WithNATSStateProcessing ¶
func WithNATSStateProcessing() NATSOption
func WithNATSStateReady ¶
func WithNATSStateReady() NATSOption
type Option ¶
type Option func(*unstructured.Unstructured) error
func WithNamespace ¶
func WithSpecReplicas ¶
Click to show internal directories.
Click to hide internal directories.