core/

directory
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2022 License: LGPL-3.0

Directories

Path Synopsis
Package admin healthcheck type DatabaseCheck struct { } func (dc *DatabaseCheck) Check() error { if dc.isConnected() { return nil } else { return errors.New("can't connect database") } } AddHealthCheck("database",&DatabaseCheck{}) more docs: http://radiant.me/docs/module/toolbox.md
Package admin healthcheck type DatabaseCheck struct { } func (dc *DatabaseCheck) Check() error { if dc.isConnected() { return nil } else { return errors.New("can't connect database") } } AddHealthCheck("database",&DatabaseCheck{}) more docs: http://radiant.me/docs/module/toolbox.md
bean is a basic package it should not depend on other modules except common module, log module and config module
bean is a basic package it should not depend on other modules except common module, log module and config module
Package config is used to parse config.
Package config is used to parse config.
env
Package env is used to parse environment.
Package env is used to parse environment.
xml
Package xml for config provider.
Package xml for config provider.
yaml
Package yaml for config provider Usage: import( _ "github.com/W3-Engineers-Ltd/Radiant/core/config/yaml" "github.com/W3-Engineers-Ltd/Radiant/core/config" ) cnf, err := config.NewConfig("yaml", "config.yaml") More docs http://radiant.me/docs/module/config.md
Package yaml for config provider Usage: import( _ "github.com/W3-Engineers-Ltd/Radiant/core/config/yaml" "github.com/W3-Engineers-Ltd/Radiant/core/config" ) cnf, err := config.NewConfig("yaml", "config.yaml") More docs http://radiant.me/docs/module/config.md
Package logs provide a general log interface Usage: import "github.com/W3-Engineers-Ltd/Radiant/core/logs" log := NewLogger(10000) log.SetLogger("console", "") > the first params stand for how many channel Use it like this: log.Trace("trace") log.Info("info") log.Warn("warning") log.Debug("debug") log.Critical("critical") more docs http://radiant.me/docs/module/logs.md
Package logs provide a general log interface Usage: import "github.com/W3-Engineers-Ltd/Radiant/core/logs" log := NewLogger(10000) log.SetLogger("console", "") > the first params stand for how many channel Use it like this: log.Trace("trace") log.Info("info") log.Warn("warning") log.Debug("debug") log.Critical("critical") more docs http://radiant.me/docs/module/logs.md
alils
Package alils implements the SDK(v0.5.0) of Simple Log Service(abbr.
Package alils implements the SDK(v0.5.0) of Simple Log Service(abbr.
es
pagination
Package pagination provides utilities to setup a paginator within the context of a http request.
Package pagination provides utilities to setup a paginator within the context of a http request.
Package validation for validations import ( "github.com/W3-Engineers-Ltd/Radiant/core/validation" "log" ) type User struct { Name string Age int } func main() { u := User{"man", 40} valid := validation.Validation{} valid.Required(u.Name, "name") valid.MaxSize(u.Name, 15, "nameMax") valid.Range(u.Age, 0, 140, "age") if valid.HasErrors() { // validation does not pass // print invalid message for _, err := range valid.Errors { log.Println(err.Key, err.Message) } } // or use like this if v := valid.Max(u.Age, 140, "ageMax"); !v.Ok { log.Println(v.Error.Key, v.Error.Message) } } more info: http://radiant.me/docs/mvc/controller/validation.md
Package validation for validations import ( "github.com/W3-Engineers-Ltd/Radiant/core/validation" "log" ) type User struct { Name string Age int } func main() { u := User{"man", 40} valid := validation.Validation{} valid.Required(u.Name, "name") valid.MaxSize(u.Name, 15, "nameMax") valid.Range(u.Age, 0, 140, "age") if valid.HasErrors() { // validation does not pass // print invalid message for _, err := range valid.Errors { log.Println(err.Key, err.Message) } } // or use like this if v := valid.Max(u.Age, 140, "ageMax"); !v.Ok { log.Println(v.Error.Key, v.Error.Message) } } more info: http://radiant.me/docs/mvc/controller/validation.md

Jump to

Keyboard shortcuts

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