Documentation ¶
Index ¶
- Constants
- func CheckEmptyMapStringString(m map[string]string) map[string]string
- func ComputeHash(data interface{}) (uint64, error)
- func ComputeKIDFromDER(publicKey []byte) (kid string, err error)
- func ConvertStringToUint(val string) uint64
- func ConvertTimeToMillis(tm time.Time) int64
- func ConvertToDomainNameCompliant(str string) string
- func ConvertUnitToString(val uint64) string
- func CreateDirIfNotExist(dirPath string)
- func GetAgentDetailStrings(h handler) map[string]string
- func GetAgentDetails(h handler) map[string]interface{}
- func GetAgentDetailsValue(h handler, key string) (string, error)
- func GetProxyURL(fixedURL *url.URL) func(*http.Request) (*url.URL, error)
- func GetStringArrayFromMapInterface(key string, data map[string]interface{}) []string
- func GetStringFromMapInterface(key string, data map[string]interface{}) string
- func GetSubResourcePropertyValue(h handler, subRes, key string) (string, error)
- func GetURLHostName(urlString string) string
- func HandleInterfaceFuncNotImplemented(obj interface{}, funcName, interfaceName string)
- func IsItemInSlice(strSlice []string, item string) bool
- func IsNil(v interface{}) bool
- func IsNotTest() bool
- func LoadEnvFromFile(filename string) error
- func MapStringInterfaceToStringString(data map[string]interface{}) map[string]string
- func MapStringStringToMapStringInterface(m map[string]string) map[string]interface{}
- func MapsEqual(m1, m2 map[string]interface{}) bool
- func MaskValue(sensitiveData string) string
- func MergeMapStringInterface(m ...map[string]interface{}) map[string]interface{}
- func MergeMapStringString(m ...map[string]string) map[string]string
- func NormalizeNameForCentral(str string) string
- func ParseAddr(url *url.URL) string
- func ParsePort(url *url.URL) int
- func ParsePublicKey(publicKey []byte) (*rsa.PublicKey, error)
- func ParsePublicKeyDER(publicKey []byte) ([]byte, error)
- func PrettyPrint(data interface{})
- func PrintDataInterface(data interface{})
- func ReadPrivateKeyFile(privateKeyFile, passwordFile string) (*rsa.PrivateKey, error)
- func ReadPublicKeyBytes(publicKeyFile string) ([]byte, error)
- func RemoveDuplicateValuesFromStringSlice(strSlice []string) []string
- func RemoveUnquotedSpaces(s string) (string, error)
- func SetAgentDetails(h handler, details map[string]interface{})
- func SetAgentDetailsKey(h handler, key, value string) error
- func StringSliceContains(items []string, s string) bool
- func ToString(v interface{}) string
- type Dialer
- type Encryptor
Constants ¶
const ( // DefaultKeepAliveInterval - default duration to send keep alive pings DefaultKeepAliveInterval = 50 * time.Second // DefaultKeepAliveTimeout - default keepalive timeout DefaultKeepAliveTimeout = 10 * time.Second )
const ( // AmplifyCentral amplify central AmplifyCentral = "Amplify Central" CentralHealthCheckEndpoint = "central" )
Variables ¶
This section is empty.
Functions ¶
func CheckEmptyMapStringString ¶
CheckEmptyMapStringString creates a new empty map if the provided map is nil
func ComputeHash ¶
ComputeHash - get the hash of the byte array sent in
func ComputeKIDFromDER ¶
ComputeKIDFromDER - compute key ID for public key
func ConvertTimeToMillis ¶
ConvertTimeToMillis - convert to milliseconds
func ConvertToDomainNameCompliant ¶
ConvertToDomainNameCompliant - converts string to be domain name complaint
func CreateDirIfNotExist ¶
func CreateDirIfNotExist(dirPath string)
CreateDirIfNotExist - Creates the directory with same permission as parent
func GetAgentDetailStrings ¶
GetAgentDetailStrings get all the values for the x-agent-details sub resource as string
func GetAgentDetails ¶
func GetAgentDetails(h handler) map[string]interface{}
GetAgentDetails get all the values for the x-agent-details sub resource
func GetAgentDetailsValue ¶
GetAgentDetailsValue gets a single string value fom the x-agent-details sub resource. Returns nil for error if x-agent-details does not exist. Returns errors if unable to perform type conversion. Returns an empty string if the value does not exist, or if there is an error.
func GetProxyURL ¶
GetProxyURL - need to provide my own function (instead of http.ProxyURL()) to handle empty url. Returning nil means "no proxy"
func GetStringArrayFromMapInterface ¶
GetStringArrayFromMapInterface - returns the validated string array for the map element
func GetStringFromMapInterface ¶
GetStringFromMapInterface - returns the validated string for the map element
func GetSubResourcePropertyValue ¶
GetSubResourcePropertyValue gets a single string value fom the specified sub resource. Returns nil for error if specified does not exist. Returns errors if unable to perform type conversion. Returns an empty string if the value does not exist, or if there is an error.
func GetURLHostName ¶
GetURLHostName - return the host name of the passed in URL
func HandleInterfaceFuncNotImplemented ¶
func HandleInterfaceFuncNotImplemented(obj interface{}, funcName, interfaceName string)
HandleInterfaceFuncNotImplemented - use this function to recover from a panic due to an interface not being implemented
func IsItemInSlice ¶
IsItemInSlice - Returns true if the given item is in the string slice, strSlice should be sorted
func LoadEnvFromFile ¶
LoadEnvFromFile - Loads the environment variables from a file
func MapStringInterfaceToStringString ¶
MapStringInterfaceToStringString - convert map[string]interface{} to map[string]string given the item can be a string
func MapStringStringToMapStringInterface ¶
MapStringStringToMapStringInterface converts a map[string]string to map[string]interface{}
func MaskValue ¶
MaskValue - mask sensitive information with * (asterisk). Length of sensitiveData to match returning maskedValue
func MergeMapStringInterface ¶
MergeMapStringInterface - merges the provided maps. If duplicate keys are found across the maps, then the keys in map n will be overwritten in keys in map n+1
func MergeMapStringString ¶
MergeMapStringString - merges the provided maps. If duplicate keys are found across the maps, then the keys in map n will be overwritten in keys in map n+1.
func NormalizeNameForCentral ¶ added in v1.1.35
func ParsePublicKey ¶
ParsePublicKey - parses the public key content
func ParsePublicKeyDER ¶
ParsePublicKeyDER - parse DER block from public key
func PrintDataInterface ¶
func PrintDataInterface(data interface{})
PrintDataInterface - prints contents of the interface only if in debug mode
func ReadPrivateKeyFile ¶
func ReadPrivateKeyFile(privateKeyFile, passwordFile string) (*rsa.PrivateKey, error)
ReadPrivateKeyFile - reads and parses the private key content
func ReadPublicKeyBytes ¶
ReadPublicKeyBytes - reads the public key bytes from file
func RemoveDuplicateValuesFromStringSlice ¶
RemoveDuplicateValuesFromStringSlice - remove duplicate values from a string slice
func RemoveUnquotedSpaces ¶
RemoveUnquotedSpaces - Remove all whitespace not between matching quotes
func SetAgentDetails ¶
func SetAgentDetails(h handler, details map[string]interface{})
SetAgentDetails creates a new x-agent-details sub resource for the given resource.
func SetAgentDetailsKey ¶
SetAgentDetailsKey sets a key value pair in the x-agent-details sub resource. If x-agent-details does not exist, it is created. If value is not a string or an int, an error will be returned.
func StringSliceContains ¶
StringSliceContains - does the given string slice contain the specified string?
Types ¶
type Dialer ¶
type Dialer interface { // Dial - interface used by libbeat for tcp network dial Dial(network string, addr string) (net.Conn, error) // DialContext - interface used by http transport DialContext(ctx context.Context, network string, addr string) (net.Conn, error) // GetProxyScheme() string GetProxyScheme() string }
Dialer - interface for http dialer for proxy and single entry point
type Encryptor ¶
Encryptor is an interface for encrypting strings
func NewEncryptor ¶
NewEncryptor creates a struct to handle encryption based on the provided key, algorithm, and hash.