sqlite

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2021 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewOrganizationFromModel

func NewOrganizationFromModel(model *OrganizationModel) *ots.Organization

func NewStateVersionFromModel

func NewStateVersionFromModel(model *StateVersionModel) *ots.StateVersion

func NewStateVersionOutputFromModel

func NewStateVersionOutputFromModel(model *StateVersionOutputModel) *ots.StateVersionOutput

func NewWorkspaceFromModel

func NewWorkspaceFromModel(model *WorkspaceModel) *ots.Workspace

Types

type OrganizationModel

type OrganizationModel struct {
	gorm.Model

	Name                   string
	Email                  string
	CollaboratorAuthPolicy string
	CostEstimationEnabled  bool
	SessionRemember        int
	SessionTimeout         int
}

func (OrganizationModel) TableName

func (OrganizationModel) TableName() string

type OrganizationService

type OrganizationService struct {
	*gorm.DB
}

func NewOrganizationService

func NewOrganizationService(db *gorm.DB) *OrganizationService

func (OrganizationService) CreateOrganization

func (s OrganizationService) CreateOrganization(opts *tfe.OrganizationCreateOptions) (*ots.Organization, error)

func (OrganizationService) DeleteOrganization

func (s OrganizationService) DeleteOrganization(name string) error

func (OrganizationService) GetEntitlements

func (s OrganizationService) GetEntitlements(name string) (*ots.Entitlements, error)

func (OrganizationService) GetOrganization

func (s OrganizationService) GetOrganization(name string) (*ots.Organization, error)

func (OrganizationService) ListOrganizations

func (OrganizationService) UpdateOrganization

func (s OrganizationService) UpdateOrganization(name string, opts *tfe.OrganizationUpdateOptions) (*ots.Organization, error)

type StateVersionModel

type StateVersionModel struct {
	gorm.Model

	Serial     int64
	ExternalID string
	State      string

	// State version belongs to a workspace
	WorkspaceID uint
	Workspace   WorkspaceModel

	// State version has many outputs
	StateVersionOutputs []StateVersionOutputModel `gorm:"foreignKey:StateVersionID"`
}

func (StateVersionModel) TableName

func (StateVersionModel) TableName() string

type StateVersionOutputModel

type StateVersionOutputModel struct {
	gorm.Model

	ExternalID string
	Name       string
	Sensitive  bool
	Type       string
	Value      string

	StateVersionID uint
}

func (StateVersionOutputModel) TableName

func (StateVersionOutputModel) TableName() string

type StateVersionOutputService

type StateVersionOutputService struct {
	*gorm.DB
}

func NewStateVersionOutputService

func NewStateVersionOutputService(db *gorm.DB) *StateVersionOutputService

func (StateVersionOutputService) GetStateVersionOutput

func (s StateVersionOutputService) GetStateVersionOutput(id string) (*ots.StateVersionOutput, error)

type StateVersionService

type StateVersionService struct {
	*gorm.DB
}

func NewStateVersionService

func NewStateVersionService(db *gorm.DB) *StateVersionService

func (StateVersionService) CreateStateVersion

func (s StateVersionService) CreateStateVersion(workspaceID string, opts *ots.StateVersionCreateOptions) (*ots.StateVersion, error)

func (StateVersionService) CurrentStateVersion

func (s StateVersionService) CurrentStateVersion(workspaceID string) (*ots.StateVersion, error)

func (StateVersionService) DownloadStateVersion

func (s StateVersionService) DownloadStateVersion(id string) ([]byte, error)

func (StateVersionService) GetStateVersion

func (s StateVersionService) GetStateVersion(id string) (*ots.StateVersion, error)

func (StateVersionService) ListStateVersions

func (s StateVersionService) ListStateVersions(orgName, workspaceName string, opts ots.StateVersionListOptions) (*ots.StateVersionList, error)

type WorkspaceModel

type WorkspaceModel struct {
	gorm.Model

	Name                string
	ExternalID          string
	AllowDestroyPlan    bool
	AutoApply           bool
	Description         string
	ExecutionMode       string
	FileTriggersEnabled bool
	GlobalRemoteState   bool
	Locked              bool
	TerraformVersion    string

	OrganizationID uint
	Organization   OrganizationModel
}

func (WorkspaceModel) TableName

func (WorkspaceModel) TableName() string

type WorkspaceService

type WorkspaceService struct {
	*gorm.DB
}

func NewWorkspaceService

func NewWorkspaceService(db *gorm.DB) *WorkspaceService

func (WorkspaceService) CreateWorkspace

func (s WorkspaceService) CreateWorkspace(orgName string, opts *ots.WorkspaceCreateOptions) (*ots.Workspace, error)

func (WorkspaceService) DeleteWorkspace

func (s WorkspaceService) DeleteWorkspace(name, orgName string) error

func (WorkspaceService) DeleteWorkspaceByID

func (s WorkspaceService) DeleteWorkspaceByID(id string) error

func (WorkspaceService) GetWorkspace

func (s WorkspaceService) GetWorkspace(name, orgName string) (*ots.Workspace, error)

func (WorkspaceService) GetWorkspaceByID

func (s WorkspaceService) GetWorkspaceByID(id string) (*ots.Workspace, error)

func (WorkspaceService) ListWorkspaces

func (s WorkspaceService) ListWorkspaces(orgName string, opts ots.WorkspaceListOptions) (*ots.WorkspaceList, error)

func (WorkspaceService) LockWorkspace

func (s WorkspaceService) LockWorkspace(id string, opts ots.WorkspaceLockOptions) (*ots.Workspace, error)

func (WorkspaceService) UnlockWorkspace

func (s WorkspaceService) UnlockWorkspace(id string) (*ots.Workspace, error)

func (WorkspaceService) UpdateWorkspace

func (s WorkspaceService) UpdateWorkspace(name, orgName string, opts *tfe.WorkspaceUpdateOptions) (*ots.Workspace, error)

func (WorkspaceService) UpdateWorkspaceByID

func (s WorkspaceService) UpdateWorkspaceByID(id string, opts *tfe.WorkspaceUpdateOptions) (*ots.Workspace, error)

Jump to

Keyboard shortcuts

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