db

package
v0.1.57 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MainConfigLock = "main"
)
View Source
const TfState = "terraform.tfstate"

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigLock added in v0.1.16

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

func (*ConfigLock) IsActive added in v0.1.16

func (l *ConfigLock) IsActive() bool

type Database

type Database interface {
	TfStateReader
	LockDatabase
	GetUserId(ctx context.Context, apiKey string) (string, error)
	CreateUser(ctx context.Context, emailAddress string) (apiKey string, err error)
	StoreUserConfig(ctx context.Context, config *configpb.Config, configPrefix string, lock *ConfigLock) error
	LoadUserConfig(ctx context.Context, userId string, configPrefix string, lock *ConfigLock) (*configpb.Config, error)

	Close() error
}

func NewDatabase

func NewDatabase(awsClient aws_client.AwsClient) (Database, error)

type LocalLockDatabase added in v0.1.36

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

func (*LocalLockDatabase) LockConfig added in v0.1.36

func (d *LocalLockDatabase) LockConfig(ctx context.Context, userId string, lockId string) (lock *ConfigLock, err error)

func (*LocalLockDatabase) UnlockConfig added in v0.1.36

func (d *LocalLockDatabase) UnlockConfig(_ context.Context, lock *ConfigLock) error

type LockDatabase added in v0.1.36

type LockDatabase interface {
	LockConfig(ctx context.Context, userId string, lockId string) (lock *ConfigLock, err error)
	UnlockConfig(ctx context.Context, lock *ConfigLock) error
}

type LockType added in v0.1.16

type LockType string

type RemoteLockDatabase added in v0.1.36

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

func NewLockDatabase added in v0.1.36

func NewLockDatabase(dbConnection *sql.DB) (*RemoteLockDatabase, error)

func (*RemoteLockDatabase) LockConfig added in v0.1.36

func (d *RemoteLockDatabase) LockConfig(ctx context.Context, userId string, lockId string) (lock *ConfigLock, err error)

func (*RemoteLockDatabase) UnlockConfig added in v0.1.36

func (d *RemoteLockDatabase) UnlockConfig(ctx context.Context, lock *ConfigLock) error

type TfStateReader added in v0.1.55

type TfStateReader interface {
	LoadTerraformState(ctx context.Context, userId string) (string, error)
}

Jump to

Keyboard shortcuts

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