common

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WritePermissions = 0600
)

Variables

View Source
var (
	ErrNotFound             = errors.New("Not found")
	ErrMissingRequiredParam = errors.New("Required param missing value")
	ErrMoreChoices          = errors.New("There are additional choices")
	ErrNoSuchModule         = errors.New("Module not found")
	ErrNoSuchCommand        = errors.New("Command not found")
	ErrNoSuchSubCommand     = errors.New("Subcommand not found")
	ErrUnexpectedStatus     = errors.New("Unexpected status code")
)

Functions

func GetJsonString

func GetJsonString(r interface{}) string

func OpenFile

func OpenFile(name string) (*os.File, error)

func ReadFile

func ReadFile(name string) ([]byte, error)

read file and return bytes uses filepath.Clean for gosec error G304

func TryUnmarshalJson

func TryUnmarshalJson(str *string) (*json.RawMessage, error)

check if a given string is valid json if valid, returns raw bytes of unmarshalled json

func WriteFile

func WriteFile(name string, data []byte) error

address gosec write permissions address gosec filename variable warnings

Types

type Input

type Input map[string]interface{}

type Values

type Values map[string]*string

Jump to

Keyboard shortcuts

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