Documentation
¶
Overview ¶
Package client provides a client for the OmniVault daemon.
Index ¶
- type Client
- func (c *Client) ChangePassword(ctx context.Context, oldPassword, newPassword string) error
- func (c *Client) DeleteSecret(ctx context.Context, path string) error
- func (c *Client) Export(ctx context.Context, prefix string) (*daemon.ExportResponse, error)
- func (c *Client) GetSecret(ctx context.Context, path string) (*daemon.SecretResponse, error)
- func (c *Client) GetStatus(ctx context.Context) (*daemon.StatusResponse, error)
- func (c *Client) Import(ctx context.Context, secrets []daemon.ExportedSecret, merge bool) (*daemon.ImportResponse, error)
- func (c *Client) Init(ctx context.Context, password string) error
- func (c *Client) IsDaemonRunning() bool
- func (c *Client) ListSecrets(ctx context.Context, prefix string) (*daemon.ListResponse, error)
- func (c *Client) Lock(ctx context.Context) error
- func (c *Client) Search(ctx context.Context, pattern string, regex bool) (*daemon.SearchResponse, error)
- func (c *Client) SetSecret(ctx context.Context, path, value string, fields, tags map[string]string) error
- func (c *Client) Stop(ctx context.Context) error
- func (c *Client) Unlock(ctx context.Context, password string) error
- type DaemonError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client for the OmniVault daemon.
func NewWithPaths ¶
NewWithPaths creates a new daemon client with custom paths (for testing).
func NewWithSocket ¶
NewWithSocket creates a new daemon client with a custom socket path (for testing). Deprecated: Use NewWithPaths for cross-platform support.
func (*Client) ChangePassword ¶ added in v0.5.0
ChangePassword changes the master password.
func (*Client) DeleteSecret ¶
DeleteSecret removes a secret.
func (*Client) Import ¶ added in v0.5.0
func (c *Client) Import(ctx context.Context, secrets []daemon.ExportedSecret, merge bool) (*daemon.ImportResponse, error)
Import imports secrets into the vault.
func (*Client) IsDaemonRunning ¶
IsDaemonRunning checks if the daemon is running.
func (*Client) ListSecrets ¶
ListSecrets returns all secrets.
func (*Client) Search ¶ added in v0.5.0
func (c *Client) Search(ctx context.Context, pattern string, regex bool) (*daemon.SearchResponse, error)
Search searches for secrets matching a pattern.
type DaemonError ¶
DaemonError represents an error from the daemon.
func (*DaemonError) Error ¶
func (e *DaemonError) Error() string
func (*DaemonError) IsInvalidPassword ¶
func (e *DaemonError) IsInvalidPassword() bool
IsInvalidPassword returns true if the error indicates invalid password.
func (*DaemonError) IsNotFound ¶
func (e *DaemonError) IsNotFound() bool
IsNotFound returns true if the error indicates not found.
func (*DaemonError) IsVaultLocked ¶
func (e *DaemonError) IsVaultLocked() bool
IsVaultLocked returns true if the error indicates the vault is locked.