Documentation
¶
Overview ¶
Package util $PF_IGNORE$ Code generated from files in client/src/svg. See https://projectforge.dev for details. DO NOT EDIT.
Index ¶
- Constants
- Variables
- func FromJSON(msg json.RawMessage, tgt interface{}) error
- func FromJSONInterface(msg json.RawMessage) (interface{}, error)
- func FromJSONReader(r io.Reader, tgt interface{}) error
- func FromJSONStrict(msg json.RawMessage, tgt interface{}) error
- func GetEnvStringWithDefault(envName string, defaultValue string) string
- func GetUUIDFromString(s string) *uuid.UUID
- func MicrosToMillis(i int) string
- func OxfordComma(names []string, separator string) string
- func Plural(count int, s string) string
- func PluralMaybe(s string, count int) string
- func RandomBool() bool
- func RandomBytes(size int) []byte
- func RandomInt(maxInclusive int) int
- func RandomString(length int) string
- func ReplaceEnvVars(s string, logger *zap.SugaredLogger) string
- func RunProcess(cmd string, path string, in io.Reader, out io.Writer, er io.Writer) (int, error)
- func RunProcessSimple(cmd string, path string) (int, string, error)
- func SplitAndTrim(s string, delim string) []string
- func SplitString(s string, sep byte, cutc bool) (string, string)
- func SplitStringLast(s string, sep byte, cutc bool) (string, string)
- func StringArrayContains(a []string, str string) bool
- func StringArrayCopy(a []string) []string
- func StringArrayFromInterfaces(a []interface{}, maxLength int) []string
- func StringArrayIndexOf(a []string, str string) int
- func StringArrayQuoted(a []string) []string
- func StringForms(s string) (string, string)
- func TimeFromJS(s string) (*time.Time, error)
- func TimeFromString(s string) (*time.Time, error)
- func TimeFromYMD(s string) (*time.Time, error)
- func TimeToString(d *time.Time) string
- func TimeToYMD(d *time.Time) string
- func TimerEnd(startNanos int64) int
- func TimerStart() int64
- func ToCamel(s string) string
- func ToJSON(x interface{}) string
- func ToJSONBytes(x interface{}, indent bool) []byte
- func ToJSONCompact(x interface{}) string
- func ToLowerCamel(s string) string
- func ToPlural(s string) string
- func ToSingular(s string) string
- func ToTitle(s string) string
- func UUID() uuid.UUID
- func UUIDP() *uuid.UUID
- type Diff
- type Diffs
- type ErrorDetail
- type ErrorFrame
- type ValueMap
- func (m ValueMap) Add(kvs ...interface{})
- func (m ValueMap) AsChanges() (ValueMap, error)
- func (m ValueMap) Clone() ValueMap
- func (m ValueMap) GetBool(k string) (bool, error)
- func (m ValueMap) GetInt64(k string, allowEmpty bool) (int64, error)
- func (m ValueMap) GetInteger(k string, allowEmpty bool) (int, error)
- func (m ValueMap) GetPath(path string) interface{}
- func (m ValueMap) GetRequired(k string) (interface{}, error)
- func (m ValueMap) GetString(k string, allowEmpty bool) (string, error)
- func (m ValueMap) GetStringArray(k string, allowMissing bool) ([]string, error)
- func (m ValueMap) GetStringOpt(k string) string
- func (m ValueMap) GetTime(k string) (*time.Time, error)
- func (m ValueMap) GetType(k string, ret interface{}) error
- func (m ValueMap) Keys() []string
- func (m ValueMap) KeysAndValues() ([]string, []interface{})
- func (m ValueMap) Merge(args ValueMap) ValueMap
- func (m ValueMap) SetPath(path string, val interface{}) interface{}
- func (m ValueMap) ToQueryString() string
- func (m ValueMap) Unset(s string)
Constants ¶
View Source
const ( AppKey = "projectforge" AppName = "Project Forge" AppSummary = "Build and maintain feature-rich applications using Golang" AppPort = 40000 AppContact = "Kyle U <kyle@kyleu.com>" AppURL = "https://projectforge.dev" AppSource = "https://github.com/kyleu/projectforge" AppLegal = `Built by <a href="mailto:kyle@kyleu.com">Kyle U</a>, all rights reserved` )
Variables ¶
View Source
var SVGIconKeys = []string{} /* 115 elements not displayed */
nolint
View Source
var SVGLibrary = map[string]string{}/* 116 elements not displayed */
nolint
Functions ¶
func FromJSON ¶
func FromJSON(msg json.RawMessage, tgt interface{}) error
func FromJSONInterface ¶
func FromJSONInterface(msg json.RawMessage) (interface{}, error)
func FromJSONReader ¶
func FromJSONStrict ¶
func FromJSONStrict(msg json.RawMessage, tgt interface{}) error
func GetEnvStringWithDefault ¶ added in v0.1.12
func GetUUIDFromString ¶
func MicrosToMillis ¶
func OxfordComma ¶
func PluralMaybe ¶
func RandomBool ¶
func RandomBool() bool
func RandomBytes ¶
func RandomString ¶
func ReplaceEnvVars ¶
func ReplaceEnvVars(s string, logger *zap.SugaredLogger) string
func RunProcess ¶
func SplitAndTrim ¶
func StringArrayContains ¶
func StringArrayCopy ¶
func StringArrayIndexOf ¶
func StringArrayQuoted ¶
func StringForms ¶
func TimeToString ¶
func TimerStart ¶
func TimerStart() int64
func ToJSONBytes ¶
func ToJSONCompact ¶
func ToJSONCompact(x interface{}) string
func ToLowerCamel ¶
func ToSingular ¶
Types ¶
type Diff ¶
type ErrorDetail ¶
type ErrorDetail struct {
Message string
StackTrace errors.StackTrace
Cause *ErrorDetail
}
func GetErrorDetail ¶
func GetErrorDetail(e error) *ErrorDetail
type ErrorFrame ¶
func TraceDetail ¶
func TraceDetail(trace errors.StackTrace) []ErrorFrame
type ValueMap ¶
type ValueMap map[string]interface{}
func RandomValueMap ¶
func ValueMapFor ¶
func ValueMapFor(kvs ...interface{}) ValueMap
func (ValueMap) GetRequired ¶
func (ValueMap) GetStringArray ¶
func (ValueMap) GetStringOpt ¶
func (ValueMap) KeysAndValues ¶
func (ValueMap) ToQueryString ¶
Click to show internal directories.
Click to hide internal directories.