database

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryIs = iota
	QueryExists
	QueryMatches
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database interface {
	Begin(ctx context.Context) (Tx, error)
	// Convenience
	DoQuery(ctx context.Context, query *Query) ([]*flagstate.Repository, error)

	ModificationTime() (time.Time, error)
}

func NewPostgresDB

func NewPostgresDB(url string) (Database, error)

type Query

type Query struct {
	// contains filtered or unexported fields
}

func NewQuery

func NewQuery() *Query

func (*Query) AnnotationExists

func (q *Query) AnnotationExists(annotation string) *Query

func (*Query) AnnotationIs

func (q *Query) AnnotationIs(annotation string, value string) *Query

func (*Query) AnnotationMatches

func (q *Query) AnnotationMatches(annotation string, pattern string) *Query

func (*Query) Architecture

func (q *Query) Architecture(architecture string) *Query

func (*Query) LabelExists

func (q *Query) LabelExists(label string) *Query

func (*Query) LabelIs

func (q *Query) LabelIs(label string, value string) *Query

func (*Query) LabelMatches

func (q *Query) LabelMatches(label string, pattern string) *Query

func (*Query) OS

func (q *Query) OS(os string) *Query

func (*Query) Repository

func (q *Query) Repository(repository string) *Query

func (*Query) Tag

func (q *Query) Tag(tag string) *Query

func (*Query) TagMatches

func (q *Query) TagMatches(tag string) *Query

type QueryTerm

type QueryTerm struct {
	// contains filtered or unexported fields
}

type QueryType

type QueryType int

type Tx

type Tx interface {
	Commit() error
	Rollback() error
	Modified() (bool, time.Time)

	DoQuery(query *Query) ([]*flagstate.Repository, error)

	StoreImage(repository string, image *flagstate.TaggedImage) error
	StoreImageList(repository string, list *flagstate.TaggedImageList) error

	SetImageTags(repository string, dgst digest.Digest, tags []string) error
	SetImageListTags(repository string, dgst digest.Digest, tags []string) error

	DeleteImage(repository string, dgst digest.Digest) error
	DeleteImageList(repository string, dgst digest.Digest) error

	DeleteMissingRepos(allRepos map[string]bool) error
	DeleteUnused() error
}

Jump to

Keyboard shortcuts

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