controller

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initialize

func Initialize(ctx context.Context)

Types

type MutationResolver

type MutationResolver struct{}

func (*MutationResolver) BlogAmendPost

func (r *MutationResolver) BlogAmendPost(ctx context.Context,
	post global.NewBlogPost) (*model.Post, error)

func (*MutationResolver) BlogCreatePost

func (r *MutationResolver) BlogCreatePost(ctx context.Context,
	input global.NewBlogPost) (*model.Post, error)

BlogCreatePost create new blog post

func (*MutationResolver) BlogLogin

func (r *MutationResolver) BlogLogin(ctx context.Context,
	account string,
	password string,
) (resp *global.BlogLoginResponse, err error)

BlogLogin login in blog page

type PostResolver

type PostResolver struct{}

func (*PostResolver) Author

func (r *PostResolver) Author(ctx context.Context, obj *model.Post) (*model.User, error)

func (*PostResolver) Category

func (r *PostResolver) Category(ctx context.Context, obj *model.Post) (*model.Category, error)

func (*PostResolver) CreatedAt

func (r *PostResolver) CreatedAt(ctx context.Context, obj *model.Post) (*library.Datetime, error)

func (*PostResolver) ID

func (r *PostResolver) ID(ctx context.Context, obj *model.Post) (string, error)

func (*PostResolver) ModifiedAt

func (r *PostResolver) ModifiedAt(ctx context.Context, obj *model.Post) (*library.Datetime, error)

func (*PostResolver) Type

type PostSeriesResolver

type PostSeriesResolver struct{}

func (*PostSeriesResolver) Children

func (r *PostSeriesResolver) Children(ctx context.Context,
	obj *model.PostSeries) ([]*model.PostSeries, error)

func (*PostSeriesResolver) Posts

func (r *PostSeriesResolver) Posts(ctx context.Context, obj *model.PostSeries) (posts []*model.Post, err error)

type QueryResolver

type QueryResolver struct{}

func (*QueryResolver) BlogPostCategories

func (r *QueryResolver) BlogPostCategories(ctx context.Context) ([]*model.Category, error)

func (*QueryResolver) BlogPostInfo

func (r *QueryResolver) BlogPostInfo(ctx context.Context) (*dto.PostInfo, error)

func (*QueryResolver) BlogPosts

func (r *QueryResolver) BlogPosts(ctx context.Context,
	page *global.Pagination,
	tag string,
	categoryURL *string,
	length int,
	name string,
	regexp string,
) ([]*model.Post, error)

func (*QueryResolver) BlogTwitterCard

func (r *QueryResolver) BlogTwitterCard(ctx context.Context, name string) (string, error)

func (*QueryResolver) GetBlogPostSeries

func (r *QueryResolver) GetBlogPostSeries(ctx context.Context,
	page *global.Pagination,
	key string,
) ([]*model.PostSeries, error)

func (*QueryResolver) WhoAmI

func (r *QueryResolver) WhoAmI(ctx context.Context) (*model.User, error)

type Type

type Type struct {
	PostResolver       *PostResolver
	PostSeriesResolver *PostSeriesResolver
	UserResolver       *UserResolver
}
var Instance *Type

func New

func New() *Type

type UserResolver

type UserResolver struct{}

func (*UserResolver) ID

func (r *UserResolver) ID(ctx context.Context,
	obj *model.User) (string, error)

Jump to

Keyboard shortcuts

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