Documentation ¶
Index ¶
- type ShortLinkGenerator
- func (g *ShortLinkGenerator) DeleteShortLink(ctx context.Context, shortLinkPath string) error
- func (g *ShortLinkGenerator) GenShortLink(ctx context.Context, rawLink string) (*db_base.ShortLink, error)
- func (g *ShortLinkGenerator) GenShortLinkWithExpire(ctx context.Context, rawLink string, expireAt time.Time) (*db_base.ShortLink, error)
- func (g *ShortLinkGenerator) GetByRawLink(ctx context.Context, rawLink string) (*db_base.ShortLink, error)
- func (g *ShortLinkGenerator) GetByShortLinkPath(ctx context.Context, shortLinkPath string) (*db_base.ShortLink, error)
- func (g *ShortLinkGenerator) SetShortLinkExpire(ctx context.Context, shorLinkPath string, expireAt time.Time) error
- func (g *ShortLinkGenerator) WithMysql(config *mysql_db.MysqlDbConfig) *ShortLinkGenerator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ShortLinkGenerator ¶
type ShortLinkGenerator struct {
// contains filtered or unexported fields
}
TODO: add redis cache and local cache
func GetShortLinkGenerator ¶
func GetShortLinkGenerator() *ShortLinkGenerator
func (*ShortLinkGenerator) DeleteShortLink ¶
func (g *ShortLinkGenerator) DeleteShortLink(ctx context.Context, shortLinkPath string) error
func (*ShortLinkGenerator) GenShortLink ¶
func (*ShortLinkGenerator) GenShortLinkWithExpire ¶
func (*ShortLinkGenerator) GetByRawLink ¶
func (*ShortLinkGenerator) GetByShortLinkPath ¶
func (*ShortLinkGenerator) SetShortLinkExpire ¶
func (*ShortLinkGenerator) WithMysql ¶
func (g *ShortLinkGenerator) WithMysql(config *mysql_db.MysqlDbConfig) *ShortLinkGenerator
Click to show internal directories.
Click to hide internal directories.