goengine

package module
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: GPL-3.0 Imports: 20 Imported by: 3

README

goengine

github.com/satori/go.uuid github.com/go-redis/redis github.com/lib/pq gopkg.in/mgo.v2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnMongo

func ConnMongo(config *DbConf) *mongo.Database

func ConnPg

func ConnPg(config *DbConf) *sql.DB

func GenerateSid

func GenerateSid() string

func InitSessionManager

func InitSessionManager(storer SessionStore, sessName string, cookiePrefix string, sessionPrefix string, domain string) *sessionManager

Types

type ActionFunc

type ActionFunc func(http.ResponseWriter, *http.Request)

type DAO

type DAO struct {
	StmtMap map[string]*sql.Stmt
	// contains filtered or unexported fields
}

func InitDAO

func InitDAO(db *sql.DB) *DAO

func (*DAO) Prepare

func (this *DAO) Prepare(index string, query string)

type DbConf added in v0.1.4

type DbConf struct {
	User   string
	Passwd string
	Host   string
	Name   string
	Port   string
}

type FilterFunc

type FilterFunc func(http.ResponseWriter, *http.Request) bool

@return go on

type GoEngine

type GoEngine struct {
	// contains filtered or unexported fields
}

unix "golang.org/x/sys/unix"

func New

func New(sessionManager SessionManager) *GoEngine

func (*GoEngine) ListenTCP

func (this *GoEngine) ListenTCP(port string)

func (*GoEngine) ListenUnix

func (this *GoEngine) ListenUnix(addr string)

func (*GoEngine) Range

func (this *GoEngine) Range(res http.ResponseWriter, req *http.Request) bool

@return stop

func (*GoEngine) ServeHTTP

func (this *GoEngine) ServeHTTP(res http.ResponseWriter, req *http.Request)

func (*GoEngine) Use

func (this *GoEngine) Use(handle FilterFunc)

func (*GoEngine) UseRouter

func (this *GoEngine) UseRouter(router *HttpRoute)

type HttpAction

type HttpAction interface {
	Bind(*HttpRoute)
}

type HttpRoute

type HttpRoute struct {
	// contains filtered or unexported fields
}

func InitHttpRoute

func InitHttpRoute() *HttpRoute

func (*HttpRoute) Range

func (this *HttpRoute) Range(res http.ResponseWriter, req *http.Request) bool

@return stop

func (*HttpRoute) ServeHTTP

func (this *HttpRoute) ServeHTTP(res http.ResponseWriter, req *http.Request) bool

@return go on

func (*HttpRoute) Set

func (this *HttpRoute) Set(path string, handle ActionFunc)

func (*HttpRoute) SetRegexp

func (this *HttpRoute) SetRegexp(route *regexp.Regexp, handle ActionFunc)

func (*HttpRoute) SetWith

func (this *HttpRoute) SetWith(path string, handle ActionFunc)

func (*HttpRoute) Use

func (this *HttpRoute) Use(handle FilterFunc)

func (*HttpRoute) UseRouter

func (this *HttpRoute) UseRouter(path string, router *HttpRoute)

type NullTime

type NullTime struct {
	Time  time.Time
	Valid bool
}

func (*NullTime) Scan

func (this *NullTime) Scan(value interface{}) error

func (*NullTime) Value

func (this *NullTime) Value() (driver.Value, error)

type RedisStore

type RedisStore struct {
	// contains filtered or unexported fields
}

func NewRedisStore

func NewRedisStore(Addr string, Password string, DB int) *RedisStore

func (*RedisStore) Get

func (rs *RedisStore) Get(key string) (*map[string]interface{}, error)

func (*RedisStore) GetOnce added in v0.1.3

func (rs *RedisStore) GetOnce(key string) (*map[string]interface{}, error)

func (*RedisStore) Save

func (rs *RedisStore) Save(key string, store *map[string]interface{}, maxAge int) error

type Session

type Session struct {
	// contains filtered or unexported fields
}

*

  • @class Session
  • @author JamesWatson
  • @time 2017-06-10

func (*Session) Get

func (this *Session) Get(key string) interface{}

func (*Session) Save

func (this *Session) Save(res http.ResponseWriter, maxAge int) error

func (*Session) Set

func (this *Session) Set(key string, value interface{})

type SessionManager

type SessionManager interface {
	MaxAge() int
	Secure() bool
	Get(req *http.Request) *Session
	Save(session *Session, maxAge int) (*http.Cookie, error)
}

type SessionStore

type SessionStore interface {
	Get(string) (*map[string]interface{}, error)
	Save(string, *map[string]interface{}, int) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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