Documentation
¶
Index ¶
- Variables
- type App
- func (a App) Close(ctx context.Context) errs.Error
- func (a App) CreateToken(ctx context.Context, targetUrl string, expiredAt *time.Time) (key string, added bool, err errs.Error)
- func (a App) DeleteLink(ctx context.Context, key string) errs.Error
- func (a App) GetLink(ctx context.Context, key string) (*Link, errs.Error)
- func (a App) HitLink(ctx context.Context, key string) (*Link, errs.Error)
- type Link
- type LinkStore
- type Tokenizer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Version = "devel" Commit = "devel" BuildTime = "devel" )
View Source
var ErrInvalidToken = errors.New("invalid token")
View Source
var ErrInvalidUrl = errors.New("invalid url")
View Source
var ErrNotFound = errors.New("not found")
Functions ¶
This section is empty.
Types ¶
type LinkStore ¶
type LinkStore interface {
Create(ctx context.Context, targetUrl string, expiredAt *time.Time) (int, bool, errs.Error)
Get(ctx context.Context, id int) (*Link, errs.Error)
Hit(ctx context.Context, id int) (*Link, errs.Error)
SetDeleted(ctx context.Context, id int) errs.Error
Delete(ctx context.Context, id int) errs.Error
Close(ctx context.Context) errs.Error
}
Click to show internal directories.
Click to hide internal directories.