client/

directory
v1.0.14 Latest Latest
Warning

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

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

Directories

Path Synopsis
Package cache provide a Cache interface and some implement engine Usage: import( "github.com/W3-Engineers-Ltd/Radiant/client/cache" ) bm, err := cache.NewCache("memory", `{"interval":60}`) Use it like this: bm.Put("astaxie", 1, 10 * time.Second) bm.Get("astaxie") bm.IsExist("astaxie") bm.Delete("astaxie") more docs http://radiant.me/docs/module/cache.md
Package cache provide a Cache interface and some implement engine Usage: import( "github.com/W3-Engineers-Ltd/Radiant/client/cache" ) bm, err := cache.NewCache("memory", `{"interval":60}`) Use it like this: bm.Put("astaxie", 1, 10 * time.Second) bm.Get("astaxie") bm.IsExist("astaxie") bm.Delete("astaxie") more docs http://radiant.me/docs/module/cache.md
memcache
Package memcache for cache provider depend on github.com/bradfitz/gomemcache/memcache go install github.com/bradfitz/gomemcache/memcache Usage: import( _ "github.com/W3-Engineers-Ltd/Radiant/client/cache/memcache" "github.com/W3-Engineers-Ltd/Radiant/client/cache" ) bm, err := cache.NewCache("memcache", `{"conn":"127.0.0.1:11211"}`) more docs http://radiant.me/docs/module/cache.md
Package memcache for cache provider depend on github.com/bradfitz/gomemcache/memcache go install github.com/bradfitz/gomemcache/memcache Usage: import( _ "github.com/W3-Engineers-Ltd/Radiant/client/cache/memcache" "github.com/W3-Engineers-Ltd/Radiant/client/cache" ) bm, err := cache.NewCache("memcache", `{"conn":"127.0.0.1:11211"}`) more docs http://radiant.me/docs/module/cache.md
redis
Package redis for cache provider depend on github.com/gomodule/redigo/redis go install github.com/gomodule/redigo/redis Usage: import( _ "github.com/W3-Engineers-Ltd/Radiant/client/cache/redis" "github.com/W3-Engineers-Ltd/Radiant/client/cache" ) bm, err := cache.NewCache("redis", `{"conn":"127.0.0.1:11211"}`) more docs http://radiant.me/docs/module/cache.md
Package redis for cache provider depend on github.com/gomodule/redigo/redis go install github.com/gomodule/redigo/redis Usage: import( _ "github.com/W3-Engineers-Ltd/Radiant/client/cache/redis" "github.com/W3-Engineers-Ltd/Radiant/client/cache" ) bm, err := cache.NewCache("redis", `{"conn":"127.0.0.1:11211"}`) more docs http://radiant.me/docs/module/cache.md
Package httplib is used as http.Client Usage: import "github.com/W3-Engineers-Ltd/Radiant/client/httplib" b := httplib.Post("http://radiant.me/") b.Param("username","astaxie") b.Param("password","123456") b.PostFile("uploadfile1", "httplib.pdf") b.PostFile("uploadfile2", "httplib.txt") str, err := b.String() if err != nil { t.Fatal(err) } fmt.Println(str) more docs http://radiant.me/docs/module/httplib.md
Package httplib is used as http.Client Usage: import "github.com/W3-Engineers-Ltd/Radiant/client/httplib" b := httplib.Post("http://radiant.me/") b.Param("username","astaxie") b.Param("password","123456") b.PostFile("uploadfile1", "httplib.pdf") b.PostFile("uploadfile2", "httplib.txt") str, err := b.String() if err != nil { t.Fatal(err) } fmt.Println(str) more docs http://radiant.me/docs/module/httplib.md
orm
Package orm provide ORM for MySQL/PostgreSQL/sqlite Simple Usage package main import ( "fmt" "github.com/W3-Engineers-Ltd/Radiant/client/orm" _ "github.com/go-sql-driver/mysql" // import your used driver ) // Model Struct type User struct { Id int `orm:"auto"` Name string `orm:"size(100)"` } func init() { orm.RegisterDataBase("default", "mysql", "root:root@/my_db?charset=utf8", 30) } func main() { o := orm.NewOrm() user := User{Name: "slene"} // insert id, err := o.Insert(&user) // update user.Name = "astaxie" num, err := o.Update(&user) // read one u := User{Id: user.Id} err = o.Read(&u) // delete num, err = o.Delete(&u) } more docs: http://radiant.me/docs/mvc/model/overview.md
Package orm provide ORM for MySQL/PostgreSQL/sqlite Simple Usage package main import ( "fmt" "github.com/W3-Engineers-Ltd/Radiant/client/orm" _ "github.com/go-sql-driver/mysql" // import your used driver ) // Model Struct type User struct { Id int `orm:"auto"` Name string `orm:"size(100)"` } func init() { orm.RegisterDataBase("default", "mysql", "root:root@/my_db?charset=utf8", 30) } func main() { o := orm.NewOrm() user := User{Name: "slene"} // insert id, err := o.Insert(&user) // update user.Name = "astaxie" num, err := o.Update(&user) // read one u := User{Id: user.Id} err = o.Read(&u) // delete num, err = o.Delete(&u) } more docs: http://radiant.me/docs/mvc/model/overview.md
migration
Package migration enables you to generate migrations back and forth.
Package migration enables you to generate migrations back and forth.

Jump to

Keyboard shortcuts

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