Documentation
¶
Index ¶
- func CreateExampleIacconsoleRcFile(iacconsoleRcPath string)
- func CreateExampleStructure(targetDir string, useIaCConsoleDB bool) string
- func ExecuteAgentCommand(conn *websocket.Conn, cmd AgentCommand, state *State)
- func GetMD5Hash(text string) string
- func ParseAPIURL(apiUrl string) (wsURL string, authHeader string, accountID string, err error)
- type AgentCommand
- type AgentComplete
- type AgentError
- type AgentMessage
- type AgentOutput
- type AgentPing
- type AgentPong
- type AgentRegister
- type DimensionInIaCConsoleDB
- type DimensionPair
- type IaCConsoleDBResponse
- type State
- func (s *State) GenerateVarsByDimAndData(optionType string, dimKey string, dimensionJsonMap map[string]interface{}) error
- func (s *State) GenerateVarsByDimOptional(optionType string) error
- func (s *State) GenerateVarsByDims() error
- func (s *State) GenerateVarsByEnvVars() error
- func (s *State) GetDimData(dimensionKey string, dimensionValue string, skipOnNotFound bool) (map[string]interface{}, error)
- func (s *State) GetObjectFromViperByOrgOrDefault(keyName string) map[string]any
- func (s *State) GetStringFromViperByOrgOrDefault(keyName string) string
- func (s *State) ParseDimensions()
- func (s *State) ParseUnitManifest(unitManifestFileName string)
- func (s *State) PrepareTemp() error
- func (s *State) SetupBackendConfig() map[string]interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateExampleIacconsoleRcFile ¶ added in v0.6.0
func CreateExampleIacconsoleRcFile(iacconsoleRcPath string)
GetiacconsoleConfigContent returns the content for the .iacconsolerc configuration file
func CreateExampleStructure ¶
CreateExampleStructure creates an example organization structure with sample configuration files
func ExecuteAgentCommand ¶ added in v0.7.0
func ExecuteAgentCommand(conn *websocket.Conn, cmd AgentCommand, state *State)
ExecuteAgentCommand runs a command and streams output to WebSocket
func GetMD5Hash ¶
Types ¶
type AgentCommand ¶ added in v0.7.0
type AgentCommand struct {
AgentMessage
ID string `json:"id"`
Action string `json:"action"` // init, plan, apply, destroy
Org string `json:"org"`
Unit string `json:"unit"`
Dimensions []DimensionPair `json:"dimensions"`
Workspace string `json:"workspace,omitempty"`
ExtraArgs []string `json:"extraArgs,omitempty"`
}
AgentCommand received by agent from server
type AgentComplete ¶ added in v0.7.0
type AgentComplete struct {
AgentMessage
CommandID string `json:"commandId"`
ExitCode int `json:"exitCode"`
Error string `json:"error,omitempty"`
}
AgentComplete sent by agent when command finishes
type AgentError ¶ added in v0.7.0
type AgentError struct {
AgentMessage
Error string `json:"error"`
}
AgentError sent by server to agent when there's an error
type AgentMessage ¶ added in v0.7.0
type AgentMessage struct {
Type string `json:"type"`
}
AgentMessage is the base structure for all WebSocket messages
type AgentOutput ¶ added in v0.7.0
type AgentOutput struct {
AgentMessage
CommandID string `json:"commandId"`
Stream string `json:"stream"` // stdout, stderr
Data string `json:"data"`
Timestamp int64 `json:"timestamp"`
}
AgentOutput sent by agent to server
type AgentPing ¶ added in v0.7.0
type AgentPing struct {
AgentMessage
}
AgentPing received from browser via server
type AgentPong ¶ added in v0.7.0
type AgentPong struct {
AgentMessage
Timestamp int64 `json:"timestamp"`
}
AgentPong sent back to browser via server
type AgentRegister ¶ added in v0.7.0
type AgentRegister struct {
AgentMessage
AgentID string `json:"agentId"`
Version string `json:"version"`
OS string `json:"os"`
Arch string `json:"arch"`
}
AgentRegister sent by agent upon connection
type DimensionInIaCConsoleDB ¶ added in v0.6.0
type DimensionPair ¶ added in v0.7.0
type IaCConsoleDBResponse ¶ added in v0.6.0
type IaCConsoleDBResponse struct {
Error string
Dimensions []DimensionInIaCConsoleDB
}
type State ¶ added in v0.6.0
type State struct {
UnitName string
OrgName string
DimensionsFlags []string
UnitPath string
InventoryPath string
UnitManifestPath string
ParsedDimensions map[string]string
CmdWorkTempDir string
UnitManifest unitManifestStruct
StateS3Path string
IacconsoleApiUrl string
Workspace string
}
func (*State) GenerateVarsByDimAndData ¶ added in v0.6.0
func (*State) GenerateVarsByDimOptional ¶ added in v0.6.0
func (*State) GenerateVarsByDims ¶ added in v0.6.0
func (*State) GenerateVarsByEnvVars ¶ added in v0.6.0
func (*State) GetDimData ¶ added in v0.6.0
func (*State) GetObjectFromViperByOrgOrDefault ¶ added in v0.6.0
func (*State) GetStringFromViperByOrgOrDefault ¶ added in v0.6.0
func (*State) ParseDimensions ¶ added in v0.6.0
func (s *State) ParseDimensions()
func (*State) ParseUnitManifest ¶ added in v0.6.0
func (*State) PrepareTemp ¶ added in v0.6.0
func (*State) SetupBackendConfig ¶ added in v0.6.0
Click to show internal directories.
Click to hide internal directories.