snapshot

package
v0.0.0-...-90a5f25 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

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

func (r *Repository) GetSnapshotByID(ctx context.Context, id int64) (*Snapshot, error)

GetSnapshotByID get snapshot by ID

func (*Repository) List

func (r *Repository) List(ctx context.Context, queryFields *Snapshot) ([]*Snapshot, error)

List returns list of snapshots

func (*Repository) UpdateLatestVersion

func (r *Repository) UpdateLatestVersion(ctx context.Context, snapshot *Snapshot) error

UpdateLatestVersion returns latest version number

type Snapshot

type Snapshot struct {
	ID        int64  `binding:"required"`
	Namespace string `binding:"required"`
	Name      string `binding:"required"`
	Version   string `binding:"required,version"`
	Latest    bool   `binding:"required"`
}

Snapshot represents specific version of protodescriptorset

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL