models

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2016 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthenticateUser

func AuthenticateUser(username string, password string) bool

func InitDBConnection

func InitDBConnection() (err error)

Types

type DBConf

type DBConf struct {
	Host string `json:"host"`
	Port string `json:"port"`
	User string `json:"user"`
	Pass string `json:"pass"`
	Name string `json:"name"`
}

type Todo

type Todo struct {
	Id        int    `json:"id"`
	Title     string `json:"title"`
	Body      string `json:"body"`
	UserId    int
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

func GetTodo

func GetTodo(id int) (todo Todo, err error)

func GetTodoList

func GetTodoList() (todos []Todo, err error)

func GetTodoListFilteredByUserId

func GetTodoListFilteredByUserId(userId int) (todos []Todo, err error)

func (*Todo) Create

func (todo *Todo) Create() (err error)

func (*Todo) Delete

func (todo *Todo) Delete() (err error)

func (*Todo) Update

func (todo *Todo) Update() (err error)

type User

type User struct {
	Id        int       `json:"id"`
	Name      string    `json:"name"`
	Email     string    `json:"email"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

func GetUser

func GetUser(id int) (user User, err error)

func GetUserList

func GetUserList() (users []User, err error)

func (*User) Create

func (user *User) Create(password string) (err error)

func (*User) Delete

func (user *User) Delete() (err error)

func (*User) Update

func (user *User) Update() (err error)

Jump to

Keyboard shortcuts

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