authen

package
v0.0.0-...-a4acd60 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2016 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAuthen

func CreateAuthen(w http.ResponseWriter, c *Context, authen *Authen)

func DMP

func DMP(w http.ResponseWriter, r *http.Request, c *Context)

func ListAuthen

func ListAuthen(w http.ResponseWriter, c *Context)

func Login

func Login(w http.ResponseWriter, c *Context, authen *Authen)

Types

type Authen

type Authen struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type Context

type Context struct {
	Render *render.Render
	DB     *DB
}

func NewContext

func NewContext(db *DB) *Context

func (*Context) RenderError

func (c *Context) RenderError(w http.ResponseWriter, msg string, err error)

func (*Context) RenderJSON

func (c *Context) RenderJSON(w http.ResponseWriter, msg interface{})

type DB

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

func NewDB

func NewDB(sqlPath string) (db *DB, err error)

func (*DB) Close

func (d *DB) Close()

func (*DB) CreateTable

func (d *DB) CreateTable() error

func (*DB) InsertAuthen

func (d *DB) InsertAuthen(username string, password string) error

func (*DB) ListAllAuthen

func (d *DB) ListAllAuthen() (authens []*Authen, err error)

func (*DB) QueryAuthen

func (d *DB) QueryAuthen(username string) (authen *Authen, err error)

type Msg

type Msg struct {
	MsgType string          `json:"type"`
	Body    json.RawMessage `json:"body"`
}

func (*Msg) ParseBody

func (m *Msg) ParseBody(bType interface{}) (err error)

Jump to

Keyboard shortcuts

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