Sphire Mantis API Documentation

Sphire Mantis' API Documentation

View the Project on GitHub sphireinc/Mantis

Go Report Card Go Reference

data

import "github.com/sphireinc/mantis/data"

Index

Constants

Path enumerators File Directory

const (
    Path int = iota
    File
    Directory
)

func Exists

func Exists(path string, pathType int) (bool, error)

Exists determines whether a given Path, File, or Directory exists use constants:

Path int = iota
File
Directory

func GetEnvVariables

func GetEnvVariables() map[string]string

GetEnvVariables returns a map of all environment variables

func IsStringTrue

func IsStringTrue(str string) bool

IsStringTrue determines if a string is boolean true/false

func MapHasKey

func MapHasKey[T comparable](item map[T]any, key T) bool

MapHasKey contains checks if a map[T any]string has a given key T

func MapToString

func MapToString(mapInterface interface{}) (string, error)

MapToString takes a map[any]any and returns it as a string

func QueryJSON

func QueryJSON(obj string, query string) (interface{}, error)

QueryJSON queries a json object for a given path

func UnmarshalFile

func UnmarshalFile(filename string) (interface{}, error)

UnmarshalFile loads and unmarshals either a JSON or YAML file

Generated by gomarkdoc