Documentation ¶
Index ¶
- Variables
- type Repository
- func (r *Repository) Create(ctx context.Context, snapshot *Snapshot) error
- func (r *Repository) Delete(ctx context.Context, snapshot *Snapshot) error
- func (r *Repository) Exists(ctx context.Context, st *Snapshot) bool
- func (r *Repository) GetSnapshotByFields(ctx context.Context, namespace, name, version string, latest bool) (*Snapshot, error)
- func (r *Repository) GetSnapshotByID(ctx context.Context, id int64) (*Snapshot, error)
- func (r *Repository) List(ctx context.Context, queryFields *Snapshot) ([]*Snapshot, error)
- func (r *Repository) UpdateLatestVersion(ctx context.Context, snapshot *Snapshot) error
- type Snapshot
Constants ¶
This section is empty.
Variables ¶
View Source
var ( //ErrNotFound used when snapshot is not found ErrNotFound = errors.New("not found") )
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository DB access layer
func NewSnapshotRepository ¶
func NewSnapshotRepository(db *store.DB) *Repository
NewSnapshotRepository create instance repo
func (*Repository) Create ¶
func (r *Repository) Create(ctx context.Context, snapshot *Snapshot) error
Create inserts snapshot data
func (*Repository) Delete ¶
func (r *Repository) Delete(ctx context.Context, snapshot *Snapshot) error
Delete deletes snapshot data
func (*Repository) Exists ¶
func (r *Repository) Exists(ctx context.Context, st *Snapshot) bool
Exists checks if snapshot exits in DB or not
func (*Repository) GetSnapshotByFields ¶
func (r *Repository) GetSnapshotByFields(ctx context.Context, namespace, name, version string, latest bool) (*Snapshot, error)
GetSnapshotByFields returns full snapshot data
func (*Repository) GetSnapshotByID ¶
GetSnapshotByID get snapshot by ID
func (*Repository) UpdateLatestVersion ¶
func (r *Repository) UpdateLatestVersion(ctx context.Context, snapshot *Snapshot) error
UpdateLatestVersion returns latest version number
Click to show internal directories.
Click to hide internal directories.