biz

package
v0.0.0-...-102be31 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

ProviderSet is biz providers.

Functions

This section is empty.

Types

type ShortLink struct {
	Key      string    `json:"key,omitempty"`
	Link     string    `json:"link,omitempty"`
	ExpireAt time.Time `json:"expire_at,omitempty"`
}

type ShortLinkPage

type ShortLinkPage struct {
	NextPageToken string
	ShortLinks    []*ShortLink
}

type ShortLinkRepo

type ShortLinkRepo interface {
	Create(ctx context.Context, sl *ShortLink) (*ShortLink, error)
	Upsert(ctx context.Context, sl *ShortLink) (*ShortLink, error)
	GetByKey(ctx context.Context, key string) (*ShortLink, error)
	GetByLink(ctx context.Context, link string) (*ShortLink, error)
	DeleteByKey(ctx context.Context, key string) error
	List(ctx context.Context, pageSize int, pageToken string) (*ShortLinkPage, error)
	Flush(ctx context.Context) error
	Count(ctx context.Context) (int, error)
}

type ShortLinkRepoUsecase

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

func NewShortLinkRepoUsecase

func NewShortLinkRepoUsecase(sr ShortLinkRepo, filter *cuckoo.Filter, conf *conf.Data, logger log.Logger) *ShortLinkRepoUsecase

func (*ShortLinkRepoUsecase) Count

func (uc *ShortLinkRepoUsecase) Count(ctx context.Context) (int, error)

func (*ShortLinkRepoUsecase) Create

func (uc *ShortLinkRepoUsecase) Create(ctx context.Context, sl *ShortLink) (*ShortLink, error)

func (*ShortLinkRepoUsecase) Del

func (uc *ShortLinkRepoUsecase) Del(ctx context.Context, key string) error

func (*ShortLinkRepoUsecase) Flush

func (uc *ShortLinkRepoUsecase) Flush(ctx context.Context) error

func (*ShortLinkRepoUsecase) Get

func (uc *ShortLinkRepoUsecase) Get(ctx context.Context, key string) (*ShortLink, error)

func (*ShortLinkRepoUsecase) List

func (uc *ShortLinkRepoUsecase) List(ctx context.Context, pageSize int, pageToken string) ([]string, string, error)

func (*ShortLinkRepoUsecase) Upsert

func (uc *ShortLinkRepoUsecase) Upsert(ctx context.Context, sl *ShortLink) (*ShortLink, error)

Jump to

Keyboard shortcuts

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