Documentation ¶
Index ¶
- Variables
- type Auth
- type AuthRepo
- type CharacterCast
- type CharacterIDType
- type CharacterRepo
- type EpTypeType
- type EpisodeRepo
- type IndexRepo
- type IndexSubject
- type MockAuthRepo
- type MockAuthRepo_Expecter
- type MockAuthRepo_GetByToken_Call
- type MockCharacterRepo
- func (_m *MockCharacterRepo) EXPECT() *MockCharacterRepo_Expecter
- func (_m *MockCharacterRepo) Get(ctx context.Context, id uint32) (model.Character, error)
- func (_m *MockCharacterRepo) GetPersonRelated(ctx context.Context, characterID uint32) ([]model.Character, []model.Subject, []model.PersonCharacterRelation, error)
- func (_m *MockCharacterRepo) GetSubjectRelated(ctx context.Context, subjectID uint32) ([]model.Character, []model.CharacterSubjectRelation, error)
- type MockCharacterRepo_Expecter
- func (_e *MockCharacterRepo_Expecter) Get(ctx interface{}, id interface{}) *MockCharacterRepo_Get_Call
- func (_e *MockCharacterRepo_Expecter) GetPersonRelated(ctx interface{}, characterID interface{}) *MockCharacterRepo_GetPersonRelated_Call
- func (_e *MockCharacterRepo_Expecter) GetSubjectRelated(ctx interface{}, subjectID interface{}) *MockCharacterRepo_GetSubjectRelated_Call
- type MockCharacterRepo_GetPersonRelated_Call
- type MockCharacterRepo_GetSubjectRelated_Call
- func (_c *MockCharacterRepo_GetSubjectRelated_Call) Return(_a0 []model.Character, _a1 []model.CharacterSubjectRelation, _a2 error) *MockCharacterRepo_GetSubjectRelated_Call
- func (_c *MockCharacterRepo_GetSubjectRelated_Call) Run(run func(ctx context.Context, subjectID uint32)) *MockCharacterRepo_GetSubjectRelated_Call
- type MockCharacterRepo_Get_Call
- type MockEpisodeRepo
- func (_m *MockEpisodeRepo) Count(ctx context.Context, subjectID uint32) (int64, error)
- func (_m *MockEpisodeRepo) CountByType(ctx context.Context, subjectID uint32, epType int8) (int64, error)
- func (_m *MockEpisodeRepo) EXPECT() *MockEpisodeRepo_Expecter
- func (_m *MockEpisodeRepo) Get(ctx context.Context, episodeID uint32) (model.Episode, error)
- func (_m *MockEpisodeRepo) List(ctx context.Context, subjectID uint32, limit int, offset int) ([]model.Episode, error)
- func (_m *MockEpisodeRepo) ListByType(ctx context.Context, subjectID uint32, epType int8, limit int, offset int) ([]model.Episode, error)
- type MockEpisodeRepo_CountByType_Call
- type MockEpisodeRepo_Count_Call
- type MockEpisodeRepo_Expecter
- func (_e *MockEpisodeRepo_Expecter) Count(ctx interface{}, subjectID interface{}) *MockEpisodeRepo_Count_Call
- func (_e *MockEpisodeRepo_Expecter) CountByType(ctx interface{}, subjectID interface{}, epType interface{}) *MockEpisodeRepo_CountByType_Call
- func (_e *MockEpisodeRepo_Expecter) Get(ctx interface{}, episodeID interface{}) *MockEpisodeRepo_Get_Call
- func (_e *MockEpisodeRepo_Expecter) List(ctx interface{}, subjectID interface{}, limit interface{}, offset interface{}) *MockEpisodeRepo_List_Call
- func (_e *MockEpisodeRepo_Expecter) ListByType(ctx interface{}, subjectID interface{}, epType interface{}, limit interface{}, ...) *MockEpisodeRepo_ListByType_Call
- type MockEpisodeRepo_Get_Call
- type MockEpisodeRepo_ListByType_Call
- type MockEpisodeRepo_List_Call
- type MockIndexRepo
- func (_m *MockIndexRepo) CountSubjects(ctx context.Context, id uint32, subjectType uint8) (int64, error)
- func (_m *MockIndexRepo) EXPECT() *MockIndexRepo_Expecter
- func (_m *MockIndexRepo) Get(ctx context.Context, id uint32) (model.Index, error)
- func (_m *MockIndexRepo) IsNsfw(ctx context.Context, id uint32) (bool, error)
- func (_m *MockIndexRepo) ListSubjects(ctx context.Context, id uint32, subjectType uint8, limit int, offset int) ([]IndexSubject, error)
- type MockIndexRepo_CountSubjects_Call
- type MockIndexRepo_Expecter
- func (_e *MockIndexRepo_Expecter) CountSubjects(ctx interface{}, id interface{}, subjectType interface{}) *MockIndexRepo_CountSubjects_Call
- func (_e *MockIndexRepo_Expecter) Get(ctx interface{}, id interface{}) *MockIndexRepo_Get_Call
- func (_e *MockIndexRepo_Expecter) IsNsfw(ctx interface{}, id interface{}) *MockIndexRepo_IsNsfw_Call
- func (_e *MockIndexRepo_Expecter) ListSubjects(ctx interface{}, id interface{}, subjectType interface{}, limit interface{}, ...) *MockIndexRepo_ListSubjects_Call
- type MockIndexRepo_Get_Call
- type MockIndexRepo_IsNsfw_Call
- type MockIndexRepo_ListSubjects_Call
- type MockPersonRepo
- func (_m *MockPersonRepo) EXPECT() *MockPersonRepo_Expecter
- func (_m *MockPersonRepo) Get(ctx context.Context, id uint32) (model.Person, error)
- func (_m *MockPersonRepo) GetActors(ctx context.Context, subjectID uint32, characterIDs ...uint32) (map[uint32][]model.Person, error)
- func (_m *MockPersonRepo) GetCharacterRelated(ctx context.Context, subjectID uint32) ([]CharacterCast, error)
- func (_m *MockPersonRepo) GetSubjectRelated(ctx context.Context, subjectID uint32) ([]model.Person, []model.PersonSubjectRelation, error)
- type MockPersonRepo_Expecter
- func (_e *MockPersonRepo_Expecter) Get(ctx interface{}, id interface{}) *MockPersonRepo_Get_Call
- func (_e *MockPersonRepo_Expecter) GetActors(ctx interface{}, subjectID interface{}, characterIDs ...interface{}) *MockPersonRepo_GetActors_Call
- func (_e *MockPersonRepo_Expecter) GetCharacterRelated(ctx interface{}, subjectID interface{}) *MockPersonRepo_GetCharacterRelated_Call
- func (_e *MockPersonRepo_Expecter) GetSubjectRelated(ctx interface{}, subjectID interface{}) *MockPersonRepo_GetSubjectRelated_Call
- type MockPersonRepo_GetActors_Call
- type MockPersonRepo_GetCharacterRelated_Call
- type MockPersonRepo_GetSubjectRelated_Call
- func (_c *MockPersonRepo_GetSubjectRelated_Call) Return(_a0 []model.Person, _a1 []model.PersonSubjectRelation, _a2 error) *MockPersonRepo_GetSubjectRelated_Call
- func (_c *MockPersonRepo_GetSubjectRelated_Call) Run(run func(ctx context.Context, subjectID uint32)) *MockPersonRepo_GetSubjectRelated_Call
- type MockPersonRepo_Get_Call
- type MockSubjectRepo
- func (_m *MockSubjectRepo) EXPECT() *MockSubjectRepo_Expecter
- func (_m *MockSubjectRepo) Get(ctx context.Context, id uint32) (model.Subject, error)
- func (_m *MockSubjectRepo) GetCharacterRelated(ctx context.Context, characterID uint32) ([]model.Subject, []model.CharacterSubjectRelation, error)
- func (_m *MockSubjectRepo) GetPersonRelated(ctx context.Context, personID uint32) ([]model.Subject, []model.PersonSubjectRelation, error)
- func (_m *MockSubjectRepo) GetSubjectRelated(ctx context.Context, subjectID uint32) ([]model.Subject, []model.SubjectInternalRelation, error)
- type MockSubjectRepo_Expecter
- func (_e *MockSubjectRepo_Expecter) Get(ctx interface{}, id interface{}) *MockSubjectRepo_Get_Call
- func (_e *MockSubjectRepo_Expecter) GetCharacterRelated(ctx interface{}, characterID interface{}) *MockSubjectRepo_GetCharacterRelated_Call
- func (_e *MockSubjectRepo_Expecter) GetPersonRelated(ctx interface{}, personID interface{}) *MockSubjectRepo_GetPersonRelated_Call
- func (_e *MockSubjectRepo_Expecter) GetSubjectRelated(ctx interface{}, subjectID interface{}) *MockSubjectRepo_GetSubjectRelated_Call
- type MockSubjectRepo_GetCharacterRelated_Call
- func (_c *MockSubjectRepo_GetCharacterRelated_Call) Return(_a0 []model.Subject, _a1 []model.CharacterSubjectRelation, _a2 error) *MockSubjectRepo_GetCharacterRelated_Call
- func (_c *MockSubjectRepo_GetCharacterRelated_Call) Run(run func(ctx context.Context, characterID uint32)) *MockSubjectRepo_GetCharacterRelated_Call
- type MockSubjectRepo_GetPersonRelated_Call
- func (_c *MockSubjectRepo_GetPersonRelated_Call) Return(_a0 []model.Subject, _a1 []model.PersonSubjectRelation, _a2 error) *MockSubjectRepo_GetPersonRelated_Call
- func (_c *MockSubjectRepo_GetPersonRelated_Call) Run(run func(ctx context.Context, personID uint32)) *MockSubjectRepo_GetPersonRelated_Call
- type MockSubjectRepo_GetSubjectRelated_Call
- func (_c *MockSubjectRepo_GetSubjectRelated_Call) Return(_a0 []model.Subject, _a1 []model.SubjectInternalRelation, _a2 error) *MockSubjectRepo_GetSubjectRelated_Call
- func (_c *MockSubjectRepo_GetSubjectRelated_Call) Run(run func(ctx context.Context, subjectID uint32)) *MockSubjectRepo_GetSubjectRelated_Call
- type MockSubjectRepo_Get_Call
- type MockSubjectService
- type MockSubjectService_Expecter
- type MockSubjectService_Get_Call
- type MockUserRepo
- func (_m *MockUserRepo) CountCollections(ctx context.Context, userID uint32, subjectType uint8, collectionType uint8, ...) (int64, error)
- func (_m *MockUserRepo) EXPECT() *MockUserRepo_Expecter
- func (_m *MockUserRepo) GetByID(ctx context.Context, userID uint32) (model.User, error)
- func (_m *MockUserRepo) GetByIDs(ctx context.Context, ids ...uint32) (map[uint32]model.User, error)
- func (_m *MockUserRepo) GetByName(ctx context.Context, username string) (model.User, error)
- func (_m *MockUserRepo) ListCollections(ctx context.Context, userID uint32, subjectType uint8, collectionType uint8, ...) ([]model.Collection, error)
- type MockUserRepo_CountCollections_Call
- type MockUserRepo_Expecter
- func (_e *MockUserRepo_Expecter) CountCollections(ctx interface{}, userID interface{}, subjectType interface{}, ...) *MockUserRepo_CountCollections_Call
- func (_e *MockUserRepo_Expecter) GetByID(ctx interface{}, userID interface{}) *MockUserRepo_GetByID_Call
- func (_e *MockUserRepo_Expecter) GetByIDs(ctx interface{}, ids ...interface{}) *MockUserRepo_GetByIDs_Call
- func (_e *MockUserRepo_Expecter) GetByName(ctx interface{}, username interface{}) *MockUserRepo_GetByName_Call
- func (_e *MockUserRepo_Expecter) ListCollections(ctx interface{}, userID interface{}, subjectType interface{}, ...) *MockUserRepo_ListCollections_Call
- type MockUserRepo_GetByID_Call
- type MockUserRepo_GetByIDs_Call
- type MockUserRepo_GetByName_Call
- type MockUserRepo_ListCollections_Call
- type PersonIDType
- type PersonRepo
- type SubjectIDType
- type SubjectRepo
- type SubjectService
- type UserRepo
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("can't find item")
ErrNotFound should be returned when a repo or service can't find an authorization.
Functions ¶
This section is empty.
Types ¶
type AuthRepo ¶
type AuthRepo interface { // GetByToken return an authorized user by a valid access token. GetByToken(ctx context.Context, token string) (Auth, error) }
AuthRepo presents an authorization.
type CharacterCast ¶
type CharacterIDType ¶
type CharacterIDType = uint32
type CharacterRepo ¶
type CharacterRepo interface { Get(ctx context.Context, id uint32) (model.Character, error) GetPersonRelated( ctx context.Context, characterID PersonIDType, ) ([]model.Character, []model.Subject, []model.PersonCharacterRelation, error) GetSubjectRelated( ctx context.Context, subjectID SubjectIDType, ) ([]model.Character, []model.CharacterSubjectRelation, error) }
type EpTypeType ¶
type EpTypeType = int8
type EpisodeRepo ¶
type EpisodeRepo interface { Get(ctx context.Context, episodeID uint32) (model.Episode, error) // Count all episode for a subject. Count(ctx context.Context, subjectID uint32) (int64, error) // CountByType count episode for a subject and filter by type. // This is because 0 means episode type normal. CountByType(ctx context.Context, subjectID uint32, epType EpTypeType) (int64, error) // List return all episode. List(ctx context.Context, subjectID uint32, limit int, offset int) ([]model.Episode, error) // ListByType return episodes filtered by episode type. ListByType( ctx context.Context, subjectID uint32, epType enum.EpType, limit int, offset int, ) ([]model.Episode, error) }
type IndexRepo ¶
type IndexRepo interface { Get(ctx context.Context, id uint32) (model.Index, error) // IsNsfw return if this index contains any nsfw subjects // should move this to a field of model.Index IsNsfw(ctx context.Context, id uint32) (bool, error) CountSubjects(ctx context.Context, id uint32, subjectType model.SubjectType) (int64, error) ListSubjects( ctx context.Context, id uint32, subjectType model.SubjectType, limit, offset int, ) ([]IndexSubject, error) }
type IndexSubject ¶
type MockAuthRepo ¶
MockAuthRepo is an autogenerated mock type for the AuthRepo type
func (*MockAuthRepo) EXPECT ¶
func (_m *MockAuthRepo) EXPECT() *MockAuthRepo_Expecter
func (*MockAuthRepo) GetByToken ¶
GetByToken provides a mock function with given fields: ctx, token
type MockAuthRepo_Expecter ¶
type MockAuthRepo_Expecter struct {
// contains filtered or unexported fields
}
func (*MockAuthRepo_Expecter) GetByToken ¶
func (_e *MockAuthRepo_Expecter) GetByToken(ctx interface{}, token interface{}) *MockAuthRepo_GetByToken_Call
GetByToken is a helper method to define mock.On call
- ctx context.Context
- token string
type MockAuthRepo_GetByToken_Call ¶
MockAuthRepo_GetByToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByToken'
func (*MockAuthRepo_GetByToken_Call) Return ¶
func (_c *MockAuthRepo_GetByToken_Call) Return(_a0 Auth, _a1 error) *MockAuthRepo_GetByToken_Call
func (*MockAuthRepo_GetByToken_Call) Run ¶
func (_c *MockAuthRepo_GetByToken_Call) Run(run func(ctx context.Context, token string)) *MockAuthRepo_GetByToken_Call
type MockCharacterRepo ¶
MockCharacterRepo is an autogenerated mock type for the CharacterRepo type
func (*MockCharacterRepo) EXPECT ¶
func (_m *MockCharacterRepo) EXPECT() *MockCharacterRepo_Expecter
func (*MockCharacterRepo) GetPersonRelated ¶
func (_m *MockCharacterRepo) GetPersonRelated(ctx context.Context, characterID uint32) ([]model.Character, []model.Subject, []model.PersonCharacterRelation, error)
GetPersonRelated provides a mock function with given fields: ctx, characterID
func (*MockCharacterRepo) GetSubjectRelated ¶
func (_m *MockCharacterRepo) GetSubjectRelated(ctx context.Context, subjectID uint32) ([]model.Character, []model.CharacterSubjectRelation, error)
GetSubjectRelated provides a mock function with given fields: ctx, subjectID
type MockCharacterRepo_Expecter ¶
type MockCharacterRepo_Expecter struct {
// contains filtered or unexported fields
}
func (*MockCharacterRepo_Expecter) Get ¶
func (_e *MockCharacterRepo_Expecter) Get(ctx interface{}, id interface{}) *MockCharacterRepo_Get_Call
Get is a helper method to define mock.On call
- ctx context.Context
- id uint32
func (*MockCharacterRepo_Expecter) GetPersonRelated ¶
func (_e *MockCharacterRepo_Expecter) GetPersonRelated(ctx interface{}, characterID interface{}) *MockCharacterRepo_GetPersonRelated_Call
GetPersonRelated is a helper method to define mock.On call
- ctx context.Context
- characterID uint32
func (*MockCharacterRepo_Expecter) GetSubjectRelated ¶
func (_e *MockCharacterRepo_Expecter) GetSubjectRelated(ctx interface{}, subjectID interface{}) *MockCharacterRepo_GetSubjectRelated_Call
GetSubjectRelated is a helper method to define mock.On call
- ctx context.Context
- subjectID uint32
type MockCharacterRepo_GetPersonRelated_Call ¶
MockCharacterRepo_GetPersonRelated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPersonRelated'
func (*MockCharacterRepo_GetPersonRelated_Call) Return ¶
func (_c *MockCharacterRepo_GetPersonRelated_Call) Return(_a0 []model.Character, _a1 []model.Subject, _a2 []model.PersonCharacterRelation, _a3 error) *MockCharacterRepo_GetPersonRelated_Call
func (*MockCharacterRepo_GetPersonRelated_Call) Run ¶
func (_c *MockCharacterRepo_GetPersonRelated_Call) Run(run func(ctx context.Context, characterID uint32)) *MockCharacterRepo_GetPersonRelated_Call
type MockCharacterRepo_GetSubjectRelated_Call ¶
MockCharacterRepo_GetSubjectRelated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSubjectRelated'
func (*MockCharacterRepo_GetSubjectRelated_Call) Return ¶
func (_c *MockCharacterRepo_GetSubjectRelated_Call) Return(_a0 []model.Character, _a1 []model.CharacterSubjectRelation, _a2 error) *MockCharacterRepo_GetSubjectRelated_Call
func (*MockCharacterRepo_GetSubjectRelated_Call) Run ¶
func (_c *MockCharacterRepo_GetSubjectRelated_Call) Run(run func(ctx context.Context, subjectID uint32)) *MockCharacterRepo_GetSubjectRelated_Call
type MockCharacterRepo_Get_Call ¶
MockCharacterRepo_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get'
func (*MockCharacterRepo_Get_Call) Return ¶
func (_c *MockCharacterRepo_Get_Call) Return(_a0 model.Character, _a1 error) *MockCharacterRepo_Get_Call
func (*MockCharacterRepo_Get_Call) Run ¶
func (_c *MockCharacterRepo_Get_Call) Run(run func(ctx context.Context, id uint32)) *MockCharacterRepo_Get_Call
type MockEpisodeRepo ¶
MockEpisodeRepo is an autogenerated mock type for the EpisodeRepo type
func (*MockEpisodeRepo) CountByType ¶
func (_m *MockEpisodeRepo) CountByType(ctx context.Context, subjectID uint32, epType int8) (int64, error)
CountByType provides a mock function with given fields: ctx, subjectID, epType
func (*MockEpisodeRepo) EXPECT ¶
func (_m *MockEpisodeRepo) EXPECT() *MockEpisodeRepo_Expecter
type MockEpisodeRepo_CountByType_Call ¶
MockEpisodeRepo_CountByType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CountByType'
func (*MockEpisodeRepo_CountByType_Call) Return ¶
func (_c *MockEpisodeRepo_CountByType_Call) Return(_a0 int64, _a1 error) *MockEpisodeRepo_CountByType_Call
func (*MockEpisodeRepo_CountByType_Call) Run ¶
func (_c *MockEpisodeRepo_CountByType_Call) Run(run func(ctx context.Context, subjectID uint32, epType int8)) *MockEpisodeRepo_CountByType_Call
type MockEpisodeRepo_Count_Call ¶
MockEpisodeRepo_Count_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Count'
func (*MockEpisodeRepo_Count_Call) Return ¶
func (_c *MockEpisodeRepo_Count_Call) Return(_a0 int64, _a1 error) *MockEpisodeRepo_Count_Call
func (*MockEpisodeRepo_Count_Call) Run ¶
func (_c *MockEpisodeRepo_Count_Call) Run(run func(ctx context.Context, subjectID uint32)) *MockEpisodeRepo_Count_Call
type MockEpisodeRepo_Expecter ¶
type MockEpisodeRepo_Expecter struct {
// contains filtered or unexported fields
}
func (*MockEpisodeRepo_Expecter) Count ¶
func (_e *MockEpisodeRepo_Expecter) Count(ctx interface{}, subjectID interface{}) *MockEpisodeRepo_Count_Call
Count is a helper method to define mock.On call
- ctx context.Context
- subjectID uint32
func (*MockEpisodeRepo_Expecter) CountByType ¶
func (_e *MockEpisodeRepo_Expecter) CountByType(ctx interface{}, subjectID interface{}, epType interface{}) *MockEpisodeRepo_CountByType_Call
CountByType is a helper method to define mock.On call
- ctx context.Context
- subjectID uint32
- epType int8
func (*MockEpisodeRepo_Expecter) Get ¶
func (_e *MockEpisodeRepo_Expecter) Get(ctx interface{}, episodeID interface{}) *MockEpisodeRepo_Get_Call
Get is a helper method to define mock.On call
- ctx context.Context
- episodeID uint32
func (*MockEpisodeRepo_Expecter) List ¶
func (_e *MockEpisodeRepo_Expecter) List(ctx interface{}, subjectID interface{}, limit interface{}, offset interface{}) *MockEpisodeRepo_List_Call
List is a helper method to define mock.On call
- ctx context.Context
- subjectID uint32
- limit int
- offset int
func (*MockEpisodeRepo_Expecter) ListByType ¶
func (_e *MockEpisodeRepo_Expecter) ListByType(ctx interface{}, subjectID interface{}, epType interface{}, limit interface{}, offset interface{}) *MockEpisodeRepo_ListByType_Call
ListByType is a helper method to define mock.On call
- ctx context.Context
- subjectID uint32
- epType int8
- limit int
- offset int
type MockEpisodeRepo_Get_Call ¶
MockEpisodeRepo_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get'
func (*MockEpisodeRepo_Get_Call) Return ¶
func (_c *MockEpisodeRepo_Get_Call) Return(_a0 model.Episode, _a1 error) *MockEpisodeRepo_Get_Call
func (*MockEpisodeRepo_Get_Call) Run ¶
func (_c *MockEpisodeRepo_Get_Call) Run(run func(ctx context.Context, episodeID uint32)) *MockEpisodeRepo_Get_Call
type MockEpisodeRepo_ListByType_Call ¶
MockEpisodeRepo_ListByType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListByType'
func (*MockEpisodeRepo_ListByType_Call) Return ¶
func (_c *MockEpisodeRepo_ListByType_Call) Return(_a0 []model.Episode, _a1 error) *MockEpisodeRepo_ListByType_Call
func (*MockEpisodeRepo_ListByType_Call) Run ¶
func (_c *MockEpisodeRepo_ListByType_Call) Run(run func(ctx context.Context, subjectID uint32, epType int8, limit int, offset int)) *MockEpisodeRepo_ListByType_Call
type MockEpisodeRepo_List_Call ¶
MockEpisodeRepo_List_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'List'
func (*MockEpisodeRepo_List_Call) Return ¶
func (_c *MockEpisodeRepo_List_Call) Return(_a0 []model.Episode, _a1 error) *MockEpisodeRepo_List_Call
func (*MockEpisodeRepo_List_Call) Run ¶
func (_c *MockEpisodeRepo_List_Call) Run(run func(ctx context.Context, subjectID uint32, limit int, offset int)) *MockEpisodeRepo_List_Call
type MockIndexRepo ¶
MockIndexRepo is an autogenerated mock type for the IndexRepo type
func (*MockIndexRepo) CountSubjects ¶
func (_m *MockIndexRepo) CountSubjects(ctx context.Context, id uint32, subjectType uint8) (int64, error)
CountSubjects provides a mock function with given fields: ctx, id, subjectType
func (*MockIndexRepo) EXPECT ¶
func (_m *MockIndexRepo) EXPECT() *MockIndexRepo_Expecter
func (*MockIndexRepo) ListSubjects ¶
func (_m *MockIndexRepo) ListSubjects(ctx context.Context, id uint32, subjectType uint8, limit int, offset int) ([]IndexSubject, error)
ListSubjects provides a mock function with given fields: ctx, id, subjectType, limit, offset
type MockIndexRepo_CountSubjects_Call ¶
MockIndexRepo_CountSubjects_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CountSubjects'
func (*MockIndexRepo_CountSubjects_Call) Return ¶
func (_c *MockIndexRepo_CountSubjects_Call) Return(_a0 int64, _a1 error) *MockIndexRepo_CountSubjects_Call
func (*MockIndexRepo_CountSubjects_Call) Run ¶
func (_c *MockIndexRepo_CountSubjects_Call) Run(run func(ctx context.Context, id uint32, subjectType uint8)) *MockIndexRepo_CountSubjects_Call
type MockIndexRepo_Expecter ¶
type MockIndexRepo_Expecter struct {
// contains filtered or unexported fields
}
func (*MockIndexRepo_Expecter) CountSubjects ¶
func (_e *MockIndexRepo_Expecter) CountSubjects(ctx interface{}, id interface{}, subjectType interface{}) *MockIndexRepo_CountSubjects_Call
CountSubjects is a helper method to define mock.On call
- ctx context.Context
- id uint32
- subjectType uint8
func (*MockIndexRepo_Expecter) Get ¶
func (_e *MockIndexRepo_Expecter) Get(ctx interface{}, id interface{}) *MockIndexRepo_Get_Call
Get is a helper method to define mock.On call
- ctx context.Context
- id uint32
func (*MockIndexRepo_Expecter) IsNsfw ¶
func (_e *MockIndexRepo_Expecter) IsNsfw(ctx interface{}, id interface{}) *MockIndexRepo_IsNsfw_Call
IsNsfw is a helper method to define mock.On call
- ctx context.Context
- id uint32
func (*MockIndexRepo_Expecter) ListSubjects ¶
func (_e *MockIndexRepo_Expecter) ListSubjects(ctx interface{}, id interface{}, subjectType interface{}, limit interface{}, offset interface{}) *MockIndexRepo_ListSubjects_Call
ListSubjects is a helper method to define mock.On call
- ctx context.Context
- id uint32
- subjectType uint8
- limit int
- offset int
type MockIndexRepo_Get_Call ¶
MockIndexRepo_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get'
func (*MockIndexRepo_Get_Call) Return ¶
func (_c *MockIndexRepo_Get_Call) Return(_a0 model.Index, _a1 error) *MockIndexRepo_Get_Call
func (*MockIndexRepo_Get_Call) Run ¶
func (_c *MockIndexRepo_Get_Call) Run(run func(ctx context.Context, id uint32)) *MockIndexRepo_Get_Call
type MockIndexRepo_IsNsfw_Call ¶
MockIndexRepo_IsNsfw_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsNsfw'
func (*MockIndexRepo_IsNsfw_Call) Return ¶
func (_c *MockIndexRepo_IsNsfw_Call) Return(_a0 bool, _a1 error) *MockIndexRepo_IsNsfw_Call
func (*MockIndexRepo_IsNsfw_Call) Run ¶
func (_c *MockIndexRepo_IsNsfw_Call) Run(run func(ctx context.Context, id uint32)) *MockIndexRepo_IsNsfw_Call
type MockIndexRepo_ListSubjects_Call ¶
MockIndexRepo_ListSubjects_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListSubjects'
func (*MockIndexRepo_ListSubjects_Call) Return ¶
func (_c *MockIndexRepo_ListSubjects_Call) Return(_a0 []IndexSubject, _a1 error) *MockIndexRepo_ListSubjects_Call
func (*MockIndexRepo_ListSubjects_Call) Run ¶
func (_c *MockIndexRepo_ListSubjects_Call) Run(run func(ctx context.Context, id uint32, subjectType uint8, limit int, offset int)) *MockIndexRepo_ListSubjects_Call
type MockPersonRepo ¶
MockPersonRepo is an autogenerated mock type for the PersonRepo type
func (*MockPersonRepo) EXPECT ¶
func (_m *MockPersonRepo) EXPECT() *MockPersonRepo_Expecter
func (*MockPersonRepo) GetActors ¶
func (_m *MockPersonRepo) GetActors(ctx context.Context, subjectID uint32, characterIDs ...uint32) (map[uint32][]model.Person, error)
GetActors provides a mock function with given fields: ctx, subjectID, characterIDs
func (*MockPersonRepo) GetCharacterRelated ¶
func (_m *MockPersonRepo) GetCharacterRelated(ctx context.Context, subjectID uint32) ([]CharacterCast, error)
GetCharacterRelated provides a mock function with given fields: ctx, subjectID
func (*MockPersonRepo) GetSubjectRelated ¶
func (_m *MockPersonRepo) GetSubjectRelated(ctx context.Context, subjectID uint32) ([]model.Person, []model.PersonSubjectRelation, error)
GetSubjectRelated provides a mock function with given fields: ctx, subjectID
type MockPersonRepo_Expecter ¶
type MockPersonRepo_Expecter struct {
// contains filtered or unexported fields
}
func (*MockPersonRepo_Expecter) Get ¶
func (_e *MockPersonRepo_Expecter) Get(ctx interface{}, id interface{}) *MockPersonRepo_Get_Call
Get is a helper method to define mock.On call
- ctx context.Context
- id uint32
func (*MockPersonRepo_Expecter) GetActors ¶
func (_e *MockPersonRepo_Expecter) GetActors(ctx interface{}, subjectID interface{}, characterIDs ...interface{}) *MockPersonRepo_GetActors_Call
GetActors is a helper method to define mock.On call
- ctx context.Context
- subjectID uint32
- characterIDs ...uint32
func (*MockPersonRepo_Expecter) GetCharacterRelated ¶
func (_e *MockPersonRepo_Expecter) GetCharacterRelated(ctx interface{}, subjectID interface{}) *MockPersonRepo_GetCharacterRelated_Call
GetCharacterRelated is a helper method to define mock.On call
- ctx context.Context
- subjectID uint32
func (*MockPersonRepo_Expecter) GetSubjectRelated ¶
func (_e *MockPersonRepo_Expecter) GetSubjectRelated(ctx interface{}, subjectID interface{}) *MockPersonRepo_GetSubjectRelated_Call
GetSubjectRelated is a helper method to define mock.On call
- ctx context.Context
- subjectID uint32
type MockPersonRepo_GetActors_Call ¶
MockPersonRepo_GetActors_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetActors'
func (*MockPersonRepo_GetActors_Call) Return ¶
func (_c *MockPersonRepo_GetActors_Call) Return(_a0 map[uint32][]model.Person, _a1 error) *MockPersonRepo_GetActors_Call
func (*MockPersonRepo_GetActors_Call) Run ¶
func (_c *MockPersonRepo_GetActors_Call) Run(run func(ctx context.Context, subjectID uint32, characterIDs ...uint32)) *MockPersonRepo_GetActors_Call
type MockPersonRepo_GetCharacterRelated_Call ¶
MockPersonRepo_GetCharacterRelated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCharacterRelated'
func (*MockPersonRepo_GetCharacterRelated_Call) Return ¶
func (_c *MockPersonRepo_GetCharacterRelated_Call) Return(_a0 []CharacterCast, _a1 error) *MockPersonRepo_GetCharacterRelated_Call
func (*MockPersonRepo_GetCharacterRelated_Call) Run ¶
func (_c *MockPersonRepo_GetCharacterRelated_Call) Run(run func(ctx context.Context, subjectID uint32)) *MockPersonRepo_GetCharacterRelated_Call
type MockPersonRepo_GetSubjectRelated_Call ¶
MockPersonRepo_GetSubjectRelated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSubjectRelated'
func (*MockPersonRepo_GetSubjectRelated_Call) Return ¶
func (_c *MockPersonRepo_GetSubjectRelated_Call) Return(_a0 []model.Person, _a1 []model.PersonSubjectRelation, _a2 error) *MockPersonRepo_GetSubjectRelated_Call
func (*MockPersonRepo_GetSubjectRelated_Call) Run ¶
func (_c *MockPersonRepo_GetSubjectRelated_Call) Run(run func(ctx context.Context, subjectID uint32)) *MockPersonRepo_GetSubjectRelated_Call
type MockPersonRepo_Get_Call ¶
MockPersonRepo_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get'
func (*MockPersonRepo_Get_Call) Return ¶
func (_c *MockPersonRepo_Get_Call) Return(_a0 model.Person, _a1 error) *MockPersonRepo_Get_Call
func (*MockPersonRepo_Get_Call) Run ¶
func (_c *MockPersonRepo_Get_Call) Run(run func(ctx context.Context, id uint32)) *MockPersonRepo_Get_Call
type MockSubjectRepo ¶
MockSubjectRepo is an autogenerated mock type for the SubjectRepo type
func (*MockSubjectRepo) EXPECT ¶
func (_m *MockSubjectRepo) EXPECT() *MockSubjectRepo_Expecter
func (*MockSubjectRepo) GetCharacterRelated ¶
func (_m *MockSubjectRepo) GetCharacterRelated(ctx context.Context, characterID uint32) ([]model.Subject, []model.CharacterSubjectRelation, error)
GetCharacterRelated provides a mock function with given fields: ctx, characterID
func (*MockSubjectRepo) GetPersonRelated ¶
func (_m *MockSubjectRepo) GetPersonRelated(ctx context.Context, personID uint32) ([]model.Subject, []model.PersonSubjectRelation, error)
GetPersonRelated provides a mock function with given fields: ctx, personID
func (*MockSubjectRepo) GetSubjectRelated ¶
func (_m *MockSubjectRepo) GetSubjectRelated(ctx context.Context, subjectID uint32) ([]model.Subject, []model.SubjectInternalRelation, error)
GetSubjectRelated provides a mock function with given fields: ctx, subjectID
type MockSubjectRepo_Expecter ¶
type MockSubjectRepo_Expecter struct {
// contains filtered or unexported fields
}
func (*MockSubjectRepo_Expecter) Get ¶
func (_e *MockSubjectRepo_Expecter) Get(ctx interface{}, id interface{}) *MockSubjectRepo_Get_Call
Get is a helper method to define mock.On call
- ctx context.Context
- id uint32
func (*MockSubjectRepo_Expecter) GetCharacterRelated ¶
func (_e *MockSubjectRepo_Expecter) GetCharacterRelated(ctx interface{}, characterID interface{}) *MockSubjectRepo_GetCharacterRelated_Call
GetCharacterRelated is a helper method to define mock.On call
- ctx context.Context
- characterID uint32
func (*MockSubjectRepo_Expecter) GetPersonRelated ¶
func (_e *MockSubjectRepo_Expecter) GetPersonRelated(ctx interface{}, personID interface{}) *MockSubjectRepo_GetPersonRelated_Call
GetPersonRelated is a helper method to define mock.On call
- ctx context.Context
- personID uint32
func (*MockSubjectRepo_Expecter) GetSubjectRelated ¶
func (_e *MockSubjectRepo_Expecter) GetSubjectRelated(ctx interface{}, subjectID interface{}) *MockSubjectRepo_GetSubjectRelated_Call
GetSubjectRelated is a helper method to define mock.On call
- ctx context.Context
- subjectID uint32
type MockSubjectRepo_GetCharacterRelated_Call ¶
MockSubjectRepo_GetCharacterRelated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetCharacterRelated'
func (*MockSubjectRepo_GetCharacterRelated_Call) Return ¶
func (_c *MockSubjectRepo_GetCharacterRelated_Call) Return(_a0 []model.Subject, _a1 []model.CharacterSubjectRelation, _a2 error) *MockSubjectRepo_GetCharacterRelated_Call
func (*MockSubjectRepo_GetCharacterRelated_Call) Run ¶
func (_c *MockSubjectRepo_GetCharacterRelated_Call) Run(run func(ctx context.Context, characterID uint32)) *MockSubjectRepo_GetCharacterRelated_Call
type MockSubjectRepo_GetPersonRelated_Call ¶
MockSubjectRepo_GetPersonRelated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPersonRelated'
func (*MockSubjectRepo_GetPersonRelated_Call) Return ¶
func (_c *MockSubjectRepo_GetPersonRelated_Call) Return(_a0 []model.Subject, _a1 []model.PersonSubjectRelation, _a2 error) *MockSubjectRepo_GetPersonRelated_Call
func (*MockSubjectRepo_GetPersonRelated_Call) Run ¶
func (_c *MockSubjectRepo_GetPersonRelated_Call) Run(run func(ctx context.Context, personID uint32)) *MockSubjectRepo_GetPersonRelated_Call
type MockSubjectRepo_GetSubjectRelated_Call ¶
MockSubjectRepo_GetSubjectRelated_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSubjectRelated'
func (*MockSubjectRepo_GetSubjectRelated_Call) Return ¶
func (_c *MockSubjectRepo_GetSubjectRelated_Call) Return(_a0 []model.Subject, _a1 []model.SubjectInternalRelation, _a2 error) *MockSubjectRepo_GetSubjectRelated_Call
func (*MockSubjectRepo_GetSubjectRelated_Call) Run ¶
func (_c *MockSubjectRepo_GetSubjectRelated_Call) Run(run func(ctx context.Context, subjectID uint32)) *MockSubjectRepo_GetSubjectRelated_Call
type MockSubjectRepo_Get_Call ¶
MockSubjectRepo_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get'
func (*MockSubjectRepo_Get_Call) Return ¶
func (_c *MockSubjectRepo_Get_Call) Return(_a0 model.Subject, _a1 error) *MockSubjectRepo_Get_Call
func (*MockSubjectRepo_Get_Call) Run ¶
func (_c *MockSubjectRepo_Get_Call) Run(run func(ctx context.Context, id uint32)) *MockSubjectRepo_Get_Call
type MockSubjectService ¶
MockSubjectService is an autogenerated mock type for the SubjectService type
func (*MockSubjectService) EXPECT ¶
func (_m *MockSubjectService) EXPECT() *MockSubjectService_Expecter
type MockSubjectService_Expecter ¶
type MockSubjectService_Expecter struct {
// contains filtered or unexported fields
}
func (*MockSubjectService_Expecter) Get ¶
func (_e *MockSubjectService_Expecter) Get(ctx interface{}, id interface{}) *MockSubjectService_Get_Call
Get is a helper method to define mock.On call
- ctx context.Context
- id uint32
type MockSubjectService_Get_Call ¶
MockSubjectService_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get'
func (*MockSubjectService_Get_Call) Return ¶
func (_c *MockSubjectService_Get_Call) Return(_a0 model.Subject, _a1 error) *MockSubjectService_Get_Call
func (*MockSubjectService_Get_Call) Run ¶
func (_c *MockSubjectService_Get_Call) Run(run func(ctx context.Context, id uint32)) *MockSubjectService_Get_Call
type MockUserRepo ¶
MockUserRepo is an autogenerated mock type for the UserRepo type
func (*MockUserRepo) CountCollections ¶
func (_m *MockUserRepo) CountCollections(ctx context.Context, userID uint32, subjectType uint8, collectionType uint8, showPrivate bool) (int64, error)
CountCollections provides a mock function with given fields: ctx, userID, subjectType, collectionType, showPrivate
func (*MockUserRepo) EXPECT ¶
func (_m *MockUserRepo) EXPECT() *MockUserRepo_Expecter
func (*MockUserRepo) GetByName ¶
GetByName provides a mock function with given fields: ctx, username
func (*MockUserRepo) ListCollections ¶
func (_m *MockUserRepo) ListCollections(ctx context.Context, userID uint32, subjectType uint8, collectionType uint8, showPrivate bool, limit int, offset int) ([]model.Collection, error)
ListCollections provides a mock function with given fields: ctx, userID, subjectType, collectionType, showPrivate, limit, offset
type MockUserRepo_CountCollections_Call ¶
MockUserRepo_CountCollections_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CountCollections'
func (*MockUserRepo_CountCollections_Call) Return ¶
func (_c *MockUserRepo_CountCollections_Call) Return(_a0 int64, _a1 error) *MockUserRepo_CountCollections_Call
func (*MockUserRepo_CountCollections_Call) Run ¶
func (_c *MockUserRepo_CountCollections_Call) Run(run func(ctx context.Context, userID uint32, subjectType uint8, collectionType uint8, showPrivate bool)) *MockUserRepo_CountCollections_Call
type MockUserRepo_Expecter ¶
type MockUserRepo_Expecter struct {
// contains filtered or unexported fields
}
func (*MockUserRepo_Expecter) CountCollections ¶
func (_e *MockUserRepo_Expecter) CountCollections(ctx interface{}, userID interface{}, subjectType interface{}, collectionType interface{}, showPrivate interface{}) *MockUserRepo_CountCollections_Call
CountCollections is a helper method to define mock.On call
- ctx context.Context
- userID uint32
- subjectType uint8
- collectionType uint8
- showPrivate bool
func (*MockUserRepo_Expecter) GetByID ¶
func (_e *MockUserRepo_Expecter) GetByID(ctx interface{}, userID interface{}) *MockUserRepo_GetByID_Call
GetByID is a helper method to define mock.On call
- ctx context.Context
- userID uint32
func (*MockUserRepo_Expecter) GetByIDs ¶
func (_e *MockUserRepo_Expecter) GetByIDs(ctx interface{}, ids ...interface{}) *MockUserRepo_GetByIDs_Call
GetByIDs is a helper method to define mock.On call
- ctx context.Context
- ids ...uint32
func (*MockUserRepo_Expecter) GetByName ¶
func (_e *MockUserRepo_Expecter) GetByName(ctx interface{}, username interface{}) *MockUserRepo_GetByName_Call
GetByName is a helper method to define mock.On call
- ctx context.Context
- username string
func (*MockUserRepo_Expecter) ListCollections ¶
func (_e *MockUserRepo_Expecter) ListCollections(ctx interface{}, userID interface{}, subjectType interface{}, collectionType interface{}, showPrivate interface{}, limit interface{}, offset interface{}) *MockUserRepo_ListCollections_Call
ListCollections is a helper method to define mock.On call
- ctx context.Context
- userID uint32
- subjectType uint8
- collectionType uint8
- showPrivate bool
- limit int
- offset int
type MockUserRepo_GetByID_Call ¶
MockUserRepo_GetByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByID'
func (*MockUserRepo_GetByID_Call) Return ¶
func (_c *MockUserRepo_GetByID_Call) Return(_a0 model.User, _a1 error) *MockUserRepo_GetByID_Call
func (*MockUserRepo_GetByID_Call) Run ¶
func (_c *MockUserRepo_GetByID_Call) Run(run func(ctx context.Context, userID uint32)) *MockUserRepo_GetByID_Call
type MockUserRepo_GetByIDs_Call ¶
MockUserRepo_GetByIDs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByIDs'
func (*MockUserRepo_GetByIDs_Call) Return ¶
func (_c *MockUserRepo_GetByIDs_Call) Return(_a0 map[uint32]model.User, _a1 error) *MockUserRepo_GetByIDs_Call
func (*MockUserRepo_GetByIDs_Call) Run ¶
func (_c *MockUserRepo_GetByIDs_Call) Run(run func(ctx context.Context, ids ...uint32)) *MockUserRepo_GetByIDs_Call
type MockUserRepo_GetByName_Call ¶
MockUserRepo_GetByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetByName'
func (*MockUserRepo_GetByName_Call) Return ¶
func (_c *MockUserRepo_GetByName_Call) Return(_a0 model.User, _a1 error) *MockUserRepo_GetByName_Call
func (*MockUserRepo_GetByName_Call) Run ¶
func (_c *MockUserRepo_GetByName_Call) Run(run func(ctx context.Context, username string)) *MockUserRepo_GetByName_Call
type MockUserRepo_ListCollections_Call ¶
MockUserRepo_ListCollections_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListCollections'
func (*MockUserRepo_ListCollections_Call) Return ¶
func (_c *MockUserRepo_ListCollections_Call) Return(_a0 []model.Collection, _a1 error) *MockUserRepo_ListCollections_Call
type PersonIDType ¶
type PersonIDType = uint32
type PersonRepo ¶
type PersonRepo interface { Get(ctx context.Context, id uint32) (model.Person, error) GetSubjectRelated( ctx context.Context, subjectID SubjectIDType, ) ([]model.Person, []model.PersonSubjectRelation, error) GetActors( ctx context.Context, subjectID SubjectIDType, characterIDs ...CharacterIDType, ) (map[CharacterIDType][]model.Person, error) GetCharacterRelated( ctx context.Context, subjectID CharacterIDType, ) ([]CharacterCast, error) }
type SubjectIDType ¶
type SubjectIDType = uint32 // in case we need future change, but I guess not...
type SubjectRepo ¶
type SubjectRepo interface { // Get return a repository model. Get(ctx context.Context, id uint32) (model.Subject, error) GetPersonRelated( ctx context.Context, personID PersonIDType, ) ([]model.Subject, []model.PersonSubjectRelation, error) GetCharacterRelated( ctx context.Context, characterID PersonIDType, ) ([]model.Subject, []model.CharacterSubjectRelation, error) GetSubjectRelated( ctx context.Context, subjectID SubjectIDType, ) ([]model.Subject, []model.SubjectInternalRelation, error) }
type SubjectService ¶
type UserRepo ¶
type UserRepo interface { // GetByID find a user by uid. GetByID(ctx context.Context, userID uint32) (model.User, error) // GetByName find a user by username. GetByName(ctx context.Context, username string) (model.User, error) GetByIDs(ctx context.Context, ids ...uint32) (map[uint32]model.User, error) CountCollections( ctx context.Context, userID uint32, subjectType model.SubjectType, collectionType uint8, showPrivate bool, ) (int64, error) ListCollections( ctx context.Context, userID uint32, subjectType model.SubjectType, collectionType uint8, showPrivate bool, limit, offset int, ) ([]model.Collection, error) }