pkg

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// VERSION represent Bhojpur Web - Application Framework version.
	VERSION = "2.2.0"
)

Variables

View Source
var (
	BuildVersion     string
	BuildGitRevision string
	BuildStatus      string
	BuildTag         string
	BuildTime        string

	GoVersion string
	GitBranch string
)

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
used to keep compatible with v1.x
used to keep compatible with v1.x
cache
Package cache provide a Cache interface and some implement engine Usage: import( "github.com/bhojpur/web/pkg/adapter/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/adapter/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")
cache/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"}`)
config
Usage: import "github.com/bhojpur/web/pkg/core/config" Examples.
Usage: import "github.com/bhojpur/web/pkg/core/config" Examples.
config/xml
depend on github.com/bhojpur/web/pkg/x2j.
depend on github.com/bhojpur/web/pkg/x2j.
config/yaml
depend on github.com/bhojpur/web/pkg/core/config/yaml go install github.com/bhojpur/web Usage: import( _ "github.com/bhojpur/web/pkg/adapter/config/yaml" "github.com/bhojpur/web/pkg/config" ) cnf, err := config.NewConfig("yaml", "config.yaml")
depend on github.com/bhojpur/web/pkg/core/config/yaml go install github.com/bhojpur/web Usage: import( _ "github.com/bhojpur/web/pkg/adapter/config/yaml" "github.com/bhojpur/web/pkg/config" ) cnf, err := config.NewConfig("yaml", "config.yaml")
grace
Usage: import( "log" "net/http" "os" "github.com/bhojpur/web/pkg/grace" ) func handler(w http.ResponseWriter, r *http.Request) { w.Write([]byte("WORLD!")) } func main() { mux := http.NewServeMux() mux.HandleFunc("/hello", handler) err := grace.ListenAndServe("localhost:8080", mux) if err != nil { log.Println(err) } log.Println("Server on 8080 stopped") os.Exit(0) }
Usage: import( "log" "net/http" "os" "github.com/bhojpur/web/pkg/grace" ) func handler(w http.ResponseWriter, r *http.Request) { w.Write([]byte("WORLD!")) } func main() { mux := http.NewServeMux() mux.HandleFunc("/hello", handler) err := grace.ListenAndServe("localhost:8080", mux) if err != nil { log.Println(err) } log.Println("Server on 8080 stopped") os.Exit(0) }
httplib
Usage: import "github.com/bhojpur/web/pkg/client/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)
Usage: import "github.com/bhojpur/web/pkg/client/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)
logs
Usage: import "github.com/bhojpur/web/pkg/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")
Usage: import "github.com/bhojpur/web/pkg/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")
api
v1
client
cache
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")
cache/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"}`)
cache/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"}`)
httplib
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)
orm
core
x2j
filter

Jump to

Keyboard shortcuts

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