store

package
v0.0.0-...-1a910b2 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrDoesNotExist is returned if the requested model could not be found in the store.
	ErrDoesNotExist = errors.New("Model does not exist")
)

Functions

This section is empty.

Types

type Feature

type Feature struct {
	Model
	CreatedAt time.Time
	Name      string
}

func (Feature) TableName

func (Feature) TableName() string

type Image

type Image struct {
	Model
	CreatedAt     time.Time
	Digest        string
	Name          string
	SchemaVersion int
	ScrapedAt     time.Time
}

func (Image) TableName

func (Image) TableName() string

type ImageGetOptions

type ImageGetOptions struct {
	Digest         string
	ID             int
	Name           string
	TagDistinction string
	TagIsLatest    *bool
	TagName        string
}

ImageGetOptions is used to query image with certain criterias.

type ImageListOptions

type ImageListOptions struct {
	Digest string
	Name   string
}

type ImageStore

type ImageStore interface {
	Create(i *Image) error
	FindByLayerIDHavingLayerCountGreaterThan(layerID, count int) ([]*Image, error)
	Get(o ImageGetOptions) (*Image, error)
	List(o ImageListOptions) ([]*Image, error)
	Update(i *Image) error
}

ImageStore allows creating, manipulating and reading images.

type Layer

type Layer struct {
	Model
	Digest         string
	SourceImageIDs []int `gorm:"-"`
}

func (Layer) TableName

func (Layer) TableName() string

type LayerGetOptions

type LayerGetOptions struct {
	Digest string
	ID     int
}

type LayerListOptions

type LayerListOptions struct {
	PlatformID int
}

type LayerPosition

type LayerPosition struct {
	Model
	LayerID    int
	PlatformID int
	Position   int
}

func (LayerPosition) TableName

func (LayerPosition) TableName() string

type LayerPositionListOptions

type LayerPositionListOptions struct {
	LayerID    int
	PlatformID int
}

type LayerPositionStore

type LayerPositionStore interface {
	Create(*LayerPosition) error
	List(o LayerPositionListOptions) ([]*LayerPosition, error)
}

type LayerStore

type LayerStore interface {
	Create(l *Layer) error
	Get(o LayerGetOptions) (*Layer, error)
	List(o LayerListOptions) ([]*Layer, error)
	Update(l *Layer) error
}

type Model

type Model struct {
	ID int
}

type OSFeature

type OSFeature struct {
	Model
	CreatedAt time.Time
	Name      string
}

func (OSFeature) TableName

func (OSFeature) TableName() string

type Platform

type Platform struct {
	Model
	Architecture   string
	Created        time.Time
	CreatedAt      time.Time
	Features       []*Feature `gorm:"many2many:imagespy_platform_features;"`
	ImageID        int
	ManifestDigest string
	OS             string
	OSFeatures     []*OSFeature `gorm:"many2many:imagespy_platform_os_features;"`
	OSVersion      string
	Variant        string
}

func (Platform) TableName

func (Platform) TableName() string

type PlatformGetOptions

type PlatformGetOptions struct {
	Architecture string
	ImageID      int
	OS           string
	OSVersion    *string
	Variant      *string
}

type PlatformListOptions

type PlatformListOptions struct {
	LayerDigest string
}

type PlatformStore

type PlatformStore interface {
	Create(*Platform) error
	Get(o PlatformGetOptions) (*Platform, error)
	List(o PlatformListOptions) ([]*Platform, error)
}

type Store

type Store interface {
	Close() error
	Images() ImageStore
	Layers() LayerStore
	LayerPositions() LayerPositionStore
	Platforms() PlatformStore
	Tags() TagStore
	Transaction() (StoreTransaction, error)
}

Store represents the high-level API to access models.

type StoreTransaction

type StoreTransaction interface {
	Store
	Commit() error
	Rollback() error
}

type Tag

type Tag struct {
	Model
	Distinction string
	ImageID     int
	IsLatest    bool
	IsTagged    bool
	Name        string
}

func (Tag) TableName

func (Tag) TableName() string

type TagGetOptions

type TagGetOptions struct {
	Distinction string
	ImageID     int
	ImageName   string
	IsLatest    *bool
	Name        string
}

type TagListOptions

type TagListOptions struct {
	ImageID  int
	IsLatest *bool
	IsTagged *bool
}

type TagStore

type TagStore interface {
	Create(*Tag) error
	Get(o TagGetOptions) (*Tag, error)
	List(o TagListOptions) ([]*Tag, error)
	Update(*Tag) error
}

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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