utils

package
v0.1.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hash

func Hash(b []byte) string

Hash a data string using SHA-256 and returns the checksum.

func HmacSHA256

func HmacSHA256(key []byte, data string) ([]byte, error)

Returns a HMAC hash

func HomeDir

func HomeDir() (string, error)

Get the path to the Home Directory, irrespective of underlying operating system

func ReadIniFile

func ReadIniFile(filename string) <-chan *Profile

Function to read .ini file and return a `Profile`

Types

type Profile

type Profile struct {
	Name string
	Map  map[string]string
}

Struct representing the contents of a config file as a

Profile.Name

and the Keys and values in a map,

Profile.Map

func ReadEnvFile

func ReadEnvFile(filename string) (*Profile, error)

Function to read .env file and return a `Profile`

Jump to

Keyboard shortcuts

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