Documentation ¶
Index ¶
- func GenerateToken(user *model.User) (string, error)
- type AuthPayload
- type AuthResolver
- type LinkQueryArgs
- type LinkResolver
- type LinksQueryArgs
- type LoginArgs
- type MetaResolver
- type NewLinkEvent
- type NewLinkSubscriber
- type NewVoteEvent
- type NewVoteSubscriber
- type PostArgs
- type RootResolver
- func (r RootResolver) Link(args LinkQueryArgs) (*LinkResolver, error)
- func (r RootResolver) Links(args LinksQueryArgs) (*[]*LinkResolver, error)
- func (r RootResolver) LinksMeta() (*MetaResolver, error)
- func (r *RootResolver) Login(args LoginArgs) (*AuthResolver, error)
- func (r *RootResolver) NewLink(ctx context.Context) (<-chan *NewLinkEvent, error)
- func (r *RootResolver) NewVote(ctx context.Context) (<-chan *NewVoteEvent, error)
- func (r *RootResolver) Post(ctx context.Context, args PostArgs) (*LinkResolver, error)
- func (r *RootResolver) Signup(args SignupArgs) (*AuthResolver, error)
- func (r *RootResolver) Upvote(ctx context.Context, args UpvoteArgs) (*VoteResolver, error)
- type SignupArgs
- type UpvoteArgs
- type UserResolver
- type VoteResolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthPayload ¶
type AuthResolver ¶
type AuthResolver struct { DB *db.DB AuthPayload AuthPayload }
func (*AuthResolver) Token ¶
func (r *AuthResolver) Token() *string
func (*AuthResolver) User ¶
func (r *AuthResolver) User() *UserResolver
type LinkQueryArgs ¶
type LinkQueryArgs struct {
ID graphql.ID
}
type LinkResolver ¶
func (*LinkResolver) CreatedAt ¶
func (r *LinkResolver) CreatedAt() graphql.Time
func (*LinkResolver) Description ¶
func (r *LinkResolver) Description() string
func (*LinkResolver) ID ¶
func (r *LinkResolver) ID() graphql.ID
func (*LinkResolver) PostedBy ¶
func (r *LinkResolver) PostedBy() (*UserResolver, error)
func (*LinkResolver) Url ¶
func (r *LinkResolver) Url() string
func (*LinkResolver) Votes ¶
func (r *LinkResolver) Votes() (*[]*VoteResolver, error)
type LinksQueryArgs ¶
type MetaResolver ¶
type MetaResolver struct {
// contains filtered or unexported fields
}
func (*MetaResolver) Count ¶
func (r *MetaResolver) Count() int32
type NewLinkEvent ¶
type NewLinkEvent struct { EventID string Link *LinkResolver }
func (*NewLinkEvent) ID ¶
func (r *NewLinkEvent) ID() string
func (*NewLinkEvent) NewLink ¶
func (r *NewLinkEvent) NewLink() *LinkResolver
type NewLinkSubscriber ¶
type NewLinkSubscriber struct {
// contains filtered or unexported fields
}
type NewVoteEvent ¶
type NewVoteEvent struct { EventID string Vote *VoteResolver }
func (*NewVoteEvent) ID ¶
func (r *NewVoteEvent) ID() string
func (*NewVoteEvent) NewVote ¶
func (r *NewVoteEvent) NewVote() *VoteResolver
type NewVoteSubscriber ¶
type NewVoteSubscriber struct {
// contains filtered or unexported fields
}
type RootResolver ¶
type RootResolver struct { DB *db.DB NewLinkEvents chan *NewLinkEvent NewLinkSubscriber chan *NewLinkSubscriber NewVoteEvents chan *NewVoteEvent NewVoteSubscriber chan *NewVoteSubscriber }
func (RootResolver) Link ¶
func (r RootResolver) Link(args LinkQueryArgs) (*LinkResolver, error)
func (RootResolver) Links ¶
func (r RootResolver) Links(args LinksQueryArgs) (*[]*LinkResolver, error)
func (RootResolver) LinksMeta ¶
func (r RootResolver) LinksMeta() (*MetaResolver, error)
func (*RootResolver) Login ¶
func (r *RootResolver) Login(args LoginArgs) (*AuthResolver, error)
func (*RootResolver) NewLink ¶
func (r *RootResolver) NewLink(ctx context.Context) (<-chan *NewLinkEvent, error)
func (*RootResolver) NewVote ¶
func (r *RootResolver) NewVote(ctx context.Context) (<-chan *NewVoteEvent, error)
func (*RootResolver) Post ¶
func (r *RootResolver) Post(ctx context.Context, args PostArgs) (*LinkResolver, error)
func (*RootResolver) Signup ¶
func (r *RootResolver) Signup(args SignupArgs) (*AuthResolver, error)
func (*RootResolver) Upvote ¶
func (r *RootResolver) Upvote(ctx context.Context, args UpvoteArgs) (*VoteResolver, error)
type SignupArgs ¶
type UpvoteArgs ¶
type UpvoteArgs struct {
LinkID graphql.ID
}
type UserResolver ¶
func (*UserResolver) Email ¶
func (r *UserResolver) Email() string
func (*UserResolver) ID ¶
func (r *UserResolver) ID() graphql.ID
func (*UserResolver) Links ¶
func (r *UserResolver) Links() (*[]*LinkResolver, error)
func (*UserResolver) Name ¶
func (r *UserResolver) Name() string
func (*UserResolver) Votes ¶
func (r *UserResolver) Votes() (*[]*VoteResolver, error)
type VoteResolver ¶
func (*VoteResolver) ID ¶
func (r *VoteResolver) ID() graphql.ID
func (*VoteResolver) Link ¶
func (r *VoteResolver) Link() (*LinkResolver, error)
func (*VoteResolver) User ¶
func (r *VoteResolver) User() (*UserResolver, error)
Click to show internal directories.
Click to hide internal directories.