Directories ¶
Path | Synopsis |
---|---|
Package beego provide a MVC framework beego: an open-source, high-performance, modular, full-stack web framework It is used for rapid development of RESTful APIs, web apps and backend services in Go.
|
Package beego provide a MVC framework beego: an open-source, high-performance, modular, full-stack web framework It is used for rapid development of RESTful APIs, web apps and backend services in Go. |
captcha
Package captcha implements generation and verification of image CAPTCHAs.
|
Package captcha implements generation and verification of image CAPTCHAs. |
context
Package context provide the context utils Usage: import "github.com/beego/beego/v2/server/web/context" ctx := context.Context{Request:req,ResponseWriter:rw} more docs http://beego.me/docs/module/context.md
|
Package context provide the context utils Usage: import "github.com/beego/beego/v2/server/web/context" ctx := context.Context{Request:req,ResponseWriter:rw} more docs http://beego.me/docs/module/context.md |
filter/apiauth
Package apiauth provides handlers to enable apiauth support.
|
Package apiauth provides handlers to enable apiauth support. |
filter/auth
Package auth provides handlers to enable basic auth support.
|
Package auth provides handlers to enable basic auth support. |
filter/authz
Package authz provides handlers to enable ACL, RBAC, ABAC authorization support.
|
Package authz provides handlers to enable ACL, RBAC, ABAC authorization support. |
filter/cors
Package cors provides handlers to enable CORS support.
|
Package cors provides handlers to enable CORS support. |
grace
Package grace use to hot reload Description: http://grisha.org/blog/2014/06/03/graceful-restart-in-golang/ Usage: import( "log" "net/http" "os" "github.com/beego/beego/v2/server/web/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) }
|
Package grace use to hot reload Description: http://grisha.org/blog/2014/06/03/graceful-restart-in-golang/ Usage: import( "log" "net/http" "os" "github.com/beego/beego/v2/server/web/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) } |
session
Package session provider Usage: import( "github.com/beego/beego/v2/server/web/session" ) func init() { globalSessions, _ = session.NewManager("memory", `{"cookieName":"gosessionid", "enableSetCookie,omitempty": true, "gclifetime":3600, "maxLifetime": 3600, "secure": false, "cookieLifeTime": 3600, "providerConfig": ""}`) go globalSessions.GC() } more docs: http://beego.me/docs/module/session.md
|
Package session provider Usage: import( "github.com/beego/beego/v2/server/web/session" ) func init() { globalSessions, _ = session.NewManager("memory", `{"cookieName":"gosessionid", "enableSetCookie,omitempty": true, "gclifetime":3600, "maxLifetime": 3600, "secure": false, "cookieLifeTime": 3600, "providerConfig": ""}`) go globalSessions.GC() } more docs: http://beego.me/docs/module/session.md |
session/couchbase
Package couchbase for session provider depend on github.com/couchbaselabs/go-couchbasee go install github.com/couchbaselabs/go-couchbase Usage: import( _ "github.com/beego/beego/v2/server/web/session/couchbase" "github.com/beego/beego/v2/server/web/session" ) func init() { globalSessions, _ = session.NewManager("couchbase", “{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"http://host:port/, Pool, Bucket"}“) go globalSessions.GC() } more docs: http://beego.me/docs/module/session.md
|
Package couchbase for session provider depend on github.com/couchbaselabs/go-couchbasee go install github.com/couchbaselabs/go-couchbase Usage: import( _ "github.com/beego/beego/v2/server/web/session/couchbase" "github.com/beego/beego/v2/server/web/session" ) func init() { globalSessions, _ = session.NewManager("couchbase", “{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"http://host:port/, Pool, Bucket"}“) go globalSessions.GC() } more docs: http://beego.me/docs/module/session.md |
session/ledis
Package ledis provide session Provider
|
Package ledis provide session Provider |
session/memcache
Package memcache for session provider depend on github.com/bradfitz/gomemcache/memcache go install github.com/bradfitz/gomemcache/memcache Usage: import( _ "github.com/beego/beego/v2/server/web/session/memcache" "github.com/beego/beego/v2/server/web/session" ) func init() { globalSessions, _ = session.NewManager("memcache", “{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"127.0.0.1:11211"}“) go globalSessions.GC() } more docs: http://beego.me/docs/module/session.md
|
Package memcache for session provider depend on github.com/bradfitz/gomemcache/memcache go install github.com/bradfitz/gomemcache/memcache Usage: import( _ "github.com/beego/beego/v2/server/web/session/memcache" "github.com/beego/beego/v2/server/web/session" ) func init() { globalSessions, _ = session.NewManager("memcache", “{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"127.0.0.1:11211"}“) go globalSessions.GC() } more docs: http://beego.me/docs/module/session.md |
session/mysql
Package mysql for session provider depends on github.com/go-sql-driver/mysql: go install github.com/go-sql-driver/mysql mysql session support need create table as sql: CREATE TABLE `session` ( `session_key` char(64) NOT NULL, `session_data` blob, `session_expiry` int(11) unsigned NOT NULL, PRIMARY KEY (`session_key`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; Usage: import( _ "github.com/beego/beego/v2/server/web/session/mysql" "github.com/beego/beego/v2/server/web/session" ) func init() { globalSessions, _ = session.NewManager("mysql", “{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"[username[:password]@][protocol[(address)]]/dbname[?param1=value1&...¶mN=valueN]"}“) go globalSessions.GC() } more docs: http://beego.me/docs/module/session.md
|
Package mysql for session provider depends on github.com/go-sql-driver/mysql: go install github.com/go-sql-driver/mysql mysql session support need create table as sql: CREATE TABLE `session` ( `session_key` char(64) NOT NULL, `session_data` blob, `session_expiry` int(11) unsigned NOT NULL, PRIMARY KEY (`session_key`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; Usage: import( _ "github.com/beego/beego/v2/server/web/session/mysql" "github.com/beego/beego/v2/server/web/session" ) func init() { globalSessions, _ = session.NewManager("mysql", “{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"[username[:password]@][protocol[(address)]]/dbname[?param1=value1&...¶mN=valueN]"}“) go globalSessions.GC() } more docs: http://beego.me/docs/module/session.md |
session/postgres
Package postgres for session provider depends on github.com/lib/pq: go install github.com/lib/pq needs this table in your database: CREATE TABLE session ( session_key char(64) NOT NULL, session_data bytea, session_expiry timestamp NOT NULL, CONSTRAINT session_key PRIMARY KEY(session_key) ); will be activated with these settings in app.conf: SessionOn = true SessionProvider = postgresql SessionSavePath = "user=a password=b dbname=c sslmode=disable" SessionName = session Usage: import( _ "github.com/beego/beego/v2/server/web/session/postgresql" "github.com/beego/beego/v2/server/web/session" ) func init() { globalSessions, _ = session.NewManager("postgresql", “{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"user=pqgotest dbname=pqgotest sslmode=verify-full"}“) go globalSessions.GC() } more docs: http://beego.me/docs/module/session.md
|
Package postgres for session provider depends on github.com/lib/pq: go install github.com/lib/pq needs this table in your database: CREATE TABLE session ( session_key char(64) NOT NULL, session_data bytea, session_expiry timestamp NOT NULL, CONSTRAINT session_key PRIMARY KEY(session_key) ); will be activated with these settings in app.conf: SessionOn = true SessionProvider = postgresql SessionSavePath = "user=a password=b dbname=c sslmode=disable" SessionName = session Usage: import( _ "github.com/beego/beego/v2/server/web/session/postgresql" "github.com/beego/beego/v2/server/web/session" ) func init() { globalSessions, _ = session.NewManager("postgresql", “{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"user=pqgotest dbname=pqgotest sslmode=verify-full"}“) go globalSessions.GC() } more docs: http://beego.me/docs/module/session.md |
session/redis
Package redis for session provider depend on github.com/gomodule/redigo/redis go install github.com/gomodule/redigo/redis Usage: import( _ "github.com/beego/beego/v2/server/web/session/redis" "github.com/beego/beego/v2/server/web/session" ) func init() { globalSessions, _ = session.NewManager("redis", “{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"127.0.0.1:7070"}“) go globalSessions.GC() } more docs: http://beego.me/docs/module/session.md
|
Package redis for session provider depend on github.com/gomodule/redigo/redis go install github.com/gomodule/redigo/redis Usage: import( _ "github.com/beego/beego/v2/server/web/session/redis" "github.com/beego/beego/v2/server/web/session" ) func init() { globalSessions, _ = session.NewManager("redis", “{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"127.0.0.1:7070"}“) go globalSessions.GC() } more docs: http://beego.me/docs/module/session.md |
session/redis_cluster
Package redis for session provider depend on github.com/go-redis/redis go install github.com/go-redis/redis Usage: import( _ "github.com/beego/beego/v2/server/web/session/redis_cluster" "github.com/beego/beego/v2/server/web/session" ) func init() { globalSessions, _ = session.NewManager("redis_cluster", “{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"127.0.0.1:7070;127.0.0.1:7071"}“) go globalSessions.GC() } more docs: http://beego.me/docs/module/session.md
|
Package redis for session provider depend on github.com/go-redis/redis go install github.com/go-redis/redis Usage: import( _ "github.com/beego/beego/v2/server/web/session/redis_cluster" "github.com/beego/beego/v2/server/web/session" ) func init() { globalSessions, _ = session.NewManager("redis_cluster", “{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"127.0.0.1:7070;127.0.0.1:7071"}“) go globalSessions.GC() } more docs: http://beego.me/docs/module/session.md |
session/redis_sentinel
Package redis for session provider depend on github.com/go-redis/redis go install github.com/go-redis/redis Usage: import( _ "github.com/beego/beego/v2/server/web/session/redis_sentinel" "github.com/beego/beego/v2/server/web/session" ) func init() { globalSessions, _ = session.NewManager("redis_sentinel", “{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"127.0.0.1:26379;127.0.0.2:26379"}“) go globalSessions.GC() } more detail about params: please check the notes on the function SessionInit in this package
|
Package redis for session provider depend on github.com/go-redis/redis go install github.com/go-redis/redis Usage: import( _ "github.com/beego/beego/v2/server/web/session/redis_sentinel" "github.com/beego/beego/v2/server/web/session" ) func init() { globalSessions, _ = session.NewManager("redis_sentinel", “{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"127.0.0.1:26379;127.0.0.2:26379"}“) go globalSessions.GC() } more detail about params: please check the notes on the function SessionInit in this package |
swagger
Package swagger struct definition
|
Package swagger struct definition |
Click to show internal directories.
Click to hide internal directories.