uexky

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2020 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DevServiceSet = wire.NewSet(
	serviceSet,
	repoSet,
	mockMailSet,
)
View Source
var ProdServiceSet = wire.NewSet(
	serviceSet,
	repoSet,
	mailSet,
)

Functions

This section is empty.

Types

type Service added in v1.9.0

type Service struct {
	User      *entity.UserService
	Forum     *entity.ForumService
	Noti      *entity.NotiService
	TxAdapter adapter.Tx
}

func InitDevService added in v1.9.0

func InitDevService() (*Service, error)

func InitProdService added in v1.9.0

func InitProdService() (*Service, error)

func (*Service) AddUserSubbedTag added in v1.9.0

func (s *Service) AddUserSubbedTag(ctx context.Context, tag string) (*entity.User, error)

func (*Service) BanUser added in v1.9.0

func (s *Service) BanUser(ctx context.Context, postID *uid.UID, threadID *uid.UID) (bool, error)

func (*Service) BlockPost added in v1.9.0

func (s *Service) BlockPost(ctx context.Context, postID uid.UID) (*entity.Post, error)

func (*Service) BlockThread added in v1.9.0

func (s *Service) BlockThread(ctx context.Context, threadID uid.UID) (*entity.Thread, error)

func (*Service) CtxWithUserByToken added in v1.9.0

func (s *Service) CtxWithUserByToken(ctx context.Context, tok string) (context.Context, *entity.Token, error)

CtxWithUserByToken add user to context by tok is for both signed user and guest user.

func (*Service) DelUserSubbedTag added in v1.9.0

func (s *Service) DelUserSubbedTag(ctx context.Context, tag string) (*entity.User, error)

func (*Service) EditTags added in v1.9.0

func (s *Service) EditTags(
	ctx context.Context, threadID uid.UID, mainTag string, subTags []string,
) (*entity.Thread, error)

func (*Service) GetMainTags added in v1.9.0

func (s *Service) GetMainTags(ctx context.Context) ([]string, error)

func (*Service) GetNotification added in v1.9.0

func (s *Service) GetNotification(ctx context.Context, query entity.SliceQuery) (*entity.NotiSlice, error)

func (*Service) GetPostByID added in v1.9.0

func (s *Service) GetPostByID(ctx context.Context, id uid.UID) (*entity.Post, error)

func (*Service) GetRecommendedTags added in v1.9.0

func (s *Service) GetRecommendedTags(ctx context.Context) ([]string, error)

func (*Service) GetThreadByID added in v1.9.0

func (s *Service) GetThreadByID(ctx context.Context, id uid.UID) (*entity.Thread, error)

func (*Service) GetUnreadNotiCount added in v1.9.0

func (s *Service) GetUnreadNotiCount(ctx context.Context) (int, error)

func (*Service) GetUserPosts added in v1.9.0

func (s *Service) GetUserPosts(ctx context.Context, obj *entity.User, query entity.SliceQuery) (*entity.PostSlice, error)

func (*Service) GetUserThreads added in v1.9.0

func (s *Service) GetUserThreads(
	ctx context.Context, obj *entity.User, query entity.SliceQuery,
) (*entity.ThreadSlice, error)

func (*Service) LockThread added in v1.9.0

func (s *Service) LockThread(ctx context.Context, threadID uid.UID) (*entity.Thread, error)

func (*Service) Profile added in v1.9.0

func (s *Service) Profile(ctx context.Context) (*entity.User, error)

func (*Service) PubPost added in v1.9.0

func (s *Service) PubPost(ctx context.Context, post entity.PostInput) (*entity.Post, error)

func (*Service) PubThread added in v1.9.0

func (s *Service) PubThread(ctx context.Context, thread entity.ThreadInput) (*entity.Thread, error)

func (*Service) SearchTags added in v1.9.0

func (s *Service) SearchTags(ctx context.Context, query *string, limit *int) ([]*entity.Tag, error)

func (*Service) SearchThreads added in v1.9.0

func (s *Service) SearchThreads(
	ctx context.Context, tags []string, query entity.SliceQuery,
) (*entity.ThreadSlice, error)

func (*Service) SetMainTags added in v1.9.0

func (s *Service) SetMainTags(ctx context.Context, tags []string) error

func (*Service) SetUserName added in v1.9.0

func (s *Service) SetUserName(ctx context.Context, name string) (*entity.User, error)

func (*Service) SignInByCode added in v1.9.0

func (s *Service) SignInByCode(ctx context.Context, code string) (*entity.Token, error)

SignInByCode is only for signed in user

func (*Service) SyncUserTags added in v1.9.0

func (s *Service) SyncUserTags(ctx context.Context, tags []string) (*entity.User, error)

func (*Service) TrySignInByEmail added in v1.9.0

func (s *Service) TrySignInByEmail(ctx context.Context, email string) (entity.Code, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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