model

package
v0.0.0-...-5c6460a Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllRole = []Role{
	RoleAdmin,
	RoleUser,
}
View Source
var AllTodoType = []TodoType{
	TodoTypeTypeA,
	TodoTypeTypeB,
}

Functions

This section is empty.

Types

type Category

type Category struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type NewTodoInput

type NewTodoInput struct {
	Text   string `json:"text"`
	UserID string `json:"userID"`
	Done   *bool  `json:"done"`
}

type OverlappingFields

type OverlappingFields struct {
	Foo    int
	NewFoo int
}

type Role

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

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 Todo

type Todo struct {
	ID     string `json:"id"`
	Text   string `json:"text"`
	Done   bool   `json:"done"`
	UserID string `json:"user"`
}

type TodoType

type TodoType string
const (
	TodoTypeTypeA TodoType = "TypeA"
	TodoTypeTypeB TodoType = "TypeB"
)

func (TodoType) IsValid

func (e TodoType) IsValid() bool

func (TodoType) MarshalGQL

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

func (TodoType) String

func (e TodoType) String() string

func (*TodoType) UnmarshalGQL

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

type UpdateTodoInput

type UpdateTodoInput struct {
	ID     string  `json:"id"`
	Text   *string `json:"text"`
	UserID *string `json:"userID"`
}

type User

type User struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	Role Role   `json:"role"`
}

func (User) HasRole

func (u User) HasRole(role Role) bool

Jump to

Keyboard shortcuts

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