Documentation ¶
Index ¶
- Variables
- type Leaf
- type LeafRepo
- type LeafUseCase
- func (lu *LeafUseCase) CountByBizTag(ctx context.Context, bizTag string) (int, error)
- func (lu *LeafUseCase) FindByBizID(ctx context.Context, bizID int64) (*Leaf, error)
- func (lu *LeafUseCase) GetID(ctx context.Context) int64
- func (lu *LeafUseCase) Save(ctx context.Context, leaf *Leaf) (int64, error)
- type ShortUrl
- type ShortUrlRepo
- type ShortUrlUseCase
- func (su *ShortUrlUseCase) CountForever(ctx context.Context)
- func (su *ShortUrlUseCase) FindByShort(ctx context.Context, short string) (*ShortUrl, error)
- func (su *ShortUrlUseCase) Save(ctx context.Context, short *ShortUrl) error
- func (su *ShortUrlUseCase) UpdateVisitCount(ctx context.Context, id int64)
Constants ¶
This section is empty.
Variables ¶
View Source
var ProviderSet = wire.NewSet(NewLeafUseCase, NewShortUrlUseCase)
ProviderSet is biz providers.
Functions ¶
This section is empty.
Types ¶
type LeafRepo ¶
type LeafRepo interface { Save(context.Context, *Leaf) (int64, error) Update(context.Context, int64, *Leaf) error Find(context.Context, int64) (*Leaf, error) FindByBizTag(context.Context, string) (*Leaf, error) CountByBizTag(context.Context, string) (int, error) ListAll(context.Context) ([]*Leaf, error) UpdateBuffer(context.Context, int64) ([]int64, error) }
type LeafUseCase ¶
type LeafUseCase struct {
// contains filtered or unexported fields
}
func NewLeafUseCase ¶
func (*LeafUseCase) CountByBizTag ¶
func (*LeafUseCase) FindByBizID ¶
type ShortUrlRepo ¶
type ShortUrlRepo interface { Save(context.Context, *ShortUrl) error Update(context.Context, int64, *ShortUrl) error Find(context.Context, int64) (*ShortUrl, error) ListAll(context.Context) ([]*ShortUrl, error) FindByShort(context.Context, string) (*ShortUrl, error) UpdateUrlCount(context.Context, int64, int64) error }
type ShortUrlUseCase ¶
type ShortUrlUseCase struct { ShortUrlRepo ShortUrlRepo LeafRepo LeafRepo // contains filtered or unexported fields }
func NewShortUrlUseCase ¶
func NewShortUrlUseCase(repo ShortUrlRepo, leafRepo LeafRepo, logger log.Logger) *ShortUrlUseCase
func (*ShortUrlUseCase) CountForever ¶
func (su *ShortUrlUseCase) CountForever(ctx context.Context)
func (*ShortUrlUseCase) FindByShort ¶
func (*ShortUrlUseCase) Save ¶
func (su *ShortUrlUseCase) Save(ctx context.Context, short *ShortUrl) error
func (*ShortUrlUseCase) UpdateVisitCount ¶
func (su *ShortUrlUseCase) UpdateVisitCount(ctx context.Context, id int64)
UpdateVisitCount url visit count + 1
Click to show internal directories.
Click to hide internal directories.