Documentation
¶
Index ¶
- Constants
- func AnyUserMock() user.Repo
- func GetGorm(tb testing.TB) *gorm.DB
- func GetQuery(tb testing.TB) *query.Query
- func GetRedis(tb testing.TB) *redis.Client
- func GetWebApp(tb testing.TB, m Mock) *echo.Echo
- func MockAuthRepo(m auth.Repo) fx.Option
- func MockAuthService(m auth.Service) fx.Option
- func MockCache(mock cache.RedisCache) fx.Option
- func MockCharacterRepo(m character.Repo) fx.Option
- func MockEmptyCache() fx.Option
- func MockEpisodeRepo(m episode.Repo) fx.Option
- func MockIndexRepo(repo index.Repo) fx.Option
- func MockNoticationRepo(repo notification.Repo) fx.Option
- func MockPersonRepo(m person.Repo) fx.Option
- func MockPrivateMessageRepo(repo pm.Repo) fx.Option
- func MockRevisionRepo(repo revision.Repo) fx.Option
- func MockSessionManager(repo session.Manager) fx.Option
- func MockSubjectReadRepo(m subject.CachedRepo) fx.Option
- func MockSubjectRepo(m subject.Repo) fx.Option
- func MockTimeLineSrv(m timeline.Service) fx.Option
- func MockUserRepo(repo user.Repo) fx.Option
- func RequireEnv(tb testing.TB, envs ...string)
- func RunAndCleanup(tb testing.TB, f func())
- type Mock
Constants ¶
View Source
const EnvMysql = "mysql"
View Source
const EnvRedis = "redis"
View Source
const TreeHoleAccessToken = "a_development_access_token"
Variables ¶
This section is empty.
Functions ¶
func AnyUserMock ¶ added in v0.30.16
func MockEmptyCache ¶
func MockNoticationRepo ¶ added in v0.29.0
func MockNoticationRepo(repo notification.Repo) fx.Option
func MockSubjectReadRepo ¶ added in v0.30.15
func MockSubjectReadRepo(m subject.CachedRepo) fx.Option
func RequireEnv ¶
RequireEnv
func TestGet(t *testing.T) {
RequireEnv(t, test.EnvRedis, test.EnvMysql)
...
}
func RunAndCleanup ¶
RunAndCleanup will run a function immediately and add it to t.Cleanup.
Types ¶
type Mock ¶
type Mock struct {
SubjectRepo subject.Repo
SubjectCachedRepo subject.CachedRepo
PersonRepo person.Repo
CharacterRepo character.Repo
AuthRepo auth.Repo
AuthService auth.Service
EpisodeRepo episode.Repo
UserRepo user.Repo
IndexRepo index.Repo
RevisionRepo revision.Repo
CollectionRepo collections.Repo
TimeLineSrv timeline.Service
SessionManager session.Manager
Cache cache.RedisCache
PrivateMessageRepo pm.Repo
NotificationRepo notification.Repo
HTTPMock *httpmock.MockTransport
Dam *dam.Dam
}
Click to show internal directories.
Click to hide internal directories.