disk

package
v8.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package disk provides an implementation of the storage used in Vervet Underground that uses a local filesystem. It's not intended for production use, but as a functionally complete reference implementation that can be used to validate the other parts of the VU system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(path string, options ...Option) storage.Storage

Types

type Option

type Option func(*Storage)

Option defines a Storage constructor option.

func NewCollator

func NewCollator(newCollator func() (*storage.Collator, error)) Option

NewCollator configures the Storage instance to use the given constructor function for creating collator instances.

type Storage

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

func (*Storage) Cleanup

func (s *Storage) Cleanup() error

func (*Storage) CollateVersions

func (s *Storage) CollateVersions(ctx context.Context, serviceFilter map[string]bool) error

CollateVersions aggregates versions and revisions from all the services, and produces unified versions and merged specs for all APIs.

func (*Storage) GetCollatedVersionSpec

func (s *Storage) GetCollatedVersionSpec(version string) ([]byte, error)

GetCollatedVersionSpec retrieves a single collated vervet.Version and returns the JSON blob.

func (*Storage) GetObject

func (s *Storage) GetObject(key string) ([]byte, error)

func (*Storage) GetObjectWithMetadata

func (s *Storage) GetObjectWithMetadata(key string) (*objectMeta, error)

func (*Storage) HasVersion

func (s *Storage) HasVersion(ctx context.Context, name string, version string, digest string) (bool, error)

HasVersion implements scraper.Storage.

func (*Storage) ListObjects

func (s *Storage) ListObjects(ctx context.Context, key string) ([]string, error)

ListObjects gets all objects under a given directory.

func (*Storage) NotifyVersion

func (s *Storage) NotifyVersion(ctx context.Context,
	name string,
	version string,
	contents []byte,
	scrapeTime time.Time,
) error

NotifyVersion implements scraper.Storage.

func (*Storage) NotifyVersions

func (s *Storage) NotifyVersions(ctx context.Context, name string, versions []string, scrapeTime time.Time) error

NotifyVersions implements scraper.Storage.

func (*Storage) PutObject

func (s *Storage) PutObject(key string, body []byte, timestamp *time.Time) error

func (*Storage) Version

func (s *Storage) Version(ctx context.Context, version string) ([]byte, error)

Version implements scraper.Storage.

func (*Storage) VersionIndex

func (s *Storage) VersionIndex(ctx context.Context) (vervet.VersionIndex, error)

VersionIndex implements scraper.Storage.

Jump to

Keyboard shortcuts

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