utils

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package utils provides various utility functions

Index

Constants

This section is empty.

Variables

View Source
var Execmod int32 = 493 // decimal for 0755 octal

Functions

func BoolPtr

func BoolPtr(b bool) *bool

func Checksum

func Checksum(data []byte) string

Checksum returns a SHA256 checksum as string

func GetEnvVarValue

func GetEnvVarValue(varName string) (string, error)

GetEnvVarValue returns the value of the named env var. Return an empty string when not found.

func IniGetSectionNamesByPrefix

func IniGetSectionNamesByPrefix(cfg *ini.File, prefix string) []string

IniGetSectionNamesByPrefix gets Ini section names filtered by prefix

func IniSectionsChecksum

func IniSectionsChecksum(cfg *ini.File, names []string) string

IniSectionsChecksum takes one or more section name and compute a checkum

func Int32Ptr

func Int32Ptr(i int32) *int32

func MapEquals

func MapEquals(m1 *map[string]string, m2 *map[string]string) bool

func NewUUIDString

func NewUUIDString() string

NewUUIDString produce a UUID

func ParseString

func ParseString(text string, data any) (string, error)

ParseString function to easilly use templated string.

Pass the template text. And the data structure to be applied to the template

func Qty1Gi

func Qty1Gi() resource.Quantity

Qty1Gi produces a Quantity of 1GB value

Types

type SSHKey

type SSHKey struct {
	Pub  []byte
	Priv []byte
}

func MkSSHKey

func MkSSHKey() SSHKey

Jump to

Keyboard shortcuts

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