Documentation
¶
Index ¶
- type CtxKey
- type Post
- type Reaction
- func (rsv *Reaction) Author(ctx context.Context) (*User, error)
- func (rsv *Reaction) Creation() graphql.Time
- func (rsv *Reaction) Emotion() string
- func (rsv *Reaction) ID() store.ID
- func (rsv *Reaction) Message() string
- func (rsv *Reaction) Reactions(ctx context.Context) ([]*Reaction, error)
- func (rsv *Reaction) Subject(ctx context.Context) (*ReactionSubject, error)
- type ReactionSubject
- type Resolver
- func (rsv *Resolver) Authenticate(ctx context.Context, params struct{ ... }) (*Session, error)
- func (rsv *Resolver) CloseAllSessions(ctx context.Context, params struct{ ... }) ([]string, error)
- func (rsv *Resolver) CloseSession(ctx context.Context, params struct{ ... }) (bool, error)
- func (rsv *Resolver) CreatePost(ctx context.Context, params struct{ ... }) (*Post, error)
- func (rsv *Resolver) CreateReaction(ctx context.Context, params struct{ ... }) (*Reaction, error)
- func (rsv *Resolver) CreateSession(ctx context.Context, params struct{ ... }) (*Session, error)
- func (rsv *Resolver) CreateUser(ctx context.Context, params struct{ ... }) (*User, error)
- func (rsv *Resolver) EditPost(ctx context.Context, params struct{ ... }) (*Post, error)
- func (rsv *Resolver) EditReaction(ctx context.Context, params struct{ ... }) (*Reaction, error)
- func (rsv *Resolver) EditUser(ctx context.Context, params struct{ ... }) (*User, error)
- func (rsv *Resolver) Post(ctx context.Context, params struct{ ... }) (*Post, error)
- func (rsv *Resolver) Posts(ctx context.Context) ([]*Post, error)
- func (rsv *Resolver) Reaction(ctx context.Context, params struct{ ... }) (*Reaction, error)
- func (rsv *Resolver) User(ctx context.Context, params struct{ ... }) (*User, error)
- func (rsv *Resolver) Users(ctx context.Context) ([]*User, error)
- type Session
- type User
- func (rsv *User) Creation() graphql.Time
- func (rsv *User) DisplayName() string
- func (rsv *User) Email(ctx context.Context) (string, error)
- func (rsv *User) ID() store.ID
- func (rsv *User) Posts(ctx context.Context) ([]*Post, error)
- func (rsv *User) PublishedReactions(ctx context.Context) ([]*Reaction, error)
- func (rsv *User) Sessions(ctx context.Context) ([]*Session, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CtxKey ¶
type CtxKey int
CtxKey represents a context.Context value key type
const CtxErrorRef CtxKey = 1
CtxErrorRef defines the context.Context error reference value key
type Post ¶
type Post struct {
// contains filtered or unexported fields
}
Post represents the resolver of the identically named type
func (*Post) Author ¶
Author resolves Post.author
func (*Post) Reactions ¶
Reactions resolves Post.reactions
type Reaction ¶
type Reaction struct {
// contains filtered or unexported fields
}
Reaction represents the resolver of the identically named type
func (*Reaction) Author ¶
Author resolves Reaction.author
func (*Reaction) Creation ¶
func (rsv *Reaction) Creation() graphql.Time
Creation resolves Reaction.creation
func (*Reaction) Reactions ¶
Reactions resolves Reaction.reactions
type ReactionSubject ¶
type ReactionSubject struct {
// contains filtered or unexported fields
}
ReactionSubject implements the identically named union type
func (*ReactionSubject) ToPost ¶
func (un *ReactionSubject) ToPost() (*Post, bool)
ToPost casts the union to a Post resolver
func (*ReactionSubject) ToReaction ¶
func (un *ReactionSubject) ToReaction() (*Reaction, bool)
ToReaction casts the union to a Reaction resolver
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver represents the root Graph resolver
func New ¶
func New( str store.Store, validator validator.Validator, sessionKeyGenerator sesskeygen.SessionKeyGenerator, passwordHasher passhash.PasswordHasher, ) (*Resolver, error)
New creates a new graph resolver instance
func (*Resolver) Authenticate ¶
func (rsv *Resolver) Authenticate( ctx context.Context, params struct { SessionKey string }, ) (*Session, error)
Authenticate resolves Mutation.authenticate
func (*Resolver) CloseAllSessions ¶
func (rsv *Resolver) CloseAllSessions( ctx context.Context, params struct { User string }, ) ([]string, error)
CloseAllSessions resolves Mutation.closeAllSessions
func (*Resolver) CloseSession ¶
func (rsv *Resolver) CloseSession( ctx context.Context, params struct { Key string }, ) (bool, error)
CloseSession resolves Mutation.closeSession
func (*Resolver) CreatePost ¶
func (rsv *Resolver) CreatePost( ctx context.Context, params struct { Author string Title string Contents string }, ) (*Post, error)
CreatePost resolves Mutation.createPost
func (*Resolver) CreateReaction ¶
func (rsv *Resolver) CreateReaction( ctx context.Context, params struct { Author string Subject string Emotion string Message string }, ) (*Reaction, error)
CreateReaction resolves Mutation.createReaction
func (*Resolver) CreateSession ¶
func (rsv *Resolver) CreateSession( ctx context.Context, params struct { Email string Password string }, ) (*Session, error)
CreateSession resolves Mutation.createSession
func (*Resolver) CreateUser ¶
func (rsv *Resolver) CreateUser( ctx context.Context, params struct { Email string DisplayName string Password string }, ) (*User, error)
CreateUser resolves Mutation.createUser
func (*Resolver) EditPost ¶
func (rsv *Resolver) EditPost( ctx context.Context, params struct { Post string Editor string NewTitle *string NewContents *string }, ) (*Post, error)
EditPost resolves Mutation.editPost
func (*Resolver) EditReaction ¶
func (rsv *Resolver) EditReaction( ctx context.Context, params struct { Reaction string Editor string NewMessage string }, ) (*Reaction, error)
EditReaction resolves Mutation.editReaction
func (*Resolver) EditUser ¶
func (rsv *Resolver) EditUser( ctx context.Context, params struct { User string Editor string NewEmail *string NewPassword *string }, ) (*User, error)
EditUser resolves Mutation.editUser
func (*Resolver) Post ¶
Post resolves Query.post
func (*Resolver) Posts ¶
Posts resolves Query.posts
func (*Resolver) Reaction ¶
func (rsv *Resolver) Reaction( ctx context.Context, params struct { ID string }, ) (*Reaction, error)
Reaction resolves Query.reaction
func (*Resolver) User ¶
User resolves Query.user
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session represents the resolver of the identically named type
type User ¶
type User struct {
// contains filtered or unexported fields
}
User represents the resolver of the identically named type
func (*User) DisplayName ¶
DisplayName resolves User.displayName
func (*User) Email ¶
Email resolves User.email
func (*User) Posts ¶
Posts resolves User.posts
func (*User) PublishedReactions ¶
PublishedReactions resolves User.publishedReactions