model

package
v0.0.0-...-c0306e0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllRole = []Role{
	RoleAdmin,
}

Functions

This section is empty.

Types

type Login

type Login struct {
	Email    string `json:"Email"`
	Password string `json:"Password"`
}

type Pagination

type Pagination interface {
	IsPagination()
}

type PasswordReset

type PasswordReset struct {
	Email    string `json:"Email"`
	Token    string `json:"Token"`
	Password string `json:"Password"`
}

type PasswordResetRequest

type PasswordResetRequest struct {
	Email string `json:"Email"`
}

type Register

type Register struct {
	Email string `json:"Email"`
}

type Role

type Role string
const (
	RoleAdmin Role = "ADMIN"
)

func (Role) IsValid

func (e Role) IsValid() bool

func (Role) MarshalGQL

func (e Role) MarshalGQL(w io.Writer)

func (Role) String

func (e Role) String() string

func (*Role) UnmarshalGQL

func (e *Role) UnmarshalGQL(v interface{}) error

type Team

type Team struct {
	ID          int                   `json:"ID" gorm:"primaryKey"`
	Name        string                `json:"Name"`
	Description string                `json:"Description"`
	Users       []*User               `json:"Users" gorm:"many2many:team_users;"`
	CreatedAt   int                   `json:"CreatedAt"`
	UpdatedAt   int                   `json:"UpdatedAt"`
	DeletedAt   soft_delete.DeletedAt ``
}

type TeamFilter

type TeamFilter struct {
	ID   *int    `json:"ID"`
	Name *string `json:"Name"`
}

type TeamMutation

type TeamMutation struct {
	Name        string `json:"Name"`
	Description string `json:"Description"`
}

type TeamResult

type TeamResult struct {
	Result     []*Team `json:"Result"`
	TotelPages int     `json:"TotelPages"`
	TotalRows  int     `json:"TotalRows"`
}

func (TeamResult) IsPagination

func (TeamResult) IsPagination()

type User

type User struct {
	ID        int                   `json:"ID" gorm:"primaryKey"`
	FirstName string                `json:"FirstName"`
	LastName  string                `json:"LastName"`
	Email     string                `json:"Email" gorm:"uniqueIndex"`
	Role      Role                  `json:"Role" sql:"type:ENUM('ADMIN')"`
	Hash      string                ``
	Verified  bool                  ``
	Token     string                `` // Token for account verificationand password resets
	Teams     []*Team               `json:"Teams" gorm:"many2many:team_users;"`
	CreatedAt int                   `json:"CreatedAt"`
	UpdatedAt int                   `json:"UpdatedAt"`
	DeletedAt soft_delete.DeletedAt ``
}

type UserFilter

type UserFilter struct {
	ID        int    `json:"ID" gorm:"primaryKey"`
	FirstName string `json:"FirstName"`
	LastName  string `json:"LastName"`
	Email     string `json:"Email"`
	Role      Role   `json:"Role" sql:"type:ENUM('ADMIN')"`
}

type UserMutation

type UserMutation struct {
	FirstName string `json:"FirstName,omitempty"`
	LastName  string `json:"LastName,omitempty"`
	Email     string `json:"Email,omitempty"`
	Role      Role   `json:"Role,omitempty" sql:"type:ENUM('ADMIN')"`
}

type UserResult

type UserResult struct {
	Result     []*User `json:"Result"`
	TotelPages int     `json:"TotelPages"`
	TotalRows  int     `json:"TotalRows"`
}

func (UserResult) IsPagination

func (UserResult) IsPagination()

type Verify

type Verify struct {
	Token string `json:"Token"`
}

Jump to

Keyboard shortcuts

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