utils

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2022 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheCountWithPrefix

func CacheCountWithPrefix(prefix string) (int, error)

func CacheDelete

func CacheDelete(prefix, key string) (err error)

func CacheDeleteWithPrefix

func CacheDeleteWithPrefix(prefix string) error

func CacheDeleteWithRawKey

func CacheDeleteWithRawKey(key string) (err error)

func CacheFindExistingKey

func CacheFindExistingKey(key string) bool

func CacheGet

func CacheGet(prefix, key string, v interface{}) (err error)

func CacheGetAllKey

func CacheGetAllKey(prefix string) (keys []string, err error)

func CacheGetString

func CacheGetString(prefix, key string) (value string, err error)

func CacheGetWithRawKey

func CacheGetWithRawKey(key string, v interface{}) (err error)

func CacheSet

func CacheSet(prefix, key string, v interface{}) (err error)

func CacheSetWithTimeDuration

func CacheSetWithTimeDuration(prefix, key string, v interface{}, t time.Duration) (err error)

func ExistingKeyInMap

func ExistingKeyInMap(in interface{}, key string) bool

func GenerateApiToken

func GenerateApiToken() (err error)

func GenerateSelfSignCert

func GenerateSelfSignCert()

func GetCacheValAsInt64

func GetCacheValAsInt64(key string, c *bigcache.BigCache) (v int64, err error)

func GetCacheValAsString

func GetCacheValAsString(key string, c *bigcache.BigCache) (v string, err error)

func GetEgressInterfaceIpv4Addr

func GetEgressInterfaceIpv4Addr() (addr string, err error)

func GetSecureInterfaceIpv4Addr

func GetSecureInterfaceIpv4Addr() (addr string, err error)

func Int64ToString

func Int64ToString(s int64) (v string)

func InterfaceToMap

func InterfaceToMap(in interface{}) map[string]interface{}

func InterfaceToString

func InterfaceToString(v interface{}) (s string, err error)

func IsIpv4

func IsIpv4(ip string) bool

func IsRootPrivilege

func IsRootPrivilege() (v bool)

func ParseURL

func ParseURL(link string) (schema, host, port string, err error)

func RedisCache

func RedisCache() *redis.Client

func ResolveAllIp

func ResolveAllIp(hostname string) (address []string, err error)

func ResolveIp

func ResolveIp(hostname string) (address string, err error)

func SecretGenerator

func SecretGenerator(l int) string

func SetCacheFromInt64

func SetCacheFromInt64(key string, v int64, c *bigcache.BigCache) (err error)

func SetupCache

func SetupCache()

func StringContains

func StringContains(s []string, str string) bool

func StringToInt64

func StringToInt64(s string) (v int64, err error)

func Transcode

func Transcode(in, out interface{})

Types

type AppCredentialsType

type AppCredentialsType struct {
	APIToken string `yaml:"api_token"`
}
var (
	AppCredentials AppCredentialsType = AppCredentialsType{}
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL