Documentation
¶
Overview ¶
Package tfstate reads and writes the OpenTofu state meshStack keeps for a building block, and serves it to tofu's http backend.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoState = errors.New("no state")
ErrNoState is meshStack's 404, which tofu's http backend takes for a state not written yet.
View Source
var ErrReadOnly = errors.New("the state is read-only")
Functions ¶
This section is empty.
Types ¶
type Proxy ¶
type Proxy struct {
Store Store
Writable bool
BeforeWrite func(ctx context.Context) error
Backups Backups
// OnProblem gets the error of each request that failed, because tofu prints only the status code
// of the response.
OnProblem func(ctx context.Context, err error)
// contains filtered or unexported fields
}
Proxy stands between tofu and meshStack, rather than giving tofu the session's token as TF_HTTP_PASSWORD, which meshfed's TfStateRunTokenBasicAuthFilter accepts. That token can expire in the middle of an apply, and nothing would check tofu's writes against the stored state.
type Requester ¶
type Requester interface {
DoRequest(ctx context.Context, method, path string, opts ...http.RequestOption) ([]byte, error)
}
Requester is implemented by client.RawClient.
Click to show internal directories.
Click to hide internal directories.