Documentation ¶
Index ¶
- type Repo
- type Repository
- func (r *Repository) Create(snapshot models.Snapshot) error
- func (r *Repository) CreateBulk(snapshots []models.Snapshot) error
- func (r *Repository) Find(id int64) (found bool, snapshot models.Snapshot, err error)
- func (r *Repository) List(limit, offset uint) (count int64, snapshots []models.SnapshotsView, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository is the snapshots repo implementation.
func New ¶
func New(db *gorm.DB) *Repository
New creates an instance of repository using the provided db.
func (*Repository) Create ¶
func (r *Repository) Create(snapshot models.Snapshot) error
Create creates a Snapshot.
func (*Repository) CreateBulk ¶
func (r *Repository) CreateBulk(snapshots []models.Snapshot) error
func (*Repository) List ¶
func (r *Repository) List(limit, offset uint) (count int64, snapshots []models.SnapshotsView, err error)
List returns a list of snapshots from the newest to oldest. limit defines the limit for the maximum number of snapshots returned. since is used to paginate results based on the level. As the result is ordered descendingly the snapshots with level < since will be returned.
Click to show internal directories.
Click to hide internal directories.