Documentation
¶
Index ¶
- func Append(originXml string, properties []XmlNameValuePair) string
- func CreateOrUpdate(ctx context.Context, c client.Client, obj client.Object) (bool, error)
- func DecodeBase64Byte(value []byte) ([]byte, error)
- func Encode(value []byte) []byte
- func GenerateRandomStr(length int) string
- func GenerateSecretAccessKey() (string, error)
- func GetSecurityValueByKey(secret *corev1.Secret, key string) (string, error)
- func Indent2SpacesToTab(code string) string
- func Indent4SpacesToTab(code string) string
- func IndentSpacesToTab(code string, spaces int) string
- func IndentTab2Spaces(code string) string
- func IndentTab4Spaces(code string) string
- func IndentTabToSpaces(code string, spaces int) string
- func MakeConfigFileContent(config map[string]string) string
- func MakePropertiesFileContent(config map[string]string) string
- func OverrideConfigFileContent(current string, override string) string
- func OverrideProperties(override []NameValuePair, current *[]NameValuePair)
- func OverridePropertiesFileContent(current string, override []NameValuePair) (string, error)
- func OverrideXmlContent(current string, overrideProperties map[string]string) string
- func RemoveSpecialCharacter(str string) string
- func ScanProperties(current string, properties *[]NameValuePair) error
- func UpdateStatus(ctx context.Context, reconcilier client.Client, instance client.Object) error
- type Base64
- type NameValuePair
- type ResourceNameGenerator
- type XmlConfiguration
- type XmlNameValuePair
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Append ¶
func Append(originXml string, properties []XmlNameValuePair) string
Append to exist xml dom
func CreateOrUpdate ¶
CreateOrUpdate creates or updates the client.object
func DecodeBase64Byte ¶
func GenerateRandomStr ¶
GenerateRandomStr - generate random string for given length
func GenerateSecretAccessKey ¶
GenerateSecretAccessKey - generate random base64 numeric value from a random seed.
func GetSecurityValueByKey ¶
GetSecurityValueByKey get security value from secret by key
func Indent2SpacesToTab ¶
func Indent4SpacesToTab ¶
func IndentSpacesToTab ¶
func IndentTab2Spaces ¶
func IndentTab4Spaces ¶
func IndentTabToSpaces ¶
func MakeConfigFileContent ¶
MakeConfigFileContent returns the content of a configuration file content such as: ``` key1 value1 key2 value2 ```
func MakePropertiesFileContent ¶
MakePropertiesFileContent returns the content of a properties file content such as: ```properties key1=value1 key2=value2 ```
func OverrideProperties ¶
func OverrideProperties(override []NameValuePair, current *[]NameValuePair)
func OverridePropertiesFileContent ¶
func OverridePropertiesFileContent(current string, override []NameValuePair) (string, error)
OverridePropertiesFileContent use bufio resolve properties
func OverrideXmlContent ¶
OverrideXmlContent overrides the content of a xml file append the override properties to the current xml dom
func RemoveSpecialCharacter ¶
RemoveSpecialCharacter - remove special character
func ScanProperties ¶
func ScanProperties(current string, properties *[]NameValuePair) error
func UpdateStatus ¶
UpdateStatus updates the status of the Server resource https://stackoverflow.com/questions/76388004/k8s-controller-update-status-and-condition
Types ¶
type NameValuePair ¶
type ResourceNameGenerator ¶
func NewResourceNameGenerator ¶
func NewResourceNameGenerator(instanceName, roleName, groupName string) *ResourceNameGenerator
NewResourceNameGenerator new a ResourceNameGenerator
func NewResourceNameGeneratorOneRole ¶
func NewResourceNameGeneratorOneRole(instanceName, groupName string) *ResourceNameGenerator
NewResourceNameGeneratorOneRole new a ResourceNameGenerator without roleName
func (*ResourceNameGenerator) GenerateResourceName ¶
func (r *ResourceNameGenerator) GenerateResourceName(extraSuffix string) string
GenerateResourceName generate resource Name
type XmlConfiguration ¶
type XmlConfiguration struct { XMLName xml.Name `xml:"configuration"` Properties []XmlNameValuePair `xml:"property"` }
func NewXmlConfiguration ¶
func NewXmlConfiguration(properties []XmlNameValuePair) *XmlConfiguration
func (*XmlConfiguration) DistinctProperties ¶
func (c *XmlConfiguration) DistinctProperties(properties []XmlNameValuePair) []XmlNameValuePair
DistinctProperties distinct properties by name,
func (*XmlConfiguration) String ¶
func (c *XmlConfiguration) String(properties []XmlNameValuePair) string
func (*XmlConfiguration) StringWithProperties ¶
func (c *XmlConfiguration) StringWithProperties(properties map[string]string) string