Documentation ¶
Index ¶
- Variables
- func Convert2WaitBackoff(backoff *aev1.Backoff) (*wait.Backoff, error)
- func DoWithRetry(backoff *aev1.Backoff, f func() error) error
- func ElementsMatch(first []string, second []string) bool
- func ErrEventSourceTypeMismatch(eventSourceType string) string
- func FormatEndpoint(endpoint string) string
- func FormattedURL(url, endpoint string) string
- func GenerateConfigMapVolumeSpecs(selector *v1.ConfigMapKeySelector) (v1.Volume, v1.VolumeMount)
- func GenerateEnvFromConfigMapSpec(selector *v1.ConfigMapKeySelector) v1.EnvFromSource
- func GenerateEnvFromSecretSpec(selector *v1.SecretKeySelector) v1.EnvFromSource
- func GenerateSecretVolumeSpecs(selector *v1.SecretKeySelector) (v1.Volume, v1.VolumeMount)
- func GetClientConfig(kubeconfig string) (*rest.Config, error)
- func GetConfigMapFromVolume(selector *v1.ConfigMapKeySelector) (string, error)
- func GetConfigMapVolumePath(selector *v1.ConfigMapKeySelector) (string, error)
- func GetEnvFromConfigMap(selector *v1.ConfigMapKeySelector) (string, bool)
- func GetEnvFromSecret(selector *v1.SecretKeySelector) (string, bool)
- func GetImagePullPolicy() v1.PullPolicy
- func GetObjectHash(obj metav1.Object) (string, error)
- func GetSaramaConfigFromYAMLString(yaml string) (*sarama.Config, error)
- func GetSecretFromVolume(selector *v1.SecretKeySelector) (string, error)
- func GetSecretValue(ctx context.Context, client kubernetes.Interface, namespace string, ...) (string, error)
- func GetSecretVolumePath(selector *v1.SecretKeySelector) (string, error)
- func GetTLSConfig(config *aev1.TLSConfig) (*tls.Config, error)
- func Hasher(value string) string
- func IsRetryableKubeAPIError(err error) bool
- func LookupEnvStringOr(key, defaultValue string) string
- func MustHash(v interface{}) string
- func MustJSON(in interface{}) string
- func MustUnJSON(v interface{}, in interface{})
- func ParseExclusionDates(vals []string) ([]time.Time, error)
- func ParseTime(t string, baseDate time.Time) (time.Time, error)
- func PrevCronTime(cronSpec string, parser cronlib.Parser, t time.Time) (time.Time, error)
- func RandomString(length int) string
- func SendErrorResponse(writer http.ResponseWriter, response string)
- func SendInternalErrorResponse(writer http.ResponseWriter, response string)
- func SendResponse(writer http.ResponseWriter, statusCode int, response string)
- func SendSuccessResponse(writer http.ResponseWriter, response string)
- func SliceContains(strSlice []string, targetStr string) bool
- func StructToMap(obj interface{}, output map[string]interface{}) error
- func ViperWithLogging() *viper.Viper
- func VolumesFromSecretsOrConfigMaps(t reflect.Type, objs ...interface{}) ([]v1.Volume, []v1.VolumeMount)
- type StringKeyedMap
- type XDGSCRAMClient
Constants ¶
This section is empty.
Variables ¶
var ( SHA256New scram.HashGeneratorFcn = sha256.New SHA512New scram.HashGeneratorFcn = sha512.New )
var (
DefaultBackoff = aev1.Backoff{
Steps: 5,
Duration: &defaultDuration,
Factor: &defaultFactor,
Jitter: &defaultJitter,
}
)
Functions ¶
func Convert2WaitBackoff ¶
Convert2WaitBackoff converts to a wait backoff option
func ElementsMatch ¶
ElementsMatch returns true if the two provided string slices contain the same elements while avoiding duplications. WARN: this method avoids duplications.
func FormatEndpoint ¶
FormatEndpoint returns a formatted api endpoint
func FormattedURL ¶
FormattedURL returns a formatted url
func GenerateConfigMapVolumeSpecs ¶
func GenerateConfigMapVolumeSpecs(selector *v1.ConfigMapKeySelector) (v1.Volume, v1.VolumeMount)
GenerateConfigMapVolumeSpecs builds a "volume" and "volumeMount"spec with a configMapKeySelector
func GenerateEnvFromConfigMapSpec ¶
func GenerateEnvFromConfigMapSpec(selector *v1.ConfigMapKeySelector) v1.EnvFromSource
GenerateEnvFromConfigMapSpec builds a "envFrom" spec with a configMapKeySelector
func GenerateEnvFromSecretSpec ¶
func GenerateEnvFromSecretSpec(selector *v1.SecretKeySelector) v1.EnvFromSource
GenerateEnvFromSecretSpec builds a "envFrom" spec with a secretKeySelector
func GenerateSecretVolumeSpecs ¶
func GenerateSecretVolumeSpecs(selector *v1.SecretKeySelector) (v1.Volume, v1.VolumeMount)
GenerateSecretVolumeSpecs builds a "volume" and "volumeMount"spec with a secretKeySelector
func GetClientConfig ¶
GetClientConfig return rest config, if path not specified, assume in cluster config
func GetConfigMapFromVolume ¶
func GetConfigMapFromVolume(selector *v1.ConfigMapKeySelector) (string, error)
GetConfigMapFromVolume retrieves the value of mounted config map volume "/argo-events/config/${configMapRef.name}/${configMapRef.key}" is expected to be the file path
func GetConfigMapVolumePath ¶
func GetConfigMapVolumePath(selector *v1.ConfigMapKeySelector) (string, error)
GetConfigMapVolumePath returns the path of the mounted configmap
func GetEnvFromConfigMap ¶
func GetEnvFromConfigMap(selector *v1.ConfigMapKeySelector) (string, bool)
GetEnvFromConfigMap retrieves the value of envFrom.configMapRef "${configMapRef.name}_" is expected to be defined as "prefix"
func GetEnvFromSecret ¶
func GetEnvFromSecret(selector *v1.SecretKeySelector) (string, bool)
GetEnvFromSecret retrieves the value of envFrom.secretRef "${secretRef.name}_" is expected to be defined as "prefix"
func GetImagePullPolicy ¶
func GetImagePullPolicy() v1.PullPolicy
func GetObjectHash ¶
GetObjectHash returns hash of a given object
func GetSaramaConfigFromYAMLString ¶
GetSaramaConfigFromYAMLString parse yaml string to sarama.config. Note: All the time.Duration config can not be correctly decoded because it does not implement the decode function.
func GetSecretFromVolume ¶
func GetSecretFromVolume(selector *v1.SecretKeySelector) (string, error)
GetSecretFromVolume retrieves the value of mounted secret volume "/argo-events/secrets/${secretRef.name}/${secretRef.key}" is expected to be the file path
func GetSecretValue ¶
func GetSecretValue(ctx context.Context, client kubernetes.Interface, namespace string, selector *v1.SecretKeySelector) (string, error)
GetSecretValue retrieves the secret value from the secret in namespace with name and key
func GetSecretVolumePath ¶
func GetSecretVolumePath(selector *v1.SecretKeySelector) (string, error)
GetSecretVolumePath returns the path of the mounted secret
func GetTLSConfig ¶
GetTLSConfig returns a tls configuration for given cert and key or skips the certs if InsecureSkipVerify is true.
func IsRetryableKubeAPIError ¶
IsRetryableKubeAPIError returns if the error is a retryable kubernetes error
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 ParseExclusionDates ¶
ParseExclusionDates parses the exclusion dates from the vals string according to RFC 5545
func ParseTime ¶
ParseTime parses time string in "HH:MM:SS" format into time.Time, which date is same as baseDate in UTC.
func PrevCronTime ¶
For a given cron specification, return the previous activation time If no time can be found to satisfy the schedule, return the zero time.
func SendErrorResponse ¶
func SendErrorResponse(writer http.ResponseWriter, response string)
SendErrorResponse sends http error response
func SendInternalErrorResponse ¶
func SendInternalErrorResponse(writer http.ResponseWriter, response string)
SendInternalErrorResponse sends http internal error response
func SendResponse ¶
func SendResponse(writer http.ResponseWriter, statusCode int, response string)
SendResponse sends http response with given status code
func SendSuccessResponse ¶
func SendSuccessResponse(writer http.ResponseWriter, response string)
SendSuccessResponse sends http success response
func SliceContains ¶
SliceContains checks if a string slice contains a specific string
func StructToMap ¶
func ViperWithLogging ¶
func VolumesFromSecretsOrConfigMaps ¶
func VolumesFromSecretsOrConfigMaps(t reflect.Type, objs ...interface{}) ([]v1.Volume, []v1.VolumeMount)
VolumesFromSecretsOrConfigMaps builds volumes and volumeMounts spec based on the obj and its children's secretKeyselector or configMapKeySelector
Types ¶
type StringKeyedMap ¶
type StringKeyedMap[T any] struct { // contains filtered or unexported fields }
Concurrent Safe String keyed map
func NewStringKeyedMap ¶
func NewStringKeyedMap[T any]() StringKeyedMap[T]
func (*StringKeyedMap[T]) Delete ¶
func (sm *StringKeyedMap[T]) Delete(key string)
func (*StringKeyedMap[T]) Load ¶
func (sm *StringKeyedMap[T]) Load(key string) (T, bool)
func (*StringKeyedMap[T]) Store ¶
func (sm *StringKeyedMap[T]) Store(key string, item T)
type XDGSCRAMClient ¶
type XDGSCRAMClient struct { *scram.Client *scram.ClientConversation scram.HashGeneratorFcn }
func (*XDGSCRAMClient) Begin ¶
func (x *XDGSCRAMClient) Begin(userName, password, authzID string) (err error)
func (*XDGSCRAMClient) Done ¶
func (x *XDGSCRAMClient) Done() bool