Documentation ¶
Index ¶
- type BinDao
- func (d *BinDao) Delete(bin *ds.Bin) (err error)
- func (d *BinDao) GenerateId() string
- func (d *BinDao) GetAll() (bins []ds.Bin, err error)
- func (d *BinDao) GetByBytes(limit int) (bins []ds.Bin, err error)
- func (d *BinDao) GetByCreated(limit int) (bins []ds.Bin, err error)
- func (d *BinDao) GetByDownloads(limit int) (bins []ds.Bin, err error)
- func (d *BinDao) GetByFiles(limit int) (bins []ds.Bin, err error)
- func (d *BinDao) GetByID(id string) (bin ds.Bin, found bool, err error)
- func (d *BinDao) GetLastUpdated(limit int) (bins []ds.Bin, err error)
- func (d *BinDao) GetPendingDelete() (bins []ds.Bin, err error)
- func (d *BinDao) Insert(bin *ds.Bin) (err error)
- func (d *BinDao) RegisterDownload(bin *ds.Bin) (err error)
- func (d *BinDao) RegisterUpdate(bin *ds.Bin) (err error)
- func (d *BinDao) Update(bin *ds.Bin) (err error)
- func (d *BinDao) Upsert(bin *ds.Bin) (err error)
- func (d *BinDao) ValidateInput(bin *ds.Bin) error
- type ClientDao
- func (c *ClientDao) Ban(IPsToBan []string, banByRemoteAddr string) (err error)
- func (c *ClientDao) Cleanup(days uint64) (count int64, err error)
- func (c *ClientDao) GetAll() (clients []ds.Client, err error)
- func (c *ClientDao) GetByBannedAt(limit int) (clients []ds.Client, err error)
- func (c *ClientDao) GetByIP(ip net.IP) (client ds.Client, found bool, err error)
- func (c *ClientDao) GetByLastActiveAt(limit int) (clients []ds.Client, err error)
- func (c *ClientDao) GetByRemoteAddr(remoteAddr string) (client ds.Client, found bool, err error)
- func (c *ClientDao) GetByRequests(limit int) (clients []ds.Client, err error)
- func (c *ClientDao) Update(client *ds.Client) (err error)
- type DAO
- func (dao DAO) Bin() *BinDao
- func (dao DAO) Client() *ClientDao
- func (dao DAO) Close() error
- func (dao DAO) CreateSchema() error
- func (dao DAO) File() *FileDao
- func (dao DAO) Metrics() *MetricsDao
- func (dao DAO) ResetDB() error
- func (dao DAO) Stats() sql.DBStats
- func (dao DAO) Status() bool
- func (dao DAO) Transaction() *TransactionDao
- type FileDao
- func (d *FileDao) Delete(file *ds.File) (err error)
- func (d *FileDao) FileByChecksum(sha256 string) (files []ds.File, err error)
- func (d *FileDao) FilesByChecksum(limit int) (files []ds.FileByChecksum, err error)
- func (d *FileDao) GetAll(available bool) (files []ds.File, err error)
- func (d *FileDao) GetByBin(id string, inStorage bool) (files []ds.File, err error)
- func (d *FileDao) GetByID(id int) (file ds.File, found bool, err error)
- func (d *FileDao) GetByName(bin string, filename string) (file ds.File, found bool, err error)
- func (d *FileDao) GetPendingDelete() (files []ds.File, err error)
- func (d *FileDao) GetTopDownloads(limit int) (files []ds.File, err error)
- func (d *FileDao) Insert(file *ds.File) (err error)
- func (d *FileDao) RegisterDownload(file *ds.File) (err error)
- func (d *FileDao) Update(file *ds.File) (err error)
- func (d *FileDao) ValidateInput(file *ds.File) error
- type MetricsDao
- type TransactionDao
- func (d *TransactionDao) Cleanup(retention uint64) (count int64, err error)
- func (d *TransactionDao) GetByBin(bin string) (transactions []ds.Transaction, err error)
- func (d *TransactionDao) GetByClientId(id string) (transactions []ds.Transaction, err error)
- func (d *TransactionDao) GetByIP(ip string) (transactions []ds.Transaction, err error)
- func (d *TransactionDao) Insert(t *ds.Transaction) (err error)
- func (d *TransactionDao) Register(r *http.Request, bin string, filename string, timestamp time.Time, ...) (transaction *ds.Transaction, err error)
- func (d *TransactionDao) Update(t *ds.Transaction) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BinDao ¶
type BinDao struct {
// contains filtered or unexported fields
}
func (*BinDao) GenerateId ¶
func (*BinDao) GetByDownloads ¶
func (*BinDao) GetLastUpdated ¶
type ClientDao ¶
type ClientDao struct {
// contains filtered or unexported fields
}
func (*ClientDao) GetByBannedAt ¶
func (*ClientDao) GetByLastActiveAt ¶
func (*ClientDao) GetByRemoteAddr ¶
func (*ClientDao) GetByRequests ¶
type DAO ¶
type DAO struct { ConnStr string // contains filtered or unexported fields }
func (DAO) CreateSchema ¶
func (DAO) Metrics ¶
func (dao DAO) Metrics() *MetricsDao
func (DAO) Transaction ¶
func (dao DAO) Transaction() *TransactionDao
type FileDao ¶
type FileDao struct {
// contains filtered or unexported fields
}
func (*FileDao) FileByChecksum ¶
func (*FileDao) FilesByChecksum ¶
func (d *FileDao) FilesByChecksum(limit int) (files []ds.FileByChecksum, err error)
func (*FileDao) GetPendingDelete ¶
func (*FileDao) GetTopDownloads ¶
type MetricsDao ¶
type MetricsDao struct {
// contains filtered or unexported fields
}
func (*MetricsDao) StorageBytesAllocated ¶
func (d *MetricsDao) StorageBytesAllocated() (totalBytes uint64)
func (*MetricsDao) UpdateMetrics ¶
func (d *MetricsDao) UpdateMetrics(metrics *ds.Metrics) (err error)
type TransactionDao ¶
type TransactionDao struct {
// contains filtered or unexported fields
}
func (*TransactionDao) Cleanup ¶
func (d *TransactionDao) Cleanup(retention uint64) (count int64, err error)
func (*TransactionDao) GetByBin ¶
func (d *TransactionDao) GetByBin(bin string) (transactions []ds.Transaction, err error)
func (*TransactionDao) GetByClientId ¶
func (d *TransactionDao) GetByClientId(id string) (transactions []ds.Transaction, err error)
func (*TransactionDao) GetByIP ¶
func (d *TransactionDao) GetByIP(ip string) (transactions []ds.Transaction, err error)
func (*TransactionDao) Insert ¶
func (d *TransactionDao) Insert(t *ds.Transaction) (err error)
func (*TransactionDao) Update ¶
func (d *TransactionDao) Update(t *ds.Transaction) (err error)
Click to show internal directories.
Click to hide internal directories.