store

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Reference string
	Type      EventType
}

type EventType

type EventType string
const (
	EventTypeUpdated EventType = "updated"
)

type ListImageOptions

type ListImageOptions struct {
	// Tags defaults to nil (don't filter by tags).
	Tags []string
	// Order defaults to OrderAscending.
	Order Order
	// Page defaults to 0.
	Page int
	// Limit defaults to 30.
	Limit int
	// Sort defaults to SortBump.
	Sort Sort
	// Query is an Sqlite full text search query.
	Query string
}

type ListRawImagesOptions

type ListRawImagesOptions struct {
	NotUpdatedSince time.Time
	Limit           int
}

type Order

type Order string
const (
	OrderAcending   Order = "asc"
	OrderDescending Order = "desc"
)

type Sort

type Sort string
const (
	SortReference Sort = "reference"
	SortBump      Sort = "bump"
)

type Store

type Store struct {
	*events.Hub[Event]
	// contains filtered or unexported fields
}

func New

func New(uri string, readonly bool) (*Store, error)

func (*Store) Close

func (s *Store) Close() error

func (*Store) DeleteNonPresent

func (s *Store) DeleteNonPresent(ctx context.Context, references []string) (int64, error)

DeleteNonPresent deletes all images that are not referenced. Returns the number of affected rows.

func (*Store) GetImage

func (s *Store) GetImage(ctx context.Context, reference string) (*models.Image, error)

func (*Store) GetImageDescription

func (s *Store) GetImageDescription(ctx context.Context, reference string) (*models.ImageDescription, error)

func (*Store) GetImageGraph

func (s *Store) GetImageGraph(ctx context.Context, reference string) (*models.Graph, error)

func (*Store) GetImageReleaseNotes

func (s *Store) GetImageReleaseNotes(ctx context.Context, reference string) (*models.ImageReleaseNotes, error)

func (*Store) GetImageVulnerabilities

func (s *Store) GetImageVulnerabilities(ctx context.Context, reference string) ([]models.ImageVulnerability, error)
func (s *Store) GetImagesLinks(ctx context.Context, reference string) ([]models.ImageLink, error)

func (*Store) GetImagesTags

func (s *Store) GetImagesTags(ctx context.Context, reference string) ([]string, error)

func (*Store) GetRawImage

func (s *Store) GetRawImage(ctx context.Context, reference string) (*models.RawImage, error)

func (*Store) GetTags

func (s *Store) GetTags(ctx context.Context) ([]string, error)

func (*Store) InsertImage

func (s *Store) InsertImage(ctx context.Context, image *models.Image) error

func (*Store) InsertImageDescription

func (s *Store) InsertImageDescription(ctx context.Context, reference string, description *models.ImageDescription) error

func (*Store) InsertImageGraph

func (s *Store) InsertImageGraph(ctx context.Context, reference string, graph *models.Graph) error

func (*Store) InsertImageReleaseNotes

func (s *Store) InsertImageReleaseNotes(ctx context.Context, reference string, releaseNotes *models.ImageReleaseNotes) error

func (*Store) InsertRawImage

func (s *Store) InsertRawImage(ctx context.Context, image *models.RawImage) (bool, error)

func (*Store) ListImages

func (s *Store) ListImages(ctx context.Context, options *ListImageOptions) (*models.ImagePage, error)

func (*Store) ListRawImages

func (s *Store) ListRawImages(ctx context.Context, options *ListRawImagesOptions) ([]models.RawImage, error)

func (*Store) Summary added in v0.15.0

func (s *Store) Summary(ctx context.Context) (*models.ImagePageSummary, error)

Jump to

Keyboard shortcuts

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