Directories ¶
Path | Synopsis |
---|---|
Package cache provide a Cache interface and some implement engine Usage: import( "github.com/bhojpur/web/pkg/cache" ) bm, err := cache.NewCache("memory", `{"interval":60}`) Use it like this: bm.Put("bhojpur", 1, 10 * time.Second) bm.Get("bhojpur") bm.IsExist("bhojpur") bm.Delete("bhojpur")
|
Package cache provide a Cache interface and some implement engine Usage: import( "github.com/bhojpur/web/pkg/cache" ) bm, err := cache.NewCache("memory", `{"interval":60}`) Use it like this: bm.Put("bhojpur", 1, 10 * time.Second) bm.Get("bhojpur") bm.IsExist("bhojpur") bm.Delete("bhojpur") |
memcache
depend on github.com/bradfitz/gomemcache/memcache go install github.com/bradfitz/gomemcache/memcache Usage: import( _ "github.com/bhojpur/web/cache/memcache" "github.com/bhojpur/web/cache" ) bm, err := cache.NewCache("memcache", `{"conn":"127.0.0.1:11211"}`)
|
depend on github.com/bradfitz/gomemcache/memcache go install github.com/bradfitz/gomemcache/memcache Usage: import( _ "github.com/bhojpur/web/cache/memcache" "github.com/bhojpur/web/cache" ) bm, err := cache.NewCache("memcache", `{"conn":"127.0.0.1:11211"}`) |
redis
depend on github.com/gomodule/redigo/redis go install github.com/gomodule/redigo/redis Usage: import( _ "github.com/bhojpur/web/pkg/cache/redis" "github.com/bhojpur/web/pkg/cache" ) bm, err := cache.NewCache("redis", `{"conn":"127.0.0.1:11211"}`)
|
depend on github.com/gomodule/redigo/redis go install github.com/gomodule/redigo/redis Usage: import( _ "github.com/bhojpur/web/pkg/cache/redis" "github.com/bhojpur/web/pkg/cache" ) bm, err := cache.NewCache("redis", `{"conn":"127.0.0.1:11211"}`) |
Package httplib is used as http.Client Usage: import "github.com/bhojpur/web/pkg/httplib" b := httplib.Post("http://app.bhojpur.net/") b.Param("username","bhojpur") 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)
|
Package httplib is used as http.Client Usage: import "github.com/bhojpur/web/pkg/httplib" b := httplib.Post("http://app.bhojpur.net/") b.Param("username","bhojpur") 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) |
Click to show internal directories.
Click to hide internal directories.