Documentation ¶
Overview ¶
* Copyright 2019-2020, EnMasse authors. * License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html).
* Copyright 2019, EnMasse authors. * License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html).
Index ¶
- Constants
- Variables
- func AddressName(object metav1.Object, prefix string) string
- func ContainsString(strings []string, value string) bool
- func CreateSecret(ctx context.Context, client client.Client, scheme *runtime.Scheme, ...) error
- func DefaultJavaRequiresNativeTls() bool
- func EncodeAddressSpaceAsMetaName(addressSpaceName string, addressName string) string
- func EncodeAsMetaName(name string, maxLength int) string
- func FalsePtr() *bool
- func GeneratePassword(length int) (string, error)
- func GenerateSelfSignedCertSecret(host string, alternateIPs []net.IP, alternateDNS []string, ...) error
- func GetBooleanEnv(key string) bool
- func GetBooleanEnvOrDefault(key string, defaultValue bool) bool
- func GetDurationEnvOrDefault(key string, defaultValue time.Duration) time.Duration
- func GetEnvOrDefault(key string, defaultValue string) string
- func GetEnvOrError(name string) (string, error)
- func GetFsGroupOverride(component string) *int64
- func GetInfrastructureNamespace() (string, error)
- func GetPortForService(servicePorts []v1.ServicePort, name string) (*int32, error)
- func GetTemplateList() []string
- func GetUintEnvOrDefault(key string, base int, bitSize int, defaultValue uint64) uint64
- func HasApi(gvk schema.GroupVersionKind) bool
- func IsModuleEnabled(module string) bool
- func IsNewObject(object v1.Object) bool
- func IsNotReadyYetError(err error) bool
- func IsOpenshift() bool
- func IsOpenshift4() bool
- func IsSameRef(ref1, ref2 v1.OwnerReference) bool
- func Max(x, y int64) int64
- func MaxDuration(x, y time.Duration) time.Duration
- func Min(x, y int64) int64
- func MinDuration(x, y time.Duration) time.Duration
- func MustGetInfrastructureNamespace() string
- func NewConfigurationError(format string, a ...interface{}) error
- func NewObjectNotReadyYetError(object v1.Object) *objectNotReadyYetError
- func NewOwnerRef(owner v1.Object, gvk schema.GroupVersionKind) *v1.OwnerReference
- func OnlyNonRecoverableErrors(err error) bool
- func OpenshiftUri() (*url.URL, bool, error)
- func RandomBrokerName() string
- func ServiceToCommonName(serviceNamespace, serviceName string) string
- func SetInfrastructureNamespaceForTesting(value string)
- func SplitUserName(name string) (string, string, error)
- func TenantNameForObject(object metav1.Object) string
- func ToX500Name(asn1Name []byte) (string, error)
- func WellKnownOauthMetadata() (map[string]interface{}, error)
- func WrapAsNonRecoverable(err error) error
- type ApplySecretFn
- type ConfigurationError
- type EnvironmentProvider
- type MockEnvironmentProvider
- type MultiTool
- type NonRecoverableError
- type OSEnvironmentProvider
- type Parameters
- type TemplateHelper
- type WrappedNonRecoverableError
Constants ¶
const ConnectsTo = "app.openshift.io/connects-to"
const EnMasseOpenshift4EnvVar = "ENMASSE_OPENSHIFT4"
const EnMasseOpenshiftEnvVar = "ENMASSE_OPENSHIFT"
Variables ¶
var ( PossibleCharacters = []rune("abcdefghijklmnopqrstuvwxyz" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "0123456789" + ";:,.-_=") MaxLen = big.NewInt(int64(len(PossibleCharacters))) )
var UserGVK = userapiv1.GroupVersion.WithKind("User")
Functions ¶
func AddressName ¶
Get an address name from an IoTProject the name is the prefix (e.g. "telemetry") plus the tenant name. The name is not encoded in any way.
func ContainsString ¶
Searches a **sorted** for a string value.
func CreateSecret ¶
func DefaultJavaRequiresNativeTls ¶
func DefaultJavaRequiresNativeTls() bool
func EncodeAddressSpaceAsMetaName ¶
Encode an address name so that it can be put inside the .metadata.name field of an Address object
func EncodeAsMetaName ¶
func GeneratePassword ¶
generate a password which is X characters (runes) long, and also X bytes long
func GetBooleanEnv ¶
func GetBooleanEnvOrDefault ¶
func GetDurationEnvOrDefault ¶
func GetEnvOrDefault ¶
func GetEnvOrError ¶
func GetFsGroupOverride ¶
func GetInfrastructureNamespace ¶
Get the name of the infrastructure namespace
func GetPortForService ¶
func GetPortForService(servicePorts []v1.ServicePort, name string) (*int32, error)
func GetTemplateList ¶
func GetTemplateList() []string
func GetUintEnvOrDefault ¶
func HasApi ¶
func HasApi(gvk schema.GroupVersionKind) bool
func IsModuleEnabled ¶
check if a controller module is enabled, or not
func IsNewObject ¶
func IsNotReadyYetError ¶
Test if this is a NotReadyYetError error
func IsOpenshift ¶
func IsOpenshift() bool
func IsSameRef ¶
func IsSameRef(ref1, ref2 v1.OwnerReference) bool
func MustGetInfrastructureNamespace ¶
func MustGetInfrastructureNamespace() string
Get the name of th infrastructure namespace, panics if 'NAMESPACE' is unset
func NewConfigurationError ¶
func NewOwnerRef ¶
func NewOwnerRef(owner v1.Object, gvk schema.GroupVersionKind) *v1.OwnerReference
func OnlyNonRecoverableErrors ¶
Returns true if all errors covered by this error implement the NonRecoverableError interface.
If the error is a simple error, the only the one error will be checked. If the error is a "multierr" error, then all recorded errors will be checked.
If the error is "nil", then "true" is being returned.
func RandomBrokerName ¶
func RandomBrokerName() string
func ServiceToCommonName ¶
func SetInfrastructureNamespaceForTesting ¶
func SetInfrastructureNamespaceForTesting(value string)
Allows to set the infrastructure namespace when doing tests
func TenantNameForObject ¶
func ToX500Name ¶
Convert a name from an X509 certificate into a string
We cannot use the Go method pkix.Name.ToString() function as the whole name decoding logic in Go is full of assumptions which are not correct. Go takes the RDNSequence and re-arranges and re-encodes the entries in a way that they no longer correspond to the original sequence. Thus we simply take the raw value, and encode it ourselves as string.
func WellKnownOauthMetadata ¶
func WrapAsNonRecoverable ¶
Wrap any error as non-recoverable. This allows having a proper cause chain, but still be able to flag certain errors as non-recoverable.
Types ¶
type ApplySecretFn ¶
type ConfigurationError ¶
type ConfigurationError struct {
Reason string
}
an error in the configuration, non-recoverable
func (*ConfigurationError) Error ¶
func (e *ConfigurationError) Error() string
type EnvironmentProvider ¶
type MockEnvironmentProvider ¶
func (MockEnvironmentProvider) Get ¶
func (p MockEnvironmentProvider) Get(name string) string
type NonRecoverableError ¶
type NonRecoverableError interface {
// contains filtered or unexported methods
}
type OSEnvironmentProvider ¶
type OSEnvironmentProvider struct { }
func (OSEnvironmentProvider) Get ¶
func (p OSEnvironmentProvider) Get(name string) string
type Parameters ¶
type TemplateHelper ¶
type TemplateHelper struct { Parameters Parameters TemplatePath string TemplateList []string }
func NewTemplateHelper ¶
func NewTemplateHelper(extraParams map[string]string) *TemplateHelper
Creates a new template helper and populates the values for all template properties.
func (*TemplateHelper) CreateResource ¶
func (h *TemplateHelper) CreateResource(template string) (runtime.Object, error)
type WrappedNonRecoverableError ¶
type WrappedNonRecoverableError struct {
// contains filtered or unexported fields
}
func (WrappedNonRecoverableError) Cause ¶
func (e WrappedNonRecoverableError) Cause() error
func (*WrappedNonRecoverableError) Error ¶
func (e *WrappedNonRecoverableError) Error() string