gcs

package
v0.12.0-a.2 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2026 License: MIT Imports: 18 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package gcs stores state snapshots in Google Cloud Storage.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(service *storage.Service, bucket string) client

NewClient returns a GCS client backed by the Google Storage REST API.

Types

type Store

type Store struct {
	Bucket     string
	Prefix     string
	KMSKeyName string
	// contains filtered or unexported fields
}

Store reads and writes snapshots under a per-stack key prefix.

func NewStore

func NewStore(
	client client,
	bucket, prefix, kmsKeyName, factory, stack string,
	enc sdkencrypt.Encrypter,
) (*Store, error)

NewStore returns a Store for factory and stack in bucket.

func (*Store) CurrentRev

func (s *Store) CurrentRev() (string, error)

func (*Store) Delete

func (s *Store) Delete(rev string) error

func (*Store) ForceUnlock

func (s *Store) ForceUnlock() error

func (*Store) GetV2

func (s *Store) GetV2(rev string) (*sdkstate.SnapshotV2, error)

GetV2 returns the strict version-2 snapshot with the given revision.

func (*Store) List

func (s *Store) List() ([]string, error)

func (*Store) Lock

func (s *Store) Lock(ctx context.Context) (sdkstate.Lock, error)

func (*Store) SetCurrent

func (s *Store) SetCurrent(rev string) error

func (*Store) Stack

func (s *Store) Stack() string

func (*Store) WriteV2

func (s *Store) WriteV2(snap *sdkstate.SnapshotV2) (string, error)

WriteV2 commits a strict version-2 snapshot and returns its revision.

Jump to

Keyboard shortcuts

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