Documentation
¶
Index ¶
- type DiffResult
- type EnvManager
- type SecretMetadata
- type Service
- func (s *Service) BatchSet(kv map[string]string) error
- func (s *Service) Delete(key string) error
- func (s *Service) Diff() (*DiffResult, error)
- func (s *Service) Get(key string) (string, error)
- func (s *Service) List(showValues bool) ([]SecretMetadata, error)
- func (s *Service) Pull(targetKeys []string) error
- func (s *Service) Push() error
- func (s *Service) Set(key, value string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DiffResult ¶
type DiffResult struct {
Added []string // Keys only in .env
Removed []string // Keys only in Cloud
Changed map[string][2]string // Key -> [LocalVal, CloudVal]
Unchanged []string
}
DiffResult holds the differences between local and cloud secrets.
type EnvManager ¶
EnvManager handles reading and writing .env files while preserving comments.
func NewEnvManager ¶
func NewEnvManager() *EnvManager
NewEnvManager creates a manager for the current directory.
func (*EnvManager) Delete ¶
func (m *EnvManager) Delete(key string) error
Delete removes a key from both files.
type SecretMetadata ¶
type SecretMetadata struct {
Key string `json:"key"`
Value string `json:"value,omitempty"` // Encrypted value
UpdatedAt string `json:"updated_at"`
}
SecretMetadata holds the secret metadata from the API.
type Service ¶
type Service struct {
API *api.Client
Env *EnvManager
}
Service coordinates all secret-related operations.
func NewService ¶
NewService creates a new secrets service.
func (*Service) Diff ¶
func (s *Service) Diff() (*DiffResult, error)
Diff compares local secrets (either .env or keychain) with cloud secrets.
func (*Service) List ¶
func (s *Service) List(showValues bool) ([]SecretMetadata, error)
List returns all secret keys for the project. If showValues is true, it decrypts them.
func (*Service) Pull ¶
Pull downloads secrets from the cloud and updates .env + Keychain. If targetKeys is nil, all secrets are pulled. If targetKeys is non-nil (even if empty), only those specific keys are pulled.