util

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertMapToString

func ConvertMapToString(item map[string]string) (string, error)

ConvertMapToString converts a map to a string

func ConvertStringToMap

func ConvertStringToMap(item string) (map[string]string, error)

ConvertStringToMap converts a string into a map

func ConvertToJSON

func ConvertToJSON(item interface{}) (string, error)

ConvertToJSON convert object to json

func GetUUID4

func GetUUID4() string

GetUUID4 get the UUID v4

func InArray

func InArray(str string, arr []string) bool

InArray validates if a string in array

func IsEmpty

func IsEmpty(item string) bool

IsEmpty validate if string is empty or not

func LoadFromJSON

func LoadFromJSON(item interface{}, data []byte) error

LoadFromJSON update object from json

Types

type Map

type Map struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Map type

func NewMap

func NewMap() Map

NewMap creates a new instance of Map

func (*Map) Delete

func (cm *Map) Delete(key string)

Delete deletes a key

func (*Map) Get

func (cm *Map) Get(key string) (interface{}, bool)

Get a key from a concurrent map

func (*Map) Set

func (cm *Map) Set(key string, value interface{})

Set a key in a concurrent map

type Terminal

type Terminal struct{}

Terminal type

func (*Terminal) Exec

func (t *Terminal) Exec(comm string, options string) error

Exec execute a command

Jump to

Keyboard shortcuts

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