query

package
v0.22.5 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2022 License: AGPL-3.0, AGPL-3.0-only Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrOffsetTooBig = errors.New("limit too big")

Functions

This section is empty.

Types

type Query

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

func New

func New(
	episode domain.EpisodeRepo,
	cache cache.Cache,
	subject domain.SubjectRepo,
	person domain.PersonRepo,
	character domain.CharacterRepo,
	metric tally.Scope,
	log *zap.Logger,
) Query

func (Query) CountEpisode

func (q Query) CountEpisode(ctx context.Context, subjectID model.SubjectID, epType *model.EpType) (int64, error)

func (Query) GetActors added in v0.22.1

func (q Query) GetActors(
	ctx context.Context,
	subjectID model.SubjectID,
	characterIDs ...model.CharacterID,
) (map[model.CharacterID][]model.Person, error)

func (Query) GetCharacter

func (q Query) GetCharacter(ctx context.Context, user domain.Auth, id model.CharacterID) (model.Character, error)

func (Query) GetCharacterNoRedirect added in v0.22.1

func (q Query) GetCharacterNoRedirect(
	ctx context.Context, user domain.Auth, id model.CharacterID,
) (model.Character, error)

func (Query) GetCharacterRelatedSubjects

func (q Query) GetCharacterRelatedSubjects(
	ctx context.Context,
	user domain.Auth,
	characterID model.CharacterID,
) (model.Character, []model.SubjectCharacterRelation, error)

func (Query) GetEpisode

func (q Query) GetEpisode(ctx context.Context, id model.EpisodeID) (model.Episode, error)

func (Query) GetPerson

func (q Query) GetPerson(ctx context.Context, personID model.PersonID) (model.Person, error)

func (Query) GetPersonRelated

func (q Query) GetPersonRelated(
	ctx context.Context, personID model.PersonID,
) ([]model.SubjectPersonRelation, error)

func (Query) GetPersonRelatedCharacters added in v0.22.1

func (q Query) GetPersonRelatedCharacters(
	ctx context.Context, personID model.PersonID,
) ([]model.PersonCharacterRelation, error)

func (Query) GetSubject

func (q Query) GetSubject(ctx context.Context, user domain.Auth, subjectID model.SubjectID) (model.Subject, error)

func (Query) GetSubjectByIDs

func (q Query) GetSubjectByIDs(
	ctx context.Context,
	subjectIDs ...model.SubjectID,
) (map[model.SubjectID]model.Subject, error)

func (Query) GetSubjectNoRedirect added in v0.22.1

func (q Query) GetSubjectNoRedirect(
	ctx context.Context,
	user domain.Auth,
	subjectID model.SubjectID,
) (model.Subject, error)

func (Query) GetSubjectRelatedCharacters added in v0.22.1

func (q Query) GetSubjectRelatedCharacters(
	ctx context.Context,
	user domain.Auth,
	subjectID model.SubjectID,
) (model.Subject, []model.SubjectCharacterRelation, error)

func (Query) GetSubjectRelatedSubjects

func (q Query) GetSubjectRelatedSubjects(
	ctx context.Context,
	user domain.Auth,
	subjectID model.SubjectID,
) (model.Subject, []model.SubjectInternalRelation, error)

func (Query) ListEpisode

func (q Query) ListEpisode(
	ctx context.Context,
	subjectID model.SubjectID,
	epType *model.EpType,
	limit, offset int,
) ([]model.Episode, int64, error)

Jump to

Keyboard shortcuts

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