Documentation
¶
Overview ¶
Package state keeps the journal, lock and release history for one target and environment under .forge/state.
Index ¶
- Variables
- func CheckRollback(snap Snapshot, journal Journal, destination Release) error
- type Event
- type Journal
- type Release
- type ResourceState
- type Snapshot
- type Status
- type Store
- func (s *Store) Close() error
- func (s *Store) Context(ctx context.Context) context.Context
- func (s *Store) Dir() string
- func (s *Store) Journal() Journal
- func (s *Store) Lock(ctx context.Context) (func(), error)
- func (s *Store) MkdirAll(path string) error
- func (s *Store) ReadFile(path string) ([]byte, error)
- func (s *Store) RecordRelease(r Release) error
- func (s *Store) SaveSnapshot(snap Snapshot) error
- func (s *Store) SecretsPath() string
- func (s *Store) Snapshot() (Snapshot, error)
- func (s *Store) WriteFile(path string, data []byte) error
- func (s *Store) WritePlan(ctx context.Context, name string, raw []byte) error
- type WorkloadState
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrLocked = errors.New("another apply holds the lock")
Functions ¶
Types ¶
type Release ¶
type Release struct {
ID string `json:"id"`
PlanHash string `json:"plan_hash"`
Images []model.Image `json:"images"`
AppliedAt time.Time `json:"applied_at"`
Status Status `json:"status"`
// Migrations lists migration ids this release ran; reversible is per id.
Migrations map[string]bool `json:"migrations,omitempty"`
}
type ResourceState ¶
type Snapshot ¶
type Snapshot struct {
Revision uint64 `json:"revision,omitempty"`
Workloads map[string]WorkloadState `json:"workloads,omitempty"`
Identities map[string][]string `json:"identities,omitempty"`
FailedOperation string `json:"failed_operation,omitempty"`
ActivePlanHash string `json:"active_plan_hash,omitempty"`
Releases []Release `json:"releases"`
Resources map[string]ResourceState `json:"resources"`
Status Status `json:"status"`
}
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func OpenPrivate ¶
OpenPrivate keeps auxiliary credential and builder locks out of SQL authority.
func (*Store) RecordRelease ¶
func (*Store) SaveSnapshot ¶
func (*Store) SecretsPath ¶
Click to show internal directories.
Click to hide internal directories.