gcs

package
v0.9.7 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadPathOrContents

func ReadPathOrContents(input string) (string, error)

ReadPathOrContents reads the contents of a file if the input is a file path, or returns the input as is if it's not a file path.

Types

type Backend

type Backend struct {
	Bucket                 string   `yaml:"bucket"`
	Credentials            string   `yaml:"credentials,omitempty"`
	ImpersonateSA          string   `yaml:"impersonate_service_account,omitempty"`
	ImpersonateSADelegates []string `yaml:"impersonate_service_account_delegates,omitempty"`
	AccessToken            string   `yaml:"access_token,omitempty"`
	Prefix                 string   `yaml:"prefix"`

	StorageCustomEndpoint string `yaml:"storage_custom_endpoint,omitempty"`

	ProjectPtr *project.Project `yaml:"-"`
	// contains filtered or unexported fields
}

Backend - describe GCS backend for interface package.backend.

func (*Backend) Configure

func (b *Backend) Configure() error

func (*Backend) GetBackendBytes

func (b *Backend) GetBackendBytes(stackName, unitName string) ([]byte, error)

GetBackendBytes generate terraform backend config.

func (*Backend) GetBackendHCL

func (b *Backend) GetBackendHCL(stackName, unitName string) (*hclwrite.File, error)

GetBackendHCL generate terraform backend config.

func (*Backend) GetRemoteStateHCL

func (b *Backend) GetRemoteStateHCL(stackName, unitName string) ([]byte, error)

GetRemoteStateHCL generate terraform remote state for this backend.

func (*Backend) LockState

func (b *Backend) LockState() error

func (*Backend) Name

func (b *Backend) Name() string

Name return name.

func (*Backend) Provider

func (b *Backend) Provider() string

Provider return name.

func (*Backend) ReadState

func (b *Backend) ReadState() (string, error)

func (*Backend) State

func (b *Backend) State() map[string]interface{}

func (*Backend) UnlockState

func (b *Backend) UnlockState() error

func (*Backend) WriteState

func (b *Backend) WriteState(stateData string) error

type Factory

type Factory struct{}

Factory factory for backends.

func (*Factory) New

func (f *Factory) New(config []byte, name string, p *project.Project) (project.Backend, error)

New creates the new backend.

Jump to

Keyboard shortcuts

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