ctrl

package
v0.30.18 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: AGPL-3.0, AGPL-3.0-only Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidInput = errors.New("invalid input")
View Source
var ErrPmBlocked = errors.New("have been blocked")
View Source
var ErrPmNotAFriend = errors.New("not a friend to some receivers")
View Source
var ErrPmNotAllReceiversExist = errors.New("some receivers not exist")
View Source
var ErrPmReceiverReject = errors.New("some receivers reject private message")
View Source
var Module = fx.Module("controller",
	fx.Provide(New),
)

Functions

This section is empty.

Types

type Ctrl

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

func New

func New(
	episode episode.Repo,
	cache cache.RedisCache,
	subject subject.Repo,
	subjectCached subject.CachedRepo,
	collection collections.Repo,
	timeline timeline.Service,
	user user.Repo,
	tx dal.Transaction,
	dam dam.Dam,
	privateMessage pm.Repo,
	log *zap.Logger,
) Ctrl

func (Ctrl) CreatePrivateMessage

func (ctl Ctrl) CreatePrivateMessage(
	ctx context.Context,
	senderID model.UserID,
	receiverIDs []model.UserID,
	relatedIDFilter pm.IDFilter,
	title string,
	content string) ([]pm.PrivateMessage, error)

func (Ctrl) UpdateEpisodeCollection

func (ctl Ctrl) UpdateEpisodeCollection(
	ctx context.Context,
	u auth.Auth,
	episodeID model.EpisodeID,
	t collection.EpisodeCollection,
) error

func (Ctrl) UpdateEpisodesCollection

func (ctl Ctrl) UpdateEpisodesCollection(
	ctx context.Context,
	u auth.Auth,
	subjectID model.SubjectID,
	episodeIDs []model.EpisodeID,
	t collection.EpisodeCollection,
) error

func (Ctrl) UpdateSubjectCollection added in v0.30.17

func (ctl Ctrl) UpdateSubjectCollection(
	ctx context.Context,
	u auth.Auth,
	subjectID model.SubjectID,
	req UpdateCollectionRequest,
) error

type UpdateCollectionRequest

type UpdateCollectionRequest struct {
	IP  string
	UID model.UserID

	Comment   null.String
	Tags      []string
	VolStatus null.Uint32
	EpStatus  null.Uint32
	Type      null.Null[collection.SubjectCollection]
	Rate      null.Uint8
	Private   null.Bool
}

Jump to

Keyboard shortcuts

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