Documentation
¶
Index ¶
- type Store
- func (s *Store) Append(projectID string, content []byte, encryptionKey [32]byte) (*VersionInfo, error)
- func (s *Store) CheckWritable(projectID string) error
- func (s *Store) Latest(projectID string) (*VersionInfo, error)
- func (s *Store) List(projectID string) ([]VersionInfo, error)
- func (s *Store) MigrateNamespace(fromProjectID, toProjectID string) error
- func (s *Store) NextSequence(projectID string) (int, error)
- func (s *Store) Reencrypt(projectID string, oldKey, newKey [32]byte) error
- func (s *Store) Restore(projectID string, sequence int, encryptionKey [32]byte) ([]byte, error)
- func (s *Store) Save(projectID string, content []byte, sequence int, encryptionKey [32]byte) error
- type VersionInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store manages encrypted .env version history.
func (*Store) Append ¶
func (s *Store) Append(projectID string, content []byte, encryptionKey [32]byte) (*VersionInfo, error)
Append encrypts and saves a .env file as the next version in one atomic, locked operation.
func (*Store) CheckWritable ¶
CheckWritable verifies that the project namespace can be locked and created without mutating version history.
func (*Store) Latest ¶
func (s *Store) Latest(projectID string) (*VersionInfo, error)
Latest returns the most recent version, or nil if none exist.
func (*Store) List ¶
func (s *Store) List(projectID string) ([]VersionInfo, error)
List returns all stored versions for a project, newest first.
func (*Store) MigrateNamespace ¶
MigrateNamespace copies legacy encrypted backup files into the canonical project namespace without deleting the source namespace.
func (*Store) NextSequence ¶
NextSequence returns the next monotonically increasing version sequence number for a project.
func (*Store) Reencrypt ¶
Reencrypt rewrites all stored versions for a project with a new at-rest key.