Documentation ¶
Index ¶
- Variables
- type AuditDBReadStore
- type CounterStore
- type PageType
- type ReadStoreRedis
- func (s *ReadStoreRedis) GetDailyActiveUserCount(ctx context.Context, appID config.AppID, date *time.Time) (count int, redisKey string, err error)
- func (s *ReadStoreRedis) GetDailyPageViewCount(ctx context.Context, appID config.AppID, pageType PageType, date *time.Time) (pageView int, uniquePageView int, redisKeys []string, err error)
- func (s *ReadStoreRedis) GetMonthlyActiveUserCount(ctx context.Context, appID config.AppID, year int, month int) (count int, redisKey string, err error)
- func (s *ReadStoreRedis) GetWeeklyActiveUserCount(ctx context.Context, appID config.AppID, year int, week int) (count int, redisKey string, err error)
- func (s *ReadStoreRedis) SetKeysExpire(ctx context.Context, keys []string, expiration time.Duration) error
- type Service
- type StoreRedisLogger
- type WriteStoreRedis
Constants ¶
This section is empty.
Variables ¶
View Source
var DependencySet = wire.NewSet( NewStoreRedisLogger, wire.Struct(new(Service), "*"), wire.Struct(new(ReadStoreRedis), "*"), wire.Struct(new(WriteStoreRedis), "*"), wire.Struct(new(AuditDBReadStore), "*"), wire.Bind(new(CounterStore), new(*WriteStoreRedis)), )
View Source
var ErrMeterRedisIsNotConfigured = errors.New("meter redis is not configured")
Functions ¶
This section is empty.
Types ¶
type AuditDBReadStore ¶
type AuditDBReadStore struct { SQLBuilder *auditdb.SQLBuilder SQLExecutor *auditdb.ReadSQLExecutor }
func (*AuditDBReadStore) GetCountByActivityType ¶
func (*AuditDBReadStore) QueryPage ¶
func (s *AuditDBReadStore) QueryPage(ctx context.Context, appID string, opts audit.QueryPageOptions, pageArgs graphqlutil.PageArgs) ([]*audit.Log, uint64, error)
QueryPage is copied from pkg/lib/audit/read_store.go The ReadStore cannot be used here as it requires appID during initialization through injection
type CounterStore ¶
type ReadStoreRedis ¶
type ReadStoreRedis struct {
Redis *analyticredis.Handle
}
ReadStoreRedis provides methods to get analytic counts and set expiry to the keys after those count are collected
func (*ReadStoreRedis) GetDailyActiveUserCount ¶
func (*ReadStoreRedis) GetDailyPageViewCount ¶
func (*ReadStoreRedis) GetMonthlyActiveUserCount ¶
func (*ReadStoreRedis) GetWeeklyActiveUserCount ¶
func (*ReadStoreRedis) SetKeysExpire ¶
type Service ¶
type Service struct {
Counter CounterStore
}
Service provides methods for the app to record analytic count
func (*Service) TrackActiveUser ¶
type StoreRedisLogger ¶
func NewStoreRedisLogger ¶
func NewStoreRedisLogger(lf *log.Factory) StoreRedisLogger
type WriteStoreRedis ¶
type WriteStoreRedis struct { Redis *analyticredis.Handle AppID config.AppID Clock clock.Clock Logger StoreRedisLogger }
func (*WriteStoreRedis) TrackActiveUser ¶
func (s *WriteStoreRedis) TrackActiveUser(ctx context.Context, userID string) (err error)
func (*WriteStoreRedis) TrackPageView ¶
Click to show internal directories.
Click to hide internal directories.