backend

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIllegalStoreRef = errors.New("illegal store ref")
)

Functions

func ConfigBackendToValue

func ConfigBackendToValue(v *ConfigBackend) cty.Value

func ConfigBitwardenToValue

func ConfigBitwardenToValue(v *ConfigBitwarden) cty.Value

func ConfigStateToValue

func ConfigStateToValue(v *ConfigState) cty.Value

func ConfigTerraformToValue

func ConfigTerraformToValue(v *ConfigTerraform) cty.Value

Types

type Backend

type Backend struct {
	TerraformArgs []string

	ExitCode int
	// contains filtered or unexported fields
}

func NewBackend

func NewBackend(p *plugin.Plugin) *Backend

func (*Backend) Bitwarden

func (this *Backend) Bitwarden() (*bitwarden.Bitwarden, error)

func (*Backend) Close

func (this *Backend) Close() (rErr error)

func (*Backend) GetCollectionId

func (this *Backend) GetCollectionId() string

func (*Backend) GetConfig

func (this *Backend) GetConfig() Config

func (*Backend) GetFolderId

func (this *Backend) GetFolderId() string

func (*Backend) GetOrganizationId

func (this *Backend) GetOrganizationId() string

func (*Backend) Initialize

func (this *Backend) Initialize() error

func (*Backend) Plugin

func (this *Backend) Plugin() *plugin.Plugin

func (*Backend) RegisterFlags

func (this *Backend) RegisterFlags(app *kingpin.Application)

type Config

type Config struct {
	Variables ConfigVariables  `hcl:"variable,block"`
	State     *ConfigState     `hcl:"state,block"`
	Bitwarden *ConfigBitwarden `hcl:"bitwarden,block"`
	Terraform *ConfigTerraform `hcl:"terraform,block"`
	Backend   *ConfigBackend   `hcl:"backend,block"`
}

func NewConfig

func NewConfig() *Config

func (Config) GetBackend

func (this Config) GetBackend() ConfigBackend

func (Config) GetBitwarden

func (this Config) GetBitwarden() ConfigBitwarden

func (Config) GetState

func (this Config) GetState() ConfigState

func (Config) GetTerraform

func (this Config) GetTerraform() ConfigTerraform

func (Config) Merge

func (this Config) Merge(with Config) Config

func (*Config) Read

func (this *Config) Read(ctx *hcl.EvalContext) error

func (*Config) ReadFile

func (this *Config) ReadFile(fn string, ctx *hcl.EvalContext) error

func (Config) ToValue

func (this Config) ToValue() cty.Value

func (Config) Validate

func (this Config) Validate() error

type ConfigBackend

type ConfigBackend struct {
	Port uint16 `hcl:"port,optional"`
}

func MergeConfigBackend

func MergeConfigBackend(a, b *ConfigBackend) *ConfigBackend

func NewConfigBackend

func NewConfigBackend() *ConfigBackend

func (ConfigBackend) GetPort

func (this ConfigBackend) GetPort() uint16

func (ConfigBackend) Merge

func (this ConfigBackend) Merge(what ConfigBackend) ConfigBackend

func (ConfigBackend) ToValue

func (this ConfigBackend) ToValue() cty.Value

func (ConfigBackend) Validate

func (this ConfigBackend) Validate() error

type ConfigBitwarden

type ConfigBitwarden struct {
	Executable       string `hcl:"executable,optional"`
	Session          string `hcl:"session,optional"`
	UnlockIfRequired *bool  `hcl:"unlock_if_required,optional"`
}

func MergeConfigBitwarden

func MergeConfigBitwarden(a, b *ConfigBitwarden) *ConfigBitwarden

func NewConfigBitwarden

func NewConfigBitwarden() *ConfigBitwarden

func (ConfigBitwarden) GetExecutable

func (this ConfigBitwarden) GetExecutable() string

func (ConfigBitwarden) GetSession

func (this ConfigBitwarden) GetSession() string

func (ConfigBitwarden) IsUnlockIfRequired

func (this ConfigBitwarden) IsUnlockIfRequired() bool

func (ConfigBitwarden) Merge

func (ConfigBitwarden) NewBitwarden

func (this ConfigBitwarden) NewBitwarden() (*bitwarden.Bitwarden, error)

func (ConfigBitwarden) ToValue

func (this ConfigBitwarden) ToValue() cty.Value

func (ConfigBitwarden) Validate

func (this ConfigBitwarden) Validate() error

type ConfigState

type ConfigState struct {
	MaxRevisions uint16 `hcl:"max_revisions,optional"`

	ItemId         string `hcl:"item_id,optional"`
	OrganizationId string `hcl:"organization_id,optional"`
	CollectionId   string `hcl:"collection_id,optional"`
	FolderId       string `hcl:"folder_id,optional"`
	ItemName       string `hcl:"item_name,optional"`
}

func MergeConfigState

func MergeConfigState(a, b *ConfigState) *ConfigState

func NewConfigState

func NewConfigState() *ConfigState

func (ConfigState) GetMaxRevisions

func (this ConfigState) GetMaxRevisions() uint16

func (ConfigState) Merge

func (this ConfigState) Merge(with ConfigState) ConfigState

func (ConfigState) ToValue

func (this ConfigState) ToValue() cty.Value

func (ConfigState) Validate

func (this ConfigState) Validate() error

type ConfigTerraform

type ConfigTerraform struct {
	Executable utils.Executable `hcl:"executable,optional"`
}

func MergeConfigTerraform

func MergeConfigTerraform(a, b *ConfigTerraform) *ConfigTerraform

func NewConfigTerraform

func NewConfigTerraform() *ConfigTerraform

func (ConfigTerraform) GetExecutable

func (this ConfigTerraform) GetExecutable() utils.Executable

func (ConfigTerraform) Merge

func (ConfigTerraform) ToValue

func (this ConfigTerraform) ToValue() cty.Value

func (ConfigTerraform) Validate

func (this ConfigTerraform) Validate() error

type ConfigVariable

type ConfigVariable struct {
	Label string `hcl:"label,label"`

	ItemId         string `hcl:"item_id,optional"`
	OrganizationId string `hcl:"organization_id,optional"`
	CollectionId   string `hcl:"collection_id,optional"`
	FolderId       string `hcl:"folder_id,optional"`
	Name           string `hcl:"name,optional"`
	Field          string `hcl:"field,optional"`

	Ref string `hcl:"ref,optional"`
}

func (ConfigVariable) Resolve

func (this ConfigVariable) Resolve(using *bitwarden.Bitwarden, refs ConfigVariables) (string, error)

func (ConfigVariable) ToValue

func (this ConfigVariable) ToValue() (string, cty.Value)

func (ConfigVariable) Validate

func (this ConfigVariable) Validate() error

type ConfigVariables

type ConfigVariables []ConfigVariable

func NewConfigVariables

func NewConfigVariables() ConfigVariables

func (ConfigVariables) Lookup

func (this ConfigVariables) Lookup(label string) (ConfigVariable, bool)

func (ConfigVariables) Merge

func (ConfigVariables) Resolve

func (this ConfigVariables) Resolve(using *bitwarden.Bitwarden) (map[string]string, error)

func (ConfigVariables) ToValue

func (this ConfigVariables) ToValue() cty.Value

func (ConfigVariables) Validate

func (this ConfigVariables) Validate() error

type Store

type Store struct {
	StoreParent
}

func (*Store) DeleteLock

func (this *Store) DeleteLock(plainRef string) error

func (*Store) DeleteState

func (this *Store) DeleteState(plainRef string) error

func (*Store) GetLock

func (this *Store) GetLock(plainRef string) (*types.Lock, error)

func (*Store) GetState

func (this *Store) GetState(plainRef string) (state map[string]interface{}, encrypted bool, err error)

func (*Store) Init

func (this *Store) Init() error

func (*Store) PutLock

func (this *Store) PutLock(plainRef string, lock types.Lock) error

func (*Store) PutState

func (this *Store) PutState(plainRef string, state, metadata map[string]interface{}, encrypted bool) error

type StoreParent

type StoreParent interface {
	Bitwarden() (*bitwarden.Bitwarden, error)
	GetOrganizationId() string
	GetCollectionId() string
	GetFolderId() string
	GetConfig() Config
}

type StoreRef

type StoreRef struct {
	ItemId   string
	ItemName string
}

func NewStoreRef

func NewStoreRef(plain string) (StoreRef, error)

func (*StoreRef) Set

func (this *StoreRef) Set(plain string) error

func (StoreRef) String

func (this StoreRef) String() string

Jump to

Keyboard shortcuts

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