Documentation ¶
Index ¶
- Variables
- type Repo
- func (r *Repo) Close() error
- func (r *Repo) Download(name string) (*domain.Download, error)
- func (r *Repo) Downloads() (d []domain.Download, err error)
- func (r *Repo) ListDownloadLog() (l []domain.DownloadLog, err error)
- func (r *Repo) LogDownload(u *domain.User, d *domain.Download, ip string) error
- func (r *Repo) OpenTokens() (t []domain.Token, err error)
- func (r *Repo) SetDownload(d *domain.Download) error
- func (r *Repo) SetToken(t *domain.Token) error
- func (r *Repo) SetUser(u *domain.User) error
- func (r *Repo) Token(name string) (*domain.Token, error)
- func (r *Repo) Tokens() (t []domain.Token, err error)
- func (r *Repo) User(username string) (*domain.User, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotFound is a not found error if Get does not retrieve a value ErrNotFound = errors.New("not_found") )
Functions ¶
This section is empty.
Types ¶
type Repo ¶
type Repo struct {
// contains filtered or unexported fields
}
func New ¶
New repo is returned To create the relevant MySQL databases on local please do the following:
mysql -u root (if password is set then add -p) mysql> CREATE DATABASE download CHARACTER SET = utf8; mysql> CREATE USER download IDENTIFIED BY 'password'; mysql> GRANT ALL on download.* TO download; mysql> drop user ''@'localhost';
The last command drops the anonymous user Repo basically ignores optimistic locking and will have lost update problem but since this is considered low volume and not a big deal if we allow additional download - decided to just ignore
func (*Repo) ListDownloadLog ¶
func (r *Repo) ListDownloadLog() (l []domain.DownloadLog, err error)
func (*Repo) LogDownload ¶
Click to show internal directories.
Click to hide internal directories.