Documentation ¶
Overview ¶
Copyright © 2024 NAME HERE <EMAIL ADDRESS>
Index ¶
- Variables
- func AuthenticatedApiKeyClient(ctx context.Context, oi OvermindInstance) sdpconnect.ApiKeyServiceClient
- func AuthenticatedBookmarkClient(ctx context.Context, oi OvermindInstance) sdpconnect.BookmarksServiceClient
- func AuthenticatedChangesClient(ctx context.Context, oi OvermindInstance) sdpconnect.ChangesServiceClient
- func AuthenticatedInviteClient(ctx context.Context, oi OvermindInstance) sdpconnect.InviteServiceClient
- func AuthenticatedManagementClient(ctx context.Context, oi OvermindInstance) sdpconnect.ManagementServiceClient
- func AuthenticatedSnapshotsClient(ctx context.Context, oi OvermindInstance) sdpconnect.SnapshotsServiceClient
- func CreateBookmark(ctx context.Context, ready chan bool) int
- func EndChange(ctx context.Context, ready chan bool) int
- func Execute()
- func GetAffectedBookmarks(ctx context.Context, ready chan bool) int
- func GetBookmark(ctx context.Context, ready chan bool) int
- func GetChange(ctx context.Context, ready chan bool) int
- func GetSnapshot(ctx context.Context, ready chan bool) int
- func HasScopesFlexible(claims *sdp.CustomClaims, requiredScopes []string) (bool, string)
- func InterpolateScope(scope string, data map[string]any) (string, error)
- func InvitesCreate(ctx context.Context) int
- func InvitesList(ctx context.Context) int
- func InvitesRevoke(ctx context.Context) int
- func ListChanges(ctx context.Context, ready chan bool) int
- func ManualChange(ctx context.Context, ready chan bool) int
- func NewAuthenticatedClient(ctx context.Context, from *http.Client) *http.Client
- func Request(ctx context.Context, ready chan bool) int
- func StartChange(ctx context.Context, ready chan bool) int
- func SubmitPlan(ctx context.Context, files []string, ready chan bool) int
- func TerraformDig(srcMapPtr interface{}, path string) interface{}
- func UnauthenticatedApiKeyClient(ctx context.Context, oi OvermindInstance) sdpconnect.ApiKeyServiceClient
- type AttributeValues
- type AuthenticatedTransport
- type Change
- type Color
- type ConfigModule
- type ConfigResource
- type Importing
- type Module
- type Output
- type OvermindInstance
- type Plan
- type ProviderConfig
- type Resource
- type ResourceAttr
- type ResourceChange
- type State
- type StateValues
- type TextStyle
- type TfData
- type Variable
- type Variables
Constants ¶
This section is empty.
Variables ¶
var ( // Styles Underline = TextStyle{chalk.Underline} Bold = TextStyle{chalk.Bold} // Colors Black = Color{chalk.Black} Red = Color{chalk.Red} Green = Color{chalk.Green} Yellow = Color{chalk.Yellow} Blue = Color{chalk.Blue} Magenta = Color{chalk.Magenta} Cyan = Color{chalk.Cyan} White = Color{chalk.White} )
Functions ¶
func AuthenticatedApiKeyClient ¶
func AuthenticatedApiKeyClient(ctx context.Context, oi OvermindInstance) sdpconnect.ApiKeyServiceClient
AuthenticatedApiKeyClient Returns an apikey client that uses the auth embedded in the context and otel instrumentation
func AuthenticatedBookmarkClient ¶
func AuthenticatedBookmarkClient(ctx context.Context, oi OvermindInstance) sdpconnect.BookmarksServiceClient
AuthenticatedBookmarkClient Returns a bookmark client that uses the auth embedded in the context and otel instrumentation
func AuthenticatedChangesClient ¶
func AuthenticatedChangesClient(ctx context.Context, oi OvermindInstance) sdpconnect.ChangesServiceClient
AuthenticatedChangesClient Returns a bookmark client that uses the auth embedded in the context and otel instrumentation
func AuthenticatedInviteClient ¶
func AuthenticatedInviteClient(ctx context.Context, oi OvermindInstance) sdpconnect.InviteServiceClient
AuthenticatedInviteClient Returns a Invite client that uses the auth embedded in the context and otel instrumentation
func AuthenticatedManagementClient ¶
func AuthenticatedManagementClient(ctx context.Context, oi OvermindInstance) sdpconnect.ManagementServiceClient
AuthenticatedManagementClient Returns a bookmark client that uses the auth embedded in the context and otel instrumentation
func AuthenticatedSnapshotsClient ¶
func AuthenticatedSnapshotsClient(ctx context.Context, oi OvermindInstance) sdpconnect.SnapshotsServiceClient
AuthenticatedSnapshotsClient Returns a Snapshots client that uses the auth embedded in the context and otel instrumentation
func Execute ¶
func Execute()
Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func HasScopesFlexible ¶ added in v0.25.1
Returns whether a set of claims has all of the required scopes. It also accounts for when a user has write access but required read access, they aren't the same but the user will have access anyway so this will pass
Returns a bool and the missing permission as a string of any
func InterpolateScope ¶
InterpolateScope Will interpolate variables in the scope string. These variables can come from the following places:
* `outputs` - These are the outputs from the plan * `values` - These are the values from the resource in question
Interpolation is done using the Terraform interpolation syntax: https://www.terraform.io/docs/configuration/interpolation.html
func InvitesCreate ¶
func InvitesList ¶
func InvitesRevoke ¶
func NewAuthenticatedClient ¶
NewAuthenticatedClient creates a new AuthenticatedClient from the given context and http.Client.
func TerraformDig ¶
func TerraformDig(srcMapPtr interface{}, path string) interface{}
Digs through a map using the same logic that terraform does i.e. foo.bar[0]
func UnauthenticatedApiKeyClient ¶
func UnauthenticatedApiKeyClient(ctx context.Context, oi OvermindInstance) sdpconnect.ApiKeyServiceClient
UnauthenticatedApiKeyClient Returns an apikey client with otel instrumentation but no authentication. Can only be used for ExchangeKeyForToken
Types ¶
type AttributeValues ¶
type AttributeValues map[string]interface{}
AttributeValues is the JSON representation of the attribute values of the resource, whose structure depends on the resource type schema.
func (AttributeValues) Dig ¶
func (av AttributeValues) Dig(key string) (interface{}, bool)
Digs through the attribute values to find the value at the given key. This supports nested keys i.e. "foo.bar" and arrays i.e. "foo[0]"
type AuthenticatedTransport ¶
type AuthenticatedTransport struct {
// contains filtered or unexported fields
}
AuthenticatedClient is a http.Client that will automatically add the required Authorization header to the request, which is taken from the context that it is created with. We also always set the X-overmind-interactive header to false
type Change ¶
type Change struct { // Actions are the actions that will be taken on the object selected by the // properties below. Valid actions values are: // ["no-op"] // ["create"] // ["read"] // ["update"] // ["delete", "create"] // ["create", "delete"] // ["delete"] // The two "replace" actions are represented in this way to allow callers to // e.g. just scan the list for "delete" to recognize all three situations // where the object will be deleted, allowing for any new deletion // combinations that might be added in future. Actions []string `json:"actions,omitempty"` // Before and After are representations of the object value both before and // after the action. For ["create"] and ["delete"] actions, either "before" // or "after" is unset (respectively). For ["no-op"], the before and after // values are identical. The "after" value will be incomplete if there are // values within it that won't be known until after apply. Before json.RawMessage `json:"before,omitempty"` After json.RawMessage `json:"after,omitempty"` // AfterUnknown is an object value with similar structure to After, but // with all unknown leaf values replaced with true, and all known leaf // values omitted. This can be combined with After to reconstruct a full // value after the action, including values which will only be known after // apply. AfterUnknown json.RawMessage `json:"after_unknown,omitempty"` // BeforeSensitive and AfterSensitive are object values with similar // structure to Before and After, but with all sensitive leaf values // replaced with true, and all non-sensitive leaf values omitted. These // objects should be combined with Before and After to prevent accidental // display of sensitive values in user interfaces. BeforeSensitive json.RawMessage `json:"before_sensitive,omitempty"` AfterSensitive json.RawMessage `json:"after_sensitive,omitempty"` // ReplacePaths is an array of arrays representing a set of paths into the // object value which resulted in the action being "replace". This will be // omitted if the action is not replace, or if no paths caused the // replacement (for example, if the resource was tainted). Each path // consists of one or more steps, each of which will be a number or a // string. ReplacePaths json.RawMessage `json:"replace_paths,omitempty"` // Importing contains the import metadata about this operation. If importing // is present (ie. not null) then the change is an import operation in // addition to anything mentioned in the actions field. The actual contents // of the Importing struct is subject to change, so downstream consumers // should treat any values in here as strictly optional. Importing *Importing `json:"importing,omitempty"` // GeneratedConfig contains any HCL config generated for this resource // during planning as a string. // // If this is populated, then Importing should also be populated but this // might change in the future. However, nNot all Importing changes will // contain generated config. GeneratedConfig string `json:"generated_config,omitempty"` }
Change is the representation of a proposed change for an object.
type Color ¶
type Color struct {
// contains filtered or unexported fields
}
A type that wraps chalk.Color but adds detections for if we're in a TTY
type ConfigModule ¶
type ConfigModule struct { Outputs map[string]output `json:"outputs,omitempty"` // Resources are sorted in a user-friendly order that is undefined at this // time, but consistent. Resources []ConfigResource `json:"resources,omitempty"` ModuleCalls map[string]moduleCall `json:"module_calls,omitempty"` Variables variables `json:"variables,omitempty"` }
func (ConfigModule) DigResource ¶
func (m ConfigModule) DigResource(address string) *ConfigResource
Digs for a config resource in this module or its children
type ConfigResource ¶
type ConfigResource struct { // Address is the absolute resource address Address string `json:"address,omitempty"` // Mode can be "managed" or "data" Mode string `json:"mode,omitempty"` Type string `json:"type,omitempty"` Name string `json:"name,omitempty"` // ProviderConfigKey is the key into "provider_configs" (shown above) for // the provider configuration that this resource is associated with. // // NOTE: If a given resource is in a ModuleCall, and the provider was // configured outside of the module (in a higher level configuration file), // the ProviderConfigKey will not match a key in the ProviderConfigs map. ProviderConfigKey string `json:"provider_config_key,omitempty"` // Provisioners is an optional field which describes any provisioners. // Connection info will not be included here. Provisioners []provisioner `json:"provisioners,omitempty"` // Expressions" describes the resource-type-specific content of the // configuration block. Expressions map[string]interface{} `json:"expressions,omitempty"` // SchemaVersion indicates which version of the resource type schema the // "values" property conforms to. SchemaVersion uint64 `json:"schema_version"` // CountExpression and ForEachExpression describe the expressions given for // the corresponding meta-arguments in the resource configuration block. // These are omitted if the corresponding argument isn't set. CountExpression *expression `json:"count_expression,omitempty"` ForEachExpression *expression `json:"for_each_expression,omitempty"` DependsOn []string `json:"depends_on,omitempty"` }
Resource is the representation of a resource in the config
type Importing ¶
type Importing struct { // The original ID of this resource used to target it as part of planned // import operation. ID string `json:"id,omitempty"` }
Importing is a nested object for the resource import metadata.
type Module ¶
type Module struct { // Resources are sorted in a user-friendly order that is undefined at this // time, but consistent. Resources []Resource `json:"resources,omitempty"` // Address is the absolute module address, omitted for the root module Address string `json:"address,omitempty"` // Each module object can optionally have its own nested "child_modules", // recursively describing the full module tree. ChildModules []Module `json:"child_modules,omitempty"` }
Module is the representation of a module in state. This can be the root module or a child module.
func (Module) DigResource ¶
Get a specific resource from this module or its children
type Output ¶
type Output struct { Sensitive bool `json:"sensitive"` Type json.RawMessage `json:"type,omitempty"` Value json.RawMessage `json:"value,omitempty"` }
type OvermindInstance ¶ added in v0.25.3
func NewOvermindInstance ¶ added in v0.25.3
func NewOvermindInstance(ctx context.Context, app string) (OvermindInstance, error)
NewOvermindInstance creates a new OvermindInstance from the given app URL with all URLs filled in, or an error. This makes a request to the frontend to lookup Api and Nats URLs.
func (OvermindInstance) GatewayUrl ¶ added in v0.25.3
func (oi OvermindInstance) GatewayUrl() string
GatewayUrl returns the URL for the gateway for this instance.
type Plan ¶
type Plan struct { FormatVersion string `json:"format_version,omitempty"` TerraformVersion string `json:"terraform_version,omitempty"` Variables Variables `json:"variables,omitempty"` PlannedValues StateValues `json:"planned_values,omitempty"` // ResourceDrift and ResourceChanges are sorted in a user-friendly order // that is undefined at this time, but consistent. ResourceDrift []ResourceChange `json:"resource_drift,omitempty"` ResourceChanges []ResourceChange `json:"resource_changes,omitempty"` OutputChanges map[string]Change `json:"output_changes,omitempty"` PriorState State `json:"prior_state,omitempty"` Config config `json:"configuration,omitempty"` RelevantAttributes []ResourceAttr `json:"relevant_attributes,omitempty"` Checks json.RawMessage `json:"checks,omitempty"` Timestamp string `json:"timestamp,omitempty"` Errored bool `json:"errored"` }
Plan is the top-level representation of the json format of a plan. It includes the complete config and current state.
type ProviderConfig ¶
type ProviderConfig struct { Name string `json:"name,omitempty"` FullName string `json:"full_name,omitempty"` Alias string `json:"alias,omitempty"` VersionConstraint string `json:"version_constraint,omitempty"` ModuleAddress string `json:"module_address,omitempty"` Expressions map[string]interface{} `json:"expressions,omitempty"` }
ProviderConfig describes all of the provider configurations throughout the configuration tree, flattened into a single map for convenience since provider configurations are the one concept in Terraform that can span across module boundaries.
type Resource ¶
type Resource struct { // Address is the absolute resource address Address string `json:"address,omitempty"` // Mode can be "managed" or "data" Mode string `json:"mode,omitempty"` Type string `json:"type,omitempty"` Name string `json:"name,omitempty"` // ProviderName allows the property "type" to be interpreted unambiguously // in the unusual situation where a provider offers a resource type whose // name does not start with its own name, such as the "googlebeta" provider // offering "google_compute_instance". ProviderName string `json:"provider_name,omitempty"` // SchemaVersion indicates which version of the resource type schema the // "values" property conforms to. SchemaVersion uint64 `json:"schema_version"` // AttributeValues is the JSON representation of the attribute values of the // resource, whose structure depends on the resource type schema. Any // unknown values are omitted or set to null, making them indistinguishable // from absent values. AttributeValues AttributeValues `json:"values,omitempty"` // SensitiveValues is similar to AttributeValues, but with all sensitive // values replaced with true, and all non-sensitive leaf values omitted. SensitiveValues json.RawMessage `json:"sensitive_values,omitempty"` }
Resource is the representation of a resource in the json plan
type ResourceAttr ¶
type ResourceAttr struct { Resource string `json:"resource"` Attr json.RawMessage `json:"attribute"` }
ResourceAttr contains the address and attribute of an external for the RelevantAttributes in the plan.
type ResourceChange ¶
type ResourceChange struct { // Address is the absolute resource address Address string `json:"address,omitempty"` // PreviousAddress is the absolute address that this resource instance had // at the conclusion of a previous run. // // This will typically be omitted, but will be present if the previous // resource instance was subject to a "moved" block that we handled in the // process of creating this plan. // // Note that this behavior diverges from the internal plan data structure, // where the previous address is set equal to the current address in the // common case, rather than being omitted. PreviousAddress string `json:"previous_address,omitempty"` // ModuleAddress is the module portion of the above address. Omitted if the // instance is in the root module. ModuleAddress string `json:"module_address,omitempty"` // "managed" or "data" Mode string `json:"mode,omitempty"` Type string `json:"type,omitempty"` Name string `json:"name,omitempty"` Index json.RawMessage `json:"index,omitempty"` ProviderName string `json:"provider_name,omitempty"` // "deposed", if set, indicates that this action applies to a "deposed" // object of the given instance rather than to its "current" object. Omitted // for changes to the current object. Deposed string `json:"deposed,omitempty"` // Change describes the change that will be made to this object Change Change `json:"change,omitempty"` // ActionReason is a keyword representing some optional extra context // for why the actions in Change.Actions were chosen. // // This extra detail is only for display purposes, to help a UI layer // present some additional explanation to a human user. The possible // values here might grow and change over time, so any consumer of this // information should be resilient to encountering unrecognized values // and treat them as an unspecified reason. ActionReason string `json:"action_reason,omitempty"` }
ResourceChange is a description of an individual change action that Terraform plans to use to move from the prior state to a new state matching the configuration.
type State ¶
type State struct { FormatVersion string `json:"format_version,omitempty"` TerraformVersion string `json:"terraform_version,omitempty"` Values *StateValues `json:"values,omitempty"` Checks json.RawMessage `json:"checks,omitempty"` }
State is the top-level representation of the json format of a terraform state.
type StateValues ¶
type StateValues struct { Outputs map[string]Output `json:"outputs,omitempty"` RootModule Module `json:"root_module,omitempty"` }
StateValues is the common representation of resolved values for both the prior state (which is always complete) and the planned new state.
type TextStyle ¶
type TextStyle struct {
// contains filtered or unexported fields
}
A type that wraps chalk.TextStyle but adds detections for if we're in a TTY
type Variable ¶
type Variable struct {
Value json.RawMessage `json:"value,omitempty"`
}
Source Files ¶
- auth_client.go
- bookmarks.go
- bookmarks_create_bookmark.go
- bookmarks_get_affected_bookmarks.go
- bookmarks_get_bookmark.go
- changes.go
- changes_end_change.go
- changes_get_change.go
- changes_list_changes.go
- changes_manual_change.go
- changes_start_change.go
- changes_submit_plan.go
- invites.go
- invites_crud.go
- logging.go
- plan.go
- request.go
- root.go
- snapshots.go
- snapshots_get_snapshot.go
- terraform.go