models

package
v0.0.0-...-7eb9a28 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Db *sql.DB

Functions

func DeleteMovie

func DeleteMovie(id string) interface{}

func GetMovieById

func GetMovieById(id string) interface{}

func InitDB

func InitDB()

func Login

func Login(cred *http.Request) (*TokenOut, *ErrorOut)

Types

type ErrOut

type ErrOut struct {
	Error string `json:"error"`
}

func NewMovie

func NewMovie(r *http.Request) (string, *ErrOut)

func UpdateMovie

func UpdateMovie(r *http.Request, id string) (string, *ErrOut)

type ErrorOut

type ErrorOut struct {
	Error string `json:"error"`
}

func Register

func Register(r *http.Request) (string, *ErrorOut)

type Movie

type Movie struct {
	Id       int    `json:"id"`
	Name     string `json:"name"`
	Year     string `json:"year"`
	Director string `json:"director"`
	Created  string `json:"created"`
	Updated  string `json:"updated"`
}

func GetMovies

func GetMovies() []*Movie

type TokenOut

type TokenOut struct {
	Token string `json:"token"`
}

type User

type User struct {
	Id       int    `json:"id"`
	Name     string `json:"name"`
	Lastname string `json:"lastname"`
	Email    string `json:"email"`
	Password string `json:"password"`
	Role     string `json:"role"`
	Created  string `json:"created"`
	Updated  string `json:"updated"`
}

type UserCredentials

type UserCredentials struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

Jump to

Keyboard shortcuts

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