model

package
v0.0.0-...-4ec4997 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalTimestamp

func MarshalTimestamp(t time.Time) graphql.Marshaler

func UnmarshalTimestamp

func UnmarshalTimestamp(v interface{}) (time.Time, error)

Types

type BaseModel

type BaseModel interface {
	IsBaseModel()
}

type NewRole

type NewRole struct {
	Name        string  `json:"name"`
	Description *string `json:"description"`
}

type NewTodo

type NewTodo struct {
	Text        string     `json:"text"`
	UserID      string     `json:"userId"`
	UserIds     []string   `json:"userIds"`
	Description *string    `json:"description"`
	End         *time.Time `json:"end"`
	Start       time.Time  `json:"start"`
}

type NewUser

type NewUser struct {
	Username  string   `json:"username"`
	Password1 string   `json:"password1"`
	Password2 string   `json:"password2"`
	Email     string   `json:"email"`
	Biography *string  `json:"biography"`
	Roles     []string `json:"roles"`
}

type Role

type Role struct {
	ID          string     `json:"id" rethinkdb:"id,omitempty" redis:"id,omitempty"`
	Name        string     `json:"name" rethinkdb:"name" redis:"name"`
	Description *string    `json:"description" rethinkdb:"description" redis:"description"`
	CreatedAt   *time.Time `json:"created_at" rethinkdb:"created_at"`
	UpdatedAt   *time.Time `json:"updated_at" rethinkdb:"updated_at"`
	Slug        *string    `json:"slug" rethinkdb:"slug"`
}

func (Role) IsBaseModel

func (Role) IsBaseModel()

func (Role) IsSearchResult

func (Role) IsSearchResult()

func (*Role) MarshalBinary

func (r *Role) MarshalBinary() ([]byte, error)

func (*Role) String

func (r *Role) String() string

func (*Role) UnmarshalBinary

func (r *Role) UnmarshalBinary(data []byte) error

type SearchResult

type SearchResult interface {
	IsSearchResult()
}

type Todo

type Todo struct {
	ID          string     `json:"id" rethinkdb:"id,omitempty" redis:"id,omitempty"`
	Description *string    `json:"description" rethinkdb:"description" redis:"description"`
	Text        string     `json:"text" rethinkdb:"text" redis:"text"`
	Done        bool       `json:"done" rethinkdb:"done" redis:"done"`
	User        *User      `json:"user" rethinkdb:"user" redis:"user"`
	UserID      string     `json:"user_id" rethinkdb:"user_id,omitempty" redis:"user_id,omitempty"`
	Assigned    []*User    `json:"assigned" rethinkdb:"assigned" redis:"assigned"`
	AssignedIDs []string   `json:"assigned_ids" rethinkdb:"assigned_ids,omitempty" redis:"assigned_ids,omitempty"`
	CreatedAt   *time.Time `json:"created_at" rethinkdb:"created_at"`
	UpdatedAt   *time.Time `json:"updated_at" rethinkdb:"updated_at"`
	Slug        *string    `json:"slug" rethinkdb:"slug,omitempty"`
	Start       time.Time  `json:"start" rethinkdb:"start"`
	End         *time.Time `json:"end" rethinkdb:"end"`
}

func (Todo) IsBaseModel

func (Todo) IsBaseModel()

func (Todo) IsSearchResult

func (Todo) IsSearchResult()

func (*Todo) MarshalBinary

func (t *Todo) MarshalBinary() ([]byte, error)

func (*Todo) UnmarshalBinary

func (t *Todo) UnmarshalBinary(data []byte) error

type UpdateRole

type UpdateRole struct {
	ID          string  `json:"id"`
	Name        string  `json:"name"`
	Description *string `json:"description"`
}

type UpdateTodo

type UpdateTodo struct {
	ID          string     `json:"id"`
	Text        string     `json:"text"`
	UserID      string     `json:"userId"`
	UserIds     []string   `json:"userIds"`
	Description *string    `json:"description"`
	End         *time.Time `json:"end"`
	Start       time.Time  `json:"start"`
}

type UpdateUser

type UpdateUser struct {
	ID          string   `json:"id"`
	Username    string   `json:"username"`
	OldPassword string   `json:"oldPassword"`
	Password1   string   `json:"password1"`
	Password2   string   `json:"password2"`
	Email       string   `json:"email"`
	Biography   *string  `json:"biography"`
	Roles       []string `json:"roles"`
}

type User

type User struct {
	ID        string     `json:"id" rethinkdb:"id,omitempty" redis:"id,omitempty"`
	Username  string     `json:"username" rethinkdb:"username" redis:"username"`
	Slug      *string    `json:"slug" rethinkdb:"slug"`
	Email     string     `json:"email" rethinkdb:"email" redis:"email"`
	Password  string     `json:"-" rethinkdb:"password" redis:"password"`
	Biography *string    `json:"biography" rethinkdb:"biography,omitempty" redis:"biography,omitempty"`
	Roles     []*Role    `json:"roles" rethinkdb:"roles" redis:"roles"`
	RoleIDs   []string   `json:"role_ids" rethinkdb:"role_ids" redis:"role_ids"`
	LastLogin *time.Time `json:"last_login" rethinkdb:"last_login"`
	CreatedAt *time.Time `json:"created_at" rethinkdb:"created_at"`
	UpdatedAt *time.Time `json:"updated_at" rethinkdb:"updated_at"`
}

func (User) IsBaseModel

func (User) IsBaseModel()

func (User) IsSearchResult

func (User) IsSearchResult()

func (*User) MarshalBinary

func (u *User) MarshalBinary() ([]byte, error)

func (*User) String

func (u *User) String() string

func (*User) UnmarshalBinary

func (u *User) UnmarshalBinary(data []byte) error

Jump to

Keyboard shortcuts

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