Documentation ¶
Index ¶
- func New(ctx context.Context, gcsConfig *Config, options ...Option) (vustorage.Storage, error)
- type Config
- type Option
- type StaticKeyCredentials
- type Storage
- func (s *Storage) CollateVersions(ctx context.Context, serviceFilter map[string]bool) error
- func (s *Storage) CreateBucket(ctx context.Context) error
- func (s *Storage) DeleteObject(ctx context.Context, key string) error
- func (s *Storage) GetCollatedVersionSpec(ctx context.Context, version string) ([]byte, error)
- func (s *Storage) GetCollatedVersionSpecs(ctx context.Context) (map[string][]byte, error)
- func (s *Storage) GetObject(ctx context.Context, key string) ([]byte, error)
- func (s *Storage) GetObjectWithMetadata(ctx context.Context, key string) (*storage.Reader, *storage.ObjectAttrs, error)
- func (s *Storage) HasVersion(ctx context.Context, name string, version string, digest string) (bool, error)
- func (s *Storage) ListBucketContents(ctx context.Context) ([]string, error)
- func (s *Storage) ListCollatedVersions(ctx context.Context) ([]string, error)
- func (s *Storage) ListObjects(ctx context.Context, key string, delimeter string) ([]storage.ObjectAttrs, error)
- func (s *Storage) NotifyVersion(ctx context.Context, name string, version string, contents []byte, ...) error
- func (s *Storage) NotifyVersions(ctx context.Context, name string, versions []string, scrapeTime time.Time) error
- func (s *Storage) PutObject(ctx context.Context, key string, reader io.Reader) (putErr error)
- func (s *Storage) Version(ctx context.Context, version string) ([]byte, error)
- func (s *Storage) VersionIndex(ctx context.Context) (vervet.VersionIndex, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { GcsRegion string GcsEndpoint string BucketName string IamRoleEnabled bool Credentials StaticKeyCredentials WithoutAuthentication bool }
Config holds setting up and targeting proper GCS targets.
type StaticKeyCredentials ¶
StaticKeyCredentials structure google.Credentials for GCS storage.NewClient API.
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage implements storage.Storage.
func (*Storage) CollateVersions ¶
CollateVersions iterates over all possible permutations of Service versions to create a unified version spec for each unique vervet.Version.
func (*Storage) CreateBucket ¶
CreateBucket idempotently creates an GCS bucket for VU.
func (*Storage) DeleteObject ¶
DeleteObject deletes a file if it exists.
func (*Storage) GetCollatedVersionSpec ¶
GetCollatedVersionSpec retrieves a single collated vervet.Version and returns the JSON blob.
func (*Storage) GetCollatedVersionSpecs ¶
GetCollatedVersionSpecs retrieves a map of vervet.Version strings and their corresponding JSON blobs and returns the result.
func (*Storage) GetObjectWithMetadata ¶
func (s *Storage) GetObjectWithMetadata(ctx context.Context, key string) (*storage.Reader, *storage.ObjectAttrs, error, )
GetObjectWithMetadata actually retrieves the json blob form GCS with metadata around the storage in GCS.
func (*Storage) HasVersion ¶
func (s *Storage) HasVersion(ctx context.Context, name string, version string, digest string) (bool, error)
HasVersion implements scraper.Storage.
func (*Storage) ListBucketContents ¶
ListBucketContents lists all available files in a GCS bucket.
func (*Storage) ListCollatedVersions ¶
ListCollatedVersions nice wrapper around the GCS ListObjects request. example: key = "collated-versions/" result: []string{"2022-02-02~wip", "2022-12-02~beta"} Defaults to 1000 results.
func (*Storage) ListObjects ¶
func (s *Storage) ListObjects(ctx context.Context, key string, delimeter string) ([]storage.ObjectAttrs, error)
ListObjects nice wrapper around the GCS storage.BucketHandle Objects request. Defaults to 1000 results.
func (*Storage) NotifyVersion ¶
func (s *Storage) NotifyVersion(ctx context.Context, name string, version string, contents []byte, scrapeTime time.Time, ) error
NotifyVersion updates a Service's storage.ContentRevision if storage.Digest has changed.
func (*Storage) NotifyVersions ¶
func (s *Storage) NotifyVersions(ctx context.Context, name string, versions []string, scrapeTime time.Time) error
NotifyVersions implements scraper.Storage.