Documentation ¶
Index ¶
- type Database
- func (db *Database) DefaultVersion(path string) (version string, err error)
- func (db *Database) GetState(path, versionID string) (state types.State)
- func (db *Database) GetStateActivity(path string) (states []types.StateStat)
- func (db *Database) InsertState(path string, versionID string, sf *statefile.File) error
- func (db *Database) InsertVersion(version *state.Version) error
- func (db *Database) KnownVersions() (versions []string)
- func (db *Database) ListAttributeKeys(resourceType string) (results []string, err error)
- func (db *Database) ListResourceNames() ([]string, error)
- func (db *Database) ListResourceTypes() ([]string, error)
- func (db *Database) ListResourceTypesWithCount() (results []map[string]string, err error)
- func (db *Database) ListStateStats(query url.Values) (states []types.StateStat, page int, total int)
- func (db *Database) ListStates() (states []string)
- func (db *Database) ListStatesVersions() (statesVersions map[string][]string)
- func (db *Database) ListTerraformVersionsWithCount(query url.Values) (results []map[string]string, err error)
- func (db *Database) ListTfVersions() ([]string, error)
- func (db *Database) SearchAttribute(query url.Values) (results []types.SearchResult, page int, total int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
Database is a wrapping structure to *gorm.DB
func (*Database) DefaultVersion ¶
DefaultVersion returns the detault VersionID for a given State path Copied and adapted from github.com/hashicorp/terraform/command/jsonstate/state.go
func (*Database) GetStateActivity ¶
GetStateActivity returns a slice of StateStat from the Database for a given State path representing the State activity over time (Versions)
func (*Database) InsertState ¶
InsertState inserts a Terraform State in the Database
func (*Database) InsertVersion ¶
InsertVersion inserts an AWS S3 Version in the Database
func (*Database) KnownVersions ¶
KnownVersions returns a slice of all known Versions in the Database
func (*Database) ListAttributeKeys ¶
ListAttributeKeys lists all Resource Attribute keys for a given Resource type from the Database
func (*Database) ListResourceNames ¶
ListResourceNames lists all Resource names from the Database
func (*Database) ListResourceTypes ¶
ListResourceTypes lists all Resource types from the Database
func (*Database) ListResourceTypesWithCount ¶
ListResourceTypesWithCount returns a list of Resource types with associated counts from the Database
func (*Database) ListStateStats ¶
func (db *Database) ListStateStats(query url.Values) (states []types.StateStat, page int, total int)
ListStateStats returns a slice of StateStat, along with paging information
func (*Database) ListStates ¶
ListStates returns a slice of all State paths from the Database
func (*Database) ListStatesVersions ¶
ListStatesVersions returns a map of Version IDs to a slice of State paths from the Database
func (*Database) ListTerraformVersionsWithCount ¶
func (db *Database) ListTerraformVersionsWithCount(query url.Values) (results []map[string]string, err error)
ListTerraformVersionsWithCount returns a slice of maps of Terraform versions mapped to the count of most recent State paths using them. ListTerraformVersionsWithCount also takes a query with possible parameter 'orderBy' to sort results. Default sorting is by descending version number.
func (*Database) ListTfVersions ¶
ListTfVersions lists all Terraform versions from the Database
func (*Database) SearchAttribute ¶
func (db *Database) SearchAttribute(query url.Values) (results []types.SearchResult, page int, total int)
SearchAttribute returns a slice of SearchResult given a query The query might contain parameters 'type', 'name', 'key', 'value' and 'tf_version' SearchAttribute also returns paging information: the page number and the total results