gg_

package
v0.2.60 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: BSD-3-Clause Imports: 10 Imported by: 12

Documentation

Index

Constants

View Source
const (
	EventOnStartApp = "on_start_app"
	EventOnCloseApp = "on_close_app"
)
View Source
const (
	ModeProduction = "production"
	ModeDebug      = "debug"
)
View Source
const LibVersion = "0.2.59"

Variables

View Source
var AppName = "New Application"
View Source
var AppSalt = "this-is-token-to-encrypt"
View Source
var AppVersion = "0.1.0" // change this for a global AppName variable
View Source
var PanicSystemError = errors.New("panic_system_error")

Functions

func Get added in v0.2.60

func Get(m map[string]interface{}, path string) interface{}

func GetMap added in v0.2.60

func GetMap(m map[string]interface{}, path string) map[string]interface{}

func GetString added in v0.2.60

func GetString(m map[string]interface{}, path string) string

func IsArray added in v0.2.59

func IsArray[T any](val interface{}) (response []T, ok bool)

func IsArrayValue added in v0.2.60

func IsArrayValue(val interface{}) (bool, reflect.Value)

func IsArrayValueNotEmpty added in v0.2.60

func IsArrayValueNotEmpty(array interface{}) (bool, reflect.Value)

func IsMap added in v0.2.59

func IsMap[T any](val interface{}) (response map[string]T, ok bool)

func IsMapValue added in v0.2.60

func IsMapValue(val interface{}) (bool, reflect.Value)

func IsString added in v0.2.60

func IsString(val interface{}) (response string, ok bool)

func IsStringValue added in v0.2.60

func IsStringValue(val interface{}) (bool, reflect.Value)

func IsStructValue added in v0.2.60

func IsStructValue(val interface{}) (bool, reflect.Value)

func IsValidJson added in v0.2.59

func IsValidJson(text string) bool

func IsValidJsonArray added in v0.2.59

func IsValidJsonArray(text string) bool

func IsValidJsonObject added in v0.2.59

func IsValidJsonObject(text string) bool

func Map added in v0.2.60

func Map(val interface{}) (response map[string]interface{})

func Marshal added in v0.2.59

func Marshal(entity interface{}) []byte

func Quote added in v0.2.59

func Quote(v interface{}) string

func ReadBytesFromFile added in v0.2.59

func ReadBytesFromFile(fileName string) ([]byte, error)

func ReadTextFromFile added in v0.2.59

func ReadTextFromFile(fileName string) (string, error)

func Recover added in v0.2.25

func Recover(args ...interface{})

func String added in v0.2.59

func String(val interface{}) string

func Stringify added in v0.2.59

func Stringify(entity interface{}) string

func Unmarshal added in v0.2.59

func Unmarshal(input interface{}, entity interface{}) (err error)

func UnmarshalFromFile added in v0.2.59

func UnmarshalFromFile(fileName string, entity interface{}) error

func UnmarshalFromString added in v0.2.59

func UnmarshalFromString(s string, entity interface{}) (err error)

func ValueOf added in v0.2.59

func ValueOf(item interface{}) reflect.Value

Types

type ILogger

type ILogger interface {
	Panic(args ...interface{})
	Error(args ...interface{})
	Warn(args ...interface{})
	Info(args ...interface{})
	Debug(args ...interface{})
	Trace(args ...interface{})
}

type IName added in v0.2.59

type IName interface {
	Name() string
}

type ISerializable added in v0.2.59

type ISerializable interface {
	String() string
	Map() map[string]interface{}
}

type ModelDataWrapper added in v0.2.60

type ModelDataWrapper struct {
	Uid         string                 `json:"uid"`
	Group       string                 `json:"group"`
	Name        string                 `json:"name"`
	Description string                 `json:"description"`
	Payload     map[string]interface{} `json:"payload"`
	// contains filtered or unexported fields
}

ModelDataWrapper is a serializable object useful for data transport

func NewDataWrapper added in v0.2.60

func NewDataWrapper(data ...interface{}) (instance *ModelDataWrapper)

func (*ModelDataWrapper) Data added in v0.2.60

func (instance *ModelDataWrapper) Data(values ...interface{}) (response map[string]interface{})

func (*ModelDataWrapper) Error added in v0.2.60

func (instance *ModelDataWrapper) Error() error

func (*ModelDataWrapper) HasError added in v0.2.60

func (instance *ModelDataWrapper) HasError() bool

func (*ModelDataWrapper) Map added in v0.2.60

func (instance *ModelDataWrapper) Map() map[string]interface{}

func (*ModelDataWrapper) Reload added in v0.2.60

func (instance *ModelDataWrapper) Reload(values ...interface{}) *ModelDataWrapper

func (*ModelDataWrapper) Source added in v0.2.60

func (instance *ModelDataWrapper) Source() (response []interface{})

Source return original data

func (*ModelDataWrapper) String added in v0.2.60

func (instance *ModelDataWrapper) String() string

Jump to

Keyboard shortcuts

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