Documentation
¶
Index ¶
- Constants
- Variables
- func NewCookieStorer(cookieStoreKey []byte, isSecure bool) abclientstate.CookieStorer
- func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
- func NewSessionStorer(cookieName string, sessionStoreKey []byte) abclientstate.SessionStorer
- type Action
- type ComplexityRoot
- type Config
- type CtxUserID
- type DirectiveRoot
- type Label
- type LabelAction
- type MutationResolver
- type Note
- type NotesInput
- type QueryResolver
- type Resolver
- type ResolverRoot
- type SQLiteStorer
- type SubscriptionResolver
- type Todo
- type TodoAction
- type User
Constants ¶
View Source
const ( // MsgNotAuthenticated is the constant for Not Authenticated message MsgNotAuthenticated string = "NotAuthenticated" // CtxUserIDKey holds the key for 'userid' value CtxUserIDKey CtxUserID = "userid" // IDSize is the size of the UIDs generated for DB columns IDSize int = 4 )
Variables ¶
View Source
var AllAction = []Action{ ActionCreated, ActionDeleted, ActionUpdated, }
Functions ¶
func NewCookieStorer ¶
func NewCookieStorer(cookieStoreKey []byte, isSecure bool) abclientstate.CookieStorer
func NewExecutableSchema ¶
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
func NewSessionStorer ¶
func NewSessionStorer(cookieName string, sessionStoreKey []byte) abclientstate.SessionStorer
Types ¶
type ComplexityRoot ¶
type ComplexityRoot struct {
Label struct {
ID func(childComplexity int) int
Name func(childComplexity int) int
}
LabelAction struct {
Action func(childComplexity int) int
Label func(childComplexity int) int
}
Mutation struct {
CopyTodo func(childComplexity int, sourceID string) int
CreateLabel func(childComplexity int, name string) int
CreateTodo func(childComplexity int, title string, notes []string, labels []*string, color *string, isCheckboxMode *bool) int
DeleteLabel func(childComplexity int, id string) int
DeleteTodo func(childComplexity int, id string) int
UpdateTodo func(childComplexity int, id string, title *string, notes []*NotesInput, labels []*string, color *string, isCheckboxMode *bool) int
UpdateUser func(childComplexity int, listMode *bool, darkMode *bool) int
}
Note struct {
IsCompleted func(childComplexity int) int
Text func(childComplexity int) int
}
Query struct {
Labels func(childComplexity int) int
Todos func(childComplexity int) int
User func(childComplexity int) int
}
Subscription struct {
LabelStream func(childComplexity int) int
TodoStream func(childComplexity int) int
}
Todo struct {
Color func(childComplexity int) int
ID func(childComplexity int) int
IsCheckboxMode func(childComplexity int) int
Labels func(childComplexity int) int
Notes func(childComplexity int) int
Title func(childComplexity int) int
}
TodoAction struct {
Action func(childComplexity int) int
Todo func(childComplexity int) int
}
User struct {
DarkMode func(childComplexity int) int
Email func(childComplexity int) int
ID func(childComplexity int) int
ListMode func(childComplexity int) int
Name func(childComplexity int) int
}
}
type Config ¶
type Config struct {
Resolvers ResolverRoot
Directives DirectiveRoot
Complexity ComplexityRoot
}
type DirectiveRoot ¶
type DirectiveRoot struct {
}
type LabelAction ¶
type MutationResolver ¶
type MutationResolver interface {
CreateTodo(ctx context.Context, title string, notes []string, labels []*string, color *string, isCheckboxMode *bool) (*Todo, error)
UpdateTodo(ctx context.Context, id string, title *string, notes []*NotesInput, labels []*string, color *string, isCheckboxMode *bool) (*Todo, error)
DeleteTodo(ctx context.Context, id string) (*Todo, error)
CopyTodo(ctx context.Context, sourceID string) (*Todo, error)
CreateLabel(ctx context.Context, name string) (*Label, error)
DeleteLabel(ctx context.Context, id string) (*Label, error)
UpdateUser(ctx context.Context, listMode *bool, darkMode *bool) (*User, error)
}
type NotesInput ¶
type QueryResolver ¶
type Resolver ¶
Resolver holds the Query, mutation and subscription resolvers
func (*Resolver) Mutation ¶
func (r *Resolver) Mutation() MutationResolver
Mutation returns an instance of mutationResolver
func (*Resolver) Query ¶
func (r *Resolver) Query() QueryResolver
Query returns an instance of queryResolver
func (*Resolver) Subscription ¶
func (r *Resolver) Subscription() SubscriptionResolver
Subscription returns an instance of subscriptionResolver
type ResolverRoot ¶
type ResolverRoot interface {
Mutation() MutationResolver
Query() QueryResolver
Subscription() SubscriptionResolver
}
type SQLiteStorer ¶
type SQLiteStorer struct {
authboss.CreatingServerStorer
DB *gorm.DB
}
func NewSQLiteStorer ¶
func NewSQLiteStorer(db *gorm.DB) *SQLiteStorer
type SubscriptionResolver ¶
type SubscriptionResolver interface {
TodoStream(ctx context.Context) (<-chan *TodoAction, error)
LabelStream(ctx context.Context) (<-chan *LabelAction, error)
}
type Todo ¶
type Todo struct {
ID string `json:"id"`
Title string `json:"title"`
Notes []*Note `json:"notes" gorm:"foreignkey:TodoID"` // has-many
Labels []*Label `json:"labels" gorm:"many2many:todos_labels"` // many-to-many
Color string `json:"color"`
IsCheckboxMode bool `json:"isCheckboxMode"`
UserID string `sql:"type:TEXT REFERENCES users(id) ON DELETE CASCADE"`
}
type TodoAction ¶
type User ¶
type User struct {
authboss.ArbitraryUser
ID string `json:"id"`
Name string `json:"name"`
Email string `json:"email"`
Password string `json:"password"`
ListMode bool `json:"listMode"`
DarkMode bool `json:"darkMode"`
Todos []*Todo `gorm:"foreignkey:UserID"` // has-many
Labels []*Label `gorm:"foreignkey:UserID"` // has-many
}
func (*User) GetArbitrary ¶
func (*User) GetPassword ¶
func (*User) PutArbitrary ¶
func (*User) PutPassword ¶
Click to show internal directories.
Click to hide internal directories.