variables

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VariableTypeOpenTofu    = "opentofu"
	VariableTypeEnvironment = "environment"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ListVariableParams

type ListVariableParams struct {
	WorkspaceId   *uuid.UUID
	VariableSetId *uuid.UUID
}

type ListVariableSetParams

type ListVariableSetParams struct {
	OrganizationId *uuid.UUID
	WorkspaceId    *uuid.UUID
}

type OrganizationVariable

type OrganizationVariable struct {
	OrganizationID uuid.UUID `gorm:"primaryKey"`
	VariableID     uuid.UUID `gorm:"primaryKey"`
}

type OrganizationVariableSet

type OrganizationVariableSet struct {
	OrganizationID uuid.UUID `gorm:"primaryKey"`
	VariableSetID  uuid.UUID `gorm:"primaryKey"`

	CreatedAt time.Time  `json:"created_at"`
	UpdatedAt time.Time  `json:"updated_at"`
	DeletedAt *time.Time `sql:"index" json:"deleted_at"`
}

type Repository

type Repository interface {
	// Manage Variables
	List(params *ListVariableParams) ([]Variable, error)
	ListForWorkspace(workspaceId uuid.UUID) ([]Variable, error)
	Get(variableId uuid.UUID) (*Variable, error)
	Create(variable *Variable) (*Variable, error)
	Update(variable *Variable) (*Variable, error)
	Delete(variableId uuid.UUID) error

	AttachToWorkspace(variableId uuid.UUID, workspaceId uuid.UUID) error
	DetachFromWorkspace(variableId uuid.UUID, workspaceId uuid.UUID) error
}

func NewVariableRepository added in v1.8.0

func NewVariableRepository(db *gorm.DB) Repository

type RepositoryImpl

type RepositoryImpl struct {
	Db *gorm.DB
}

func (RepositoryImpl) AttachToWorkspace

func (v RepositoryImpl) AttachToWorkspace(variableId uuid.UUID, workspaceId uuid.UUID) error

func (RepositoryImpl) Create

func (v RepositoryImpl) Create(variable *Variable) (*Variable, error)

func (RepositoryImpl) Delete

func (v RepositoryImpl) Delete(variableId uuid.UUID) error

func (RepositoryImpl) DetachFromWorkspace

func (v RepositoryImpl) DetachFromWorkspace(variableId uuid.UUID, workspaceId uuid.UUID) error

func (RepositoryImpl) Get

func (v RepositoryImpl) Get(variableId uuid.UUID) (*Variable, error)

func (RepositoryImpl) List

func (v RepositoryImpl) List(params *ListVariableParams) ([]Variable, error)

func (RepositoryImpl) ListForWorkspace

func (v RepositoryImpl) ListForWorkspace(workspace uuid.UUID) ([]Variable, error)

func (RepositoryImpl) Update

func (v RepositoryImpl) Update(variable *Variable) (*Variable, error)

type SetRepository

type SetRepository interface {
	List(params *ListVariableSetParams) ([]VariableSet, error)
	Get(variableSetId uuid.UUID) (*VariableSet, error)
	Create(variableSet *VariableSet) (*VariableSet, error)
	Update(variableSet *VariableSet) error
	Delete(variableSetId uuid.UUID) error

	AttachToOrganization(variableSetId uuid.UUID, organizationId uuid.UUID) error
	DetachFromOrganization(variableSetId uuid.UUID, organizationId uuid.UUID) error
	AttachToWorkspace(variableSetId uuid.UUID, workspaceId uuid.UUID) error
	DetachFromWorkspace(variableSetId uuid.UUID, workspaceId uuid.UUID) error
}

func NewVariableSetsRepository added in v1.8.0

func NewVariableSetsRepository(db *gorm.DB) SetRepository

type SetRepositoryImpl

type SetRepositoryImpl struct {
	Db *gorm.DB
}

func (SetRepositoryImpl) AttachToOrganization

func (sri SetRepositoryImpl) AttachToOrganization(variableSetId uuid.UUID, organizationId uuid.UUID) error

func (SetRepositoryImpl) AttachToWorkspace

func (sri SetRepositoryImpl) AttachToWorkspace(variableSetId uuid.UUID, workspaceId uuid.UUID) error

func (SetRepositoryImpl) Create

func (sri SetRepositoryImpl) Create(variableSet *VariableSet) (*VariableSet, error)

func (SetRepositoryImpl) Delete

func (sri SetRepositoryImpl) Delete(variableSetId uuid.UUID) error

func (SetRepositoryImpl) DetachFromOrganization

func (sri SetRepositoryImpl) DetachFromOrganization(variableSetId uuid.UUID, organizationId uuid.UUID) error

func (SetRepositoryImpl) DetachFromWorkspace

func (sri SetRepositoryImpl) DetachFromWorkspace(variableSetId uuid.UUID, workspaceId uuid.UUID) error

func (SetRepositoryImpl) Get

func (sri SetRepositoryImpl) Get(variableSetId uuid.UUID) (*VariableSet, error)

func (SetRepositoryImpl) List

func (SetRepositoryImpl) Update

func (sri SetRepositoryImpl) Update(set *VariableSet) error

type Variable

type Variable struct {
	ID        uuid.UUID  `gorm:"type:uuid;default:gen_random_uuid()" json:"id"`
	CreatedAt time.Time  `json:"created_at"`
	UpdatedAt time.Time  `json:"updated_at"`
	DeletedAt *time.Time `sql:"index" json:"deleted_at"`

	Type           VariableType `json:"type"`
	Name           string       `json:"name"`
	Description    string       `json:"description"`
	Value          string       `json:"value"`
	Sensitive      bool         `json:"sensitive"`
	VariableSetID  uuid.UUID    `json:"variable_set_id,omitempty"`
	OrganizationID uuid.UUID    `json:"organization_id"`
}

type VariableSet

type VariableSet struct {
	ID        uuid.UUID  `gorm:"type:uuid;default:gen_random_uuid()" json:"id"`
	CreatedAt time.Time  `json:"created_at"`
	UpdatedAt time.Time  `json:"updated_at"`
	DeletedAt *time.Time `sql:"index" json:"deleted_at"`

	OrganizationID uuid.UUID   `json:"-"`
	Name           string      `json:"name"`
	Description    string      `json:"description"`
	AutoAttach     bool        `json:"auto_attach"`
	Priority       int32       `json:"priority"`
	Variables      []*Variable `json:"variables"`
}

type VariableType

type VariableType string

func ToVariableType

func ToVariableType(variableType string) VariableType

type WorkspaceVariable

type WorkspaceVariable struct {
	WorkspaceID uuid.UUID `gorm:"primaryKey"`
	VariableID  uuid.UUID `gorm:"primaryKey"`

	CreatedAt time.Time  `json:"created_at"`
	UpdatedAt time.Time  `json:"updated_at"`
	DeletedAt *time.Time `sql:"index" json:"deleted_at"`
}

type WorkspaceVariableSet

type WorkspaceVariableSet struct {
	WorkspaceID   uuid.UUID `gorm:"primaryKey"`
	VariableSetID uuid.UUID `gorm:"primaryKey"`

	CreatedAt time.Time  `json:"created_at"`
	UpdatedAt time.Time  `json:"updated_at"`
	DeletedAt *time.Time `sql:"index" json:"deleted_at"`
}

Jump to

Keyboard shortcuts

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