azblob: switch to the new azure-go-sdk

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2022-02-20 14:43:24 +01:00
parent c19b03a3f7
commit d31cccf85f
4 changed files with 319 additions and 291 deletions

View File

@@ -145,12 +145,36 @@ func GetIPFromRemoteAddress(remoteAddress string) string {
// NilIfEmpty returns nil if the input string is empty
func NilIfEmpty(s string) *string {
if len(s) == 0 {
if s == "" {
return nil
}
return &s
}
// GetStringFromPointer returns the string value or empty if nil
func GetStringFromPointer(val *string) string {
if val == nil {
return ""
}
return *val
}
// GetIntFromPointer returns the int value or zero
func GetIntFromPointer(val *int64) int64 {
if val == nil {
return 0
}
return *val
}
// GetTimeFromPointer returns the time value or now
func GetTimeFromPointer(val *time.Time) time.Time {
if val == nil {
return time.Now()
}
return *val
}
// GenerateRSAKeys generate rsa private and public keys and write the
// private key to specified file and the public key to the specified
// file adding the .pub suffix