Documentation ¶
Index ¶
- Variables
- func AreAllKeysOfFirstMapExistsInSecondMap(map1 map[string]interface{}, map2 map[string]interface{}) bool
- func AreMapsHaveTheSameKeys(map1 map[string]interface{}, map2 map[string]interface{}) bool
- func CheckIfAllKeysOfFirstAreInSecond(path1 string, path2 string) (bool, error)
- func CheckIfTwoYamlsHaveTheSameKeys(path1 string, path2 string) (bool, error)
- func CreateMapFromPathOfYaml(path string) (map[string]interface{}, error)
- func CreateTlsConfig(tlsCrtPath string, tlsKeyPath string, caCertPath string, host string) (*tls.Config, error)
- func ExtractImagesFromPodSpec(podSpec *corev1.PodSpec) []string
- func GetDeploymentInstance() *deployment
- func GetHours(durationInHours int) time.Duration
- func GetMilliseconds(durationInMilliseconds int) time.Duration
- func GetMinutes(durationInMinutes int) time.Duration
- func GetPasswordFromFile(passwordPath string) (string, error)
- func GetSeconds(durationInSeconds int) time.Duration
- func GetSizeInBytes(value string) int
- func GetType(object interface{}) string
- func GetTypeWithoutPackage(object interface{}) string
- func GoToDestNode(yamlFile *yaml1.RNode, path ...string) (destNode *yaml1.RNode, err error)
- func IsErrorIsTypeOf(err error, t interface{}) bool
- func NewDeployment(configuration *DeploymentConfiguration) (*deployment, error)
- func RepeatEveryTick(duration time.Duration, f func() error)
- func StringInSlice(str string, list []string) bool
- func UpdateDeploymentForTests(configuration *DeploymentConfiguration)
- func ValidatePositiveInt(positiveIntValidationObjects ...*PositiveIntValidationObject) (bool, string)
- type ChannelDataWrapper
- type DeploymentConfiguration
- type PositiveIntValidationObject
- type TimeoutConfiguration
Constants ¶
This section is empty.
Variables ¶
var ( NilArgumentError = errors.New("NilArgumentError") ReadFromClosedChannelError = errors.New("ReadFromClosedChannelError") CantConvertChannelDataWrapper = errors.New("Cant Convert Channel Data Wrapper to the designated type") SetKeyInCacheWithNoExpiration = errors.New("SetKeyInCacheWithNoExpiration") TimeOutError = errors.New("TimeOutError") InvalidConfiguration = errors.New("InvalidConfiguration") )
Functions ¶
func AreAllKeysOfFirstMapExistsInSecondMap ¶
func AreAllKeysOfFirstMapExistsInSecondMap(map1 map[string]interface{}, map2 map[string]interface{}) bool
AreAllKeysOfFirstMapExistsInSecondMap checks if all the keys of the first map are exist in the second map - check also nested maps.
func AreMapsHaveTheSameKeys ¶
AreMapsHaveTheSameKeys checks if two maps have the same keys - check also nested maps.
func CheckIfAllKeysOfFirstAreInSecond ¶
CheckIfAllKeysOfFirstAreInSecond checks if all keys of the first yaml file are exists in second yaml
func CheckIfTwoYamlsHaveTheSameKeys ¶
CheckIfTwoYamlsHaveTheSameKeys Checks if 2 yaml's files have the same keys. returns ...
func CreateMapFromPathOfYaml ¶
CreateMapFromPathOfYaml Loads map from path of yaml file.
func CreateTlsConfig ¶
func CreateTlsConfig(tlsCrtPath string, tlsKeyPath string, caCertPath string, host string) (*tls.Config, error)
CreateTlsConfig creates tls.config object.
func ExtractImagesFromPodSpec ¶
ExtractImagesFromPodSpec gets pod spec and returns all images used by the pod.
func GetDeploymentInstance ¶
func GetDeploymentInstance() *deployment
GetDeploymentInstance returns the singleton instance of deployment. in case that the deployment is not initialized, returns nil.
func GetMilliseconds ¶
GetMilliseconds receive durationInMilliseconds as int and return it as time.Duration in milliseconds.
func GetMinutes ¶
GetMinutes receive durationInMinutes as int and return it as time.Duration in minutes.
func GetPasswordFromFile ¶
GetPasswordFromFile gets a password from a file containing only the password TODO - change to get password directly from the secret (no mount)
func GetSeconds ¶
GetSeconds receive durationInSeconds as int and return it as time.Duration in seconds.
func GetSizeInBytes ¶
GetSizeInBytes returns the size of value in bytes.
func GetType ¶
func GetType(object interface{}) string
GetType returns the full type of the object. it contains the type of the object with the packages as prefixes. e.g. x: = main.User{} -- GetTypeWithoutPackage(x) -> main.User
func GetTypeWithoutPackage ¶
func GetTypeWithoutPackage(object interface{}) string
GetTypeWithoutPackage returns the type of the object without the package that the object belongs to. e.g. x: = main.User{} -- GetTypeWithoutPackage(x) -> User
func GoToDestNode ¶
GoToDestNode returns the *Rnode of the given path.
func IsErrorIsTypeOf ¶
IsErrorIsTypeOf gets an error and type of interface and returns true or false if the error caused by some error of type t. NOTICE - you should pass t as double pointer - e.g. err := &os.PathError{} err2 := &os.PathError{} IsErrorIsTypeOf(err, &err2)
func NewDeployment ¶
func NewDeployment(configuration *DeploymentConfiguration) (*deployment, error)
NewDeployment creates new deployment in case of singleton is not initialized yet. returns error when there is already initialized instance.
func RepeatEveryTick ¶
RepeatEveryTick calls a given function repeatedly every duration.
func StringInSlice ¶
StringInSlice return true if list contain str,false otherwise.
func UpdateDeploymentForTests ¶
func UpdateDeploymentForTests(configuration *DeploymentConfiguration)
UpdateDeploymentForTests is used for update the singleton for tests purpose. ------ Shouldn't be used in production code ---------------
func ValidatePositiveInt ¶
func ValidatePositiveInt(positiveIntValidationObjects ...*PositiveIntValidationObject) (bool, string)
ValidatePositiveInt gets an unknown number of variables of type int and return an false in case at least one of them is non-positive Otherwise return true
Types ¶
type ChannelDataWrapper ¶
type ChannelDataWrapper struct {
// contains filtered or unexported fields
}
ChannelDataWrapper is a struct that hold 2 members: data and error. Its main purpose is to enable sending and receiving generic data throw channels.
func NewChannelDataWrapper ¶
func NewChannelDataWrapper(data interface{}, err error) *ChannelDataWrapper
NewChannelDataWrapper - NewChannelDataWrapper Ctor
func (*ChannelDataWrapper) GetData ¶
func (wrapper *ChannelDataWrapper) GetData() (interface{}, error)
GetData gets the data from the ChannelDataWrapper. returns error (that is not nil) in case that wrapper got non-nil err in the constructor or in case that the data is nil
type DeploymentConfiguration ¶
type DeploymentConfiguration struct { // IsLocalDevelopment is boolean that indicate if we are in local development or not. IsLocalDevelopment bool // Namespace is the Namespace where the server is running Namespace string }
DeploymentConfiguration is deployment configuration
type TimeoutConfiguration ¶
type TimeoutConfiguration struct {
TimeDurationInMS int
}
func (*TimeoutConfiguration) ParseTimeoutConfigurationToDuration ¶
func (configuration *TimeoutConfiguration) ParseTimeoutConfigurationToDuration() time.Duration
ParseTimeoutConfigurationToDuration gets TimeoutConfiguration parse the timeDurationInMS of TimeoutConfiguration and returns it as duration.