service

package
v0.0.0-...-e6f7b9e Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrRequiredParam

func ErrRequiredParam(param string) error

func ErrUnsupported

func ErrUnsupported(param string, value any) error

func HandlePayload

func HandlePayload[M any](ctx context.Context, evt *event.Event, f func(ctx context.Context, payload M) error) error

func IgnoreErrors

func IgnoreErrors(handler func(context.Context, *event.Event) error) func(ctx context.Context, evt *event.Event) error

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(repo repo.Repo) *Service

func (*Service) AddPostClassificationTags

func (s *Service) AddPostClassificationTags(ctx context.Context, postID string, tags ...string) error

func (*Service) BanUser

func (s *Service) BanUser(
	ctx context.Context,
	userID string,
	bannedAt time.Time,
) error

func (*Service) BlockUser

func (s *Service) BlockUser(
	ctx context.Context,
	userID,
	targetUserID string,
	blockedAt time.Time,
) error

func (*Service) CreateUser

func (s *Service) CreateUser(
	ctx context.Context,
	userID string,
	languageCodes []string,
	createdAt time.Time,
) error

func (*Service) DeleteCircle

func (s *Service) DeleteCircle(
	ctx context.Context,
	circleID string,
	deletedAt time.Time,
) error

func (*Service) FollowUser

func (s *Service) FollowUser(
	ctx context.Context,
	userID,
	targetUserID string,
	followedAt time.Time,
) error

func (*Service) GetSavedSearchResult

func (s *Service) GetSavedSearchResult(
	ctx context.Context,
	kind int64,
	c model.Cursor,
) ([]*model.Search, cursor.Page, error)

func (*Service) HandleAdminEvent

func (s *Service) HandleAdminEvent(ctx context.Context, evt *event.Event) error

func (*Service) HandleCircleEvent

func (s *Service) HandleCircleEvent(ctx context.Context, evt *event.Event) error

func (*Service) HandleClassificationEvent

func (s *Service) HandleClassificationEvent(ctx context.Context, evt *event.Event) error

func (*Service) HandleContentEvent

func (s *Service) HandleContentEvent(ctx context.Context, evt *event.Event) error

func (*Service) HandleProfileEvent

func (s *Service) HandleProfileEvent(ctx context.Context, evt *event.Event) error

func (*Service) JoinUserToCircle

func (s *Service) JoinUserToCircle(
	ctx context.Context,
	userID string,
	circleID string,
	joinedAt time.Time,
) error

func (*Service) LeaveUserFromCircle

func (s *Service) LeaveUserFromCircle(
	ctx context.Context,
	userID string,
	circleID string,
	leftAt time.Time,
) error

func (*Service) ListenEvents

func (s *Service) ListenEvents(ctx context.Context, client eventbus.Client) error

func (*Service) RemovePost

func (s *Service) RemovePost(ctx context.Context, postID string, deletedAt time.Time) error

func (*Service) SaveCircle

func (s *Service) SaveCircle(
	ctx context.Context,
	circleID string,
	groupID string,
	lastUpdateAt time.Time,
) error

func (*Service) SavePost

func (s *Service) SavePost(ctx context.Context, post model.Post) error

func (*Service) SaveSearchResult

func (s *Service) SaveSearchResult(ctx context.Context, kind int64, entityID string) error

func (*Service) UnbanUser

func (s *Service) UnbanUser(
	ctx context.Context,
	userID string,
	unbannedAt time.Time,
) error

func (*Service) UnblockUser

func (s *Service) UnblockUser(
	ctx context.Context,
	userID,
	targetUserID string,
	unblockedAt time.Time,
) error

func (*Service) UnfollowUser

func (s *Service) UnfollowUser(
	ctx context.Context,
	userID,
	targetUserID string,
	unfollowedAt time.Time,
) error

func (*Service) UnsaveSearchResult

func (s *Service) UnsaveSearchResult(ctx context.Context, kind int64, entityID string) error

func (*Service) UpdateUserLangCodes

func (s *Service) UpdateUserLangCodes(
	ctx context.Context,
	userID string,
	languagesCodes []string,
) error

func (*Service) ValidateEntityID

func (s *Service) ValidateEntityID(_ context.Context, kind int64, entityID string) error

func (*Service) ValidateKind

func (s *Service) ValidateKind(_ context.Context, kind int64) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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