utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExistingInArray

func ExistingInArray(in interface{}, f interface{}) bool

func ExistingKeyInMap

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

func FetchBingImage

func FetchBingImage() (img string, copyright string, err error)

func GenerateSelfSignCert

func GenerateSelfSignCert()

func GenerateSelfSignCertWithErrorHandle

func GenerateSelfSignCertWithErrorHandle() error

func GetEgressInterfaceIpv4Addr

func GetEgressInterfaceIpv4Addr() (addr string, err error)

func GetSecureInterfaceIpv4Addr

func GetSecureInterfaceIpv4Addr() (addr string, err error)

func GetTimeZone

func GetTimeZone() (loc *time.Location)

func HttpJSONRequestWithBytesResponse

func HttpJSONRequestWithBytesResponse(method, fullURL, token string, requestData io.Reader) ([]byte, error)

func HttpPing

func HttpPing(method, fullUrl string) bool

func HttpPingWithCheckStatusCode

func HttpPingWithCheckStatusCode(method, fullUrl string, checkWithStatusCode int) bool

func HttpRequestWithBytesResponse

func HttpRequestWithBytesResponse(r types.HttpRequestType) ([]byte, error)

func Int64ToString

func Int64ToString(s int64) (v string)

func InterfaceToMap

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

func InterfaceToString

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

func Ipv4InCidr

func Ipv4InCidr(cidr, ip string) bool

func IsIpv4

func IsIpv4(ip string) bool

func IsPrivateIPAddress

func IsPrivateIPAddress(ip string) bool

func IsRootPrivilege

func IsRootPrivilege() (v bool)

func ParseURL

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

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 Sha512encode

func Sha512encode(w string) string

func StringContains

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

func StringToInt64

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

func StringToUInt64

func StringToUInt64(s string) (v uint64, err error)

func StructToMap

func StructToMap(in any, snakeKey bool) map[string]any

func Transcode

func Transcode(in, out interface{})

func ValidTimeZone

func ValidTimeZone(tz string) bool

func VerifyTimeZone

func VerifyTimeZone()

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