Documentation ¶
Index ¶
- Variables
- func CreateTables(db *gorm.DB)
- func DropTables(db *gorm.DB)
- func InitDb(host, user, password, dbName string, debug bool) *gorm.DB
- func InitDbURI(connectionString string, debug bool) *gorm.DB
- func InitTestDb(host, user, password, dbName string, debug bool) *gorm.DB
- func InitTestDbURI(connectionString string, debug bool) *gorm.DB
- type PRIORITY
- type Todo
- type TodoList
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var TodoListType = graphql.NewObject( graphql.ObjectConfig{ Name: "TodoListType", Fields: graphql.Fields{ "id": &graphql.Field{ Type: graphql.String, }, "title": &graphql.Field{ Type: graphql.String, }, "created_at": &graphql.Field{ Type: graphql.String, }, "updated_at": &graphql.Field{ Type: graphql.String, }, }, }, )
View Source
var TodoType = graphql.NewObject( graphql.ObjectConfig{ Name: "TodoType", Fields: graphql.Fields{ "id": &graphql.Field{ Type: graphql.String, }, "title": &graphql.Field{ Type: graphql.String, }, "completed": &graphql.Field{ Type: graphql.Boolean, }, "note": &graphql.Field{ Type: graphql.String, }, "created_at": &graphql.Field{ Type: graphql.String, }, "updated_at": &graphql.Field{ Type: graphql.String, }, }, }, )
View Source
var UserType = graphql.NewObject( graphql.ObjectConfig{ Name: "User", Fields: graphql.Fields{ "id": &graphql.Field{ Type: graphql.String, }, "name": &graphql.Field{ Type: graphql.String, }, "email": &graphql.Field{ Type: graphql.String, }, "created_at": &graphql.Field{ Type: graphql.String, }, "updated_at": &graphql.Field{ Type: graphql.String, }, }, }, )
Functions ¶
func CreateTables ¶
func DropTables ¶
Types ¶
type Todo ¶
type Todo struct { ID uuid.UUID `gorm:"primary_key" form:"id" json:"id"` CreatedAt *time.Time `gorm:"not null" form:"created_at" json:"created_at,omitempty"` UpdatedAt *time.Time `gorm:"not null" form:"updated_at" json:"updated_at,omitempty"` Title string `gorm:"not null" form:"title" json:"title" binding:"required"` Completed bool `gorm:"not null" form:"completed" json:"completed"` Note string `gorm:"not null" form:"note" json:"note"` TodoListID uuid.UUID `gorm:"index" form:"todo_list_id" json:"todo_list_id"` UserID uuid.UUID `gorm:"index" form:"user_id" json:"user_id"` DeadLineAt *time.Time `gorm:"index" form:"dead_line_at" json:"dead_line_at,omitempty"` Priority PRIORITY `gorm:"index" form:"priority" json:"priority"` }
type TodoList ¶
type TodoList struct { ID uuid.UUID `gorm:"primary_key" form:"id" json:"id"` CreatedAt *time.Time `gorm:"not null" form:"created_at" json:"created_at,omitempty"` UpdatedAt *time.Time `gorm:"not null" form:"updated_at" json:"updated_at,omitempty"` Title string `gorm:"not null" form:"title" json:"title" binding:"required"` UserID uuid.UUID `gorm:"index" form:"user_id" json:"user_id"` }
type User ¶
type User struct { ID uuid.UUID `gorm:"primary_key" form:"id" json:"id"` CreatedAt *time.Time `gorm:"not null" form:"created_at" json:"created_at,omitempty"` UpdatedAt *time.Time `gorm:"not null" form:"updated_at" json:"updated_at,omitempty"` Name string `gorm:"not null" form:"name" json:"name"` Email string `gorm:"type:varchar(100);unique_index" form:"email" json:"email" binding:"required"` Password string `gorm:"not null" form:"password" json:"password" binding:"required"` }
Click to show internal directories.
Click to hide internal directories.