mock

package
v0.0.0-...-910df6c Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database struct {
	IsBlobRetValue     bool
	IsManifestRetValue bool
	PushedBlobs        *[]*database.Blob
	PushedManifests    *[]*database.Manifest
	PushedTags         *[]*database.Tag
	PulledBlobs        *[]*database.Blob
	PulledManifests    *[]*database.Manifest
	PulledTags         *[]*database.Tag
	DeletedBlobs       *[]string
	DeletedManifests   *[]string
}

Database is a mock implementation of database.Database

func CreateDatabase

func CreateDatabase() Database

CreateDatabase creates a mock Database implementation

func (Database) CreateSchemaIfNecessary

func (db Database) CreateSchemaIfNecessary()

CreateSchemaIfNecessary does what it says on the tin.

func (Database) DeleteBlob

func (db Database) DeleteBlob(digest string)

DeleteBlob deletes a blob from the database, moving the existing entry to the deleted_blobs table.

func (Database) DeleteManifest

func (db Database) DeleteManifest(digest string)

DeleteManifest deletes a manifest and associated tag from the database, moving the existing entries to the deleted_manifests and deleted_tags tables.

func (Database) GetConnection

func (db Database) GetConnection() *sqlx.DB

GetConnection always returns nil.

func (Database) IsBlob

func (db Database) IsBlob(digest string) bool

IsBlob determines whether the given digest belongs to a persisted blob.

func (Database) IsManifest

func (db Database) IsManifest(digest string) bool

IsManifest determines whether the given digest belongs to a persisted manifest.

func (Database) PullBlob

func (db Database) PullBlob(blob *database.Blob)

PullBlob writes a blob to the database, or updates the pulled time of an existing one.

func (Database) PullManifest

func (db Database) PullManifest(manifest *database.Manifest)

PullManifest writes a manifest to the database, or updates the pulled time of an existing one.

func (Database) PullTag

func (db Database) PullTag(tag *database.Tag)

PullTag writes a tag to the database, or updates the pulled time of an existing one.

func (Database) PushBlob

func (db Database) PushBlob(blob *database.Blob)

PushBlob writes a blob to the database, or updates the pushed time of an existing one.

func (Database) PushManifest

func (db Database) PushManifest(manifest *database.Manifest)

PushManifest writes a manifest to the database, or updates the pushed time of an existing one.

func (Database) PushTag

func (db Database) PushTag(tag *database.Tag)

PushTag writes a tag to the database, or updates the pushed time of an existing one.

Jump to

Keyboard shortcuts

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