Documentation ¶
Index ¶
- Constants
- Variables
- func CreateVectorShutdownFileCommand() string
- func ExportPodAddress() string
- func GenerateRandomStr(length int, useLetters bool, useSpecial bool, useNum bool) string
- func GenerateSimplePassword(length int) string
- func Indent2SpacesToTab(code string) string
- func Indent4SpacesToTab(code string) string
- func IndentSpacesToTab(code string, spacesPerTab int) string
- func IndentTab2Spaces(code string) string
- func IndentTab4Spaces(code string) string
- func IndentTabToSpaces(code string, spacesPerTab int) string
- func NewEnvVarsFromMap(envs map[string]string) []corev1.EnvVar
- func RemoveSpecialCharacter(str string) string
- func RemoveVectorShutdownFileCommand() string
- type Base64
- type Image
- type ImageOption
- type ImageOptions
- type Property
- type ResourceNameGenerator
- type XMLConfiguration
- func (x *XMLConfiguration) AddPropertiesWithMap(properties map[string]string)
- func (x *XMLConfiguration) AddProperty(p Property)
- func (x *XMLConfiguration) AddPropertyWithString(name, value, description string)
- func (x *XMLConfiguration) DeleteProperties(names ...string)
- func (x *XMLConfiguration) GetProperty(name string) (Property, bool)
- func (x *XMLConfiguration) Marshal() (string, error)
Constants ¶
const ( VectorLogDir = "_vector" // File to signal that Vector should be gracefully shut down ShutdownFile = "shutdown" )
Subdirectory of the log directory containing files to control the Vector instance
const ( InvokePrepareSignalHandlers = "prepare_signal_handlers" InvokeWaitForTermination = "wait_for_termination $!" )
const CommonBashTrapFunctions = `` /* 542-byte string literal not displayed */
const (
XMLStylesheet = `<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>` + "\n"
)
Variables ¶
var DefaultRepository = "quay.io/zncdatadev"
Functions ¶
func CreateVectorShutdownFileCommand ¶ added in v0.8.7
func CreateVectorShutdownFileCommand() string
Command to create a shutdown file for the vector container. Please delete it before starting your application using `RemoveVectorShutdownFileCommand` .
func ExportPodAddress ¶ added in v0.8.7
func ExportPodAddress() string
ExportPodAddress fetch the pod address from the default-address directory and export it as POD_ADDRESS the listener was provided by listener operator
func GenerateRandomStr ¶
GenerateRandomStr generates a random string of the specified length. The string can contain letters, special characters, and numbers based on the flags provided.
func GenerateSimplePassword ¶ added in v0.8.1
GenerateSimplePassword generates a simple password of the specified length. The password will contain only letters and numbers.
func Indent2SpacesToTab ¶
func Indent4SpacesToTab ¶
func IndentSpacesToTab ¶
IndentSpacesToTab converts leading spaces in a string to tabs, optimized for 2 or 4 spaces per tab.
func IndentTab2Spaces ¶
func IndentTab4Spaces ¶
func IndentTabToSpaces ¶
IndentTabToSpaces converts leading tabs in a string to a specified number of spaces per tab.
func NewEnvVarsFromMap ¶ added in v0.8.1
func RemoveSpecialCharacter ¶
RemoveSpecialCharacter - remove special character
func RemoveVectorShutdownFileCommand ¶ added in v0.8.7
func RemoveVectorShutdownFileCommand() string
Use this command to remove the shutdown file (if it exists) created by [`create_vector_shutdown_file_command`]. You should execute this command before starting your application.
Types ¶
type Image ¶ added in v0.6.0
type Image struct { Custom string Repo string ProductName string PlatformVersion string ProductVersion string PullPolicy *corev1.PullPolicy PullSecretName string }
Image represents a container image Required fields:
- ProductName
- PlatformVersion
- ProductVersion
If Custom is set, it will be used as the image tag, so the Custom field must be a valid image tag, eg. "my.repo.company.org/namespace/image:tag"
func NewImage ¶ added in v0.8.0
func NewImage( productName string, platformVersion string, productVersion string, opts ...ImageOption, ) *Image
NewImage creates a new Image object
Example:
image := util.NewImage( "myproduct", "1.0", "1.0.0", ) image := util.NewImage( "myproduct", "1.0", "1.0.0", func (options *util.ImageOptions) { options.Custom = "myrepo/myimage:latest" } )
func (*Image) GetImageWithTag ¶ added in v0.8.4
func (*Image) GetPullPolicy ¶ added in v0.6.0
func (i *Image) GetPullPolicy() *corev1.PullPolicy
type ImageOption ¶ added in v0.8.0
type ImageOption func(*ImageOptions)
type ImageOptions ¶ added in v0.8.0
type ImageOptions struct { Custom string Repo string PullPolicy *corev1.PullPolicy PullSecretName string }
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 ¶ added in v0.8.1
type XMLConfiguration struct { Configuration *configuration Header string }
func NewXMLConfiguration ¶ added in v0.8.1
func NewXMLConfiguration() *XMLConfiguration
func NewXMLConfigurationFromMap ¶ added in v0.8.1
func NewXMLConfigurationFromMap(properties map[string]string) *XMLConfiguration
func NewXMLConfigurationFromString ¶ added in v0.8.1
func NewXMLConfigurationFromString(xmlData string) (*XMLConfiguration, error)
func (*XMLConfiguration) AddPropertiesWithMap ¶ added in v0.8.1
func (x *XMLConfiguration) AddPropertiesWithMap(properties map[string]string)
func (*XMLConfiguration) AddProperty ¶ added in v0.8.1
func (x *XMLConfiguration) AddProperty(p Property)
func (*XMLConfiguration) AddPropertyWithString ¶ added in v0.8.1
func (x *XMLConfiguration) AddPropertyWithString(name, value, description string)
func (*XMLConfiguration) DeleteProperties ¶ added in v0.8.1
func (x *XMLConfiguration) DeleteProperties(names ...string)
func (*XMLConfiguration) GetProperty ¶ added in v0.8.1
func (x *XMLConfiguration) GetProperty(name string) (Property, bool)
func (*XMLConfiguration) Marshal ¶ added in v0.8.1
func (x *XMLConfiguration) Marshal() (string, error)