Documentation ¶
Index ¶
- Variables
- func CompareSlice(operator v1alpha1.LogicOperator, a []string, b []string) bool
- func DNS1035(str string) string
- func GetConfigMapFromVolume(selector *corev1.ConfigMapKeySelector) (string, error)
- func GetConfigMapVolumePath(selector *corev1.ConfigMapKeySelector) (string, error)
- func GetGSSAPIConfig(config *dfv1.GSSAPI) (*sarama.GSSAPIConfig, error)
- func GetIsbSvcEnvVars(isbSvcConfig dfv1.BufferServiceConfig) (dfv1.ISBSvcType, []corev1.EnvVar)
- func GetSASL(saslConfig *dfv1.SASL) (..., error)
- func GetSaramaConfigFromYAMLString(yaml string) (*sarama.Config, error)
- func GetSecretFromVolume(selector *corev1.SecretKeySelector) (string, error)
- func GetSecretVolumePath(selector *corev1.SecretKeySelector) (string, error)
- func GetTLSConfig(config *dfv1.TLS) (*tls.Config, error)
- func K8sRestConfig() (*rest.Config, error)
- func LookupEnvBoolOr(key string, defaultValue bool) bool
- func LookupEnvIntOr(key string, defaultValue int) int
- func LookupEnvStringOr(key, defaultValue string) string
- func MustHash(v interface{}) string
- func MustJSON(in interface{}) string
- func MustUnJSON(v interface{}, in interface{})
- func RandomLowerCaseString(length int) string
- func RandomString(length int) string
- func StringSliceContains(list []string, str string) bool
- func VolumesFromSecretsAndConfigMaps(obj interface{}) ([]corev1.Volume, []corev1.VolumeMount)
- type UniqueStringList
- func (l *UniqueStringList) Contains(value string) bool
- func (l *UniqueStringList) Front() string
- func (l *UniqueStringList) Length() int
- func (l *UniqueStringList) MoveToBack(value string)
- func (l *UniqueStringList) PushBack(value string)
- func (l *UniqueStringList) Remove(value string)
- func (l *UniqueStringList) ToString() string
- type XDGSCRAMClient
Constants ¶
This section is empty.
Variables ¶
var ( SHA256 scram.HashGeneratorFcn = sha256.New SHA512 scram.HashGeneratorFcn = sha512.New )
copied from https://github.com/IBM/sarama/blob/main/examples/sasl_scram_client/scram_client.go
var DefaultRetryBackoff = wait.Backoff{ Steps: 10, Duration: 5 * time.Second, Factor: 2.0, Jitter: 0.1, }
Functions ¶
func CompareSlice ¶ added in v0.8.0
func CompareSlice(operator v1alpha1.LogicOperator, a []string, b []string) bool
CompareSlice compares two slices based on operator. OP == AND returns true if all the elements of slice a are in slice b OP = OR returns true if any of the elements of slice a are in slice b OP = NOT returns false if any of the elements of slice a are in slice b
func GetConfigMapFromVolume ¶
func GetConfigMapFromVolume(selector *corev1.ConfigMapKeySelector) (string, error)
func GetConfigMapVolumePath ¶
func GetConfigMapVolumePath(selector *corev1.ConfigMapKeySelector) (string, error)
GetConfigMapVolumePath returns the path of the mounted configmap
func GetGSSAPIConfig ¶ added in v0.7.3
func GetGSSAPIConfig(config *dfv1.GSSAPI) (*sarama.GSSAPIConfig, error)
GetGSSAPIConfig A utility function to get sasl.gssapi.Config
func GetIsbSvcEnvVars ¶
func GetIsbSvcEnvVars(isbSvcConfig dfv1.BufferServiceConfig) (dfv1.ISBSvcType, []corev1.EnvVar)
GetIsbSvcEnvVars is helper function to get the ISB service type and generate corresponnding environment variables
func GetSASL ¶ added in v0.8.0
func GetSASL(saslConfig *dfv1.SASL) (*struct { Enable bool Mechanism sarama.SASLMechanism Version int16 Handshake bool AuthIdentity string User string Password string SCRAMAuthzID string SCRAMClientGeneratorFunc func() sarama.SCRAMClient TokenProvider sarama.AccessTokenProvider GSSAPI sarama.GSSAPIConfig }, error)
func GetSaramaConfigFromYAMLString ¶
GetSaramaConfigFromYAMLString parse yaml string to sarama.config
func GetSecretFromVolume ¶
func GetSecretFromVolume(selector *corev1.SecretKeySelector) (string, error)
func GetSecretVolumePath ¶
func GetSecretVolumePath(selector *corev1.SecretKeySelector) (string, error)
GetSecretVolumePath returns the path of the mounted secret
func GetTLSConfig ¶
A utility function to get tls.Config
func K8sRestConfig ¶ added in v0.11.0
K8sRestConfig returns a rest config for the kubernetes cluster.
func LookupEnvBoolOr ¶ added in v1.0.0
func LookupEnvIntOr ¶ added in v0.7.1
func LookupEnvStringOr ¶
func MustUnJSON ¶
func MustUnJSON(v interface{}, in interface{})
MustUnJSON unmarshalls JSON or panics. v - must be []byte or string in - must be a pointer.
func RandomLowerCaseString ¶
func RandomString ¶
RandomString generate a random string with given length
func StringSliceContains ¶
func VolumesFromSecretsAndConfigMaps ¶
func VolumesFromSecretsAndConfigMaps(obj interface{}) ([]corev1.Volume, []corev1.VolumeMount)
VolumesFromSecretsOrConfigMaps builds volumes and volumeMounts spec based on the obj and its children's secretKeyselector and configMapKeySelector
Types ¶
type UniqueStringList ¶ added in v1.3.0
type UniqueStringList struct {
// contains filtered or unexported fields
}
UniqueStringList is a list of strings that only allows unique values. the underlying list is a doubly linked list.
func NewUniqueStringList ¶ added in v1.3.0
func NewUniqueStringList() *UniqueStringList
func (*UniqueStringList) Contains ¶ added in v1.3.0
func (l *UniqueStringList) Contains(value string) bool
Contains returns true if the value exists in the list.
func (*UniqueStringList) Front ¶ added in v1.3.0
func (l *UniqueStringList) Front() string
Front returns the first string of list l or empty string if the list is empty.
func (*UniqueStringList) Length ¶ added in v1.3.0
func (l *UniqueStringList) Length() int
Length returns the number of elements of list l.
func (*UniqueStringList) MoveToBack ¶ added in v1.3.0
func (l *UniqueStringList) MoveToBack(value string)
MoveToBack moves the element to the back of the list, if the value exists in the list.
func (*UniqueStringList) PushBack ¶ added in v1.3.0
func (l *UniqueStringList) PushBack(value string)
PushBack adds a value to the back of the list, if the value doesn't exist in the list.
func (*UniqueStringList) Remove ¶ added in v1.3.0
func (l *UniqueStringList) Remove(value string)
Remove removes the string from the list, if it exists in the list.
func (*UniqueStringList) ToString ¶ added in v1.3.0
func (l *UniqueStringList) ToString() string
ToString returns a comma separated string of the list values.
type XDGSCRAMClient ¶ added in v1.1.6
type XDGSCRAMClient struct { *scram.Client *scram.ClientConversation scram.HashGeneratorFcn }
func (*XDGSCRAMClient) Begin ¶ added in v1.1.6
func (x *XDGSCRAMClient) Begin(userName, password, authzID string) (err error)
func (*XDGSCRAMClient) Done ¶ added in v1.1.6
func (x *XDGSCRAMClient) Done() bool