client

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package client provides a client for the OmniVault daemon.

Index

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 New

func New() *Client

New creates a new daemon client.

func NewWithPaths

func NewWithPaths(socketPath, tcpAddr string) *Client

NewWithPaths creates a new daemon client with custom paths (for testing).

func NewWithSocket

func NewWithSocket(socketPath string) *Client

NewWithSocket creates a new daemon client with a custom socket path (for testing). Deprecated: Use NewWithPaths for cross-platform support.

func (*Client) DeleteSecret

func (c *Client) DeleteSecret(ctx context.Context, path string) error

DeleteSecret removes a secret.

func (*Client) GetSecret

func (c *Client) GetSecret(ctx context.Context, path string) (*daemon.SecretResponse, error)

GetSecret retrieves a secret.

func (*Client) GetStatus

func (c *Client) GetStatus(ctx context.Context) (*daemon.StatusResponse, error)

GetStatus returns the daemon status.

func (*Client) Init

func (c *Client) Init(ctx context.Context, password string) error

Init initializes a new vault.

func (*Client) IsDaemonRunning

func (c *Client) IsDaemonRunning() bool

IsDaemonRunning checks if the daemon is running.

func (*Client) ListSecrets

func (c *Client) ListSecrets(ctx context.Context, prefix string) (*daemon.ListResponse, error)

ListSecrets returns all secrets.

func (*Client) Lock

func (c *Client) Lock(ctx context.Context) error

Lock locks the vault.

func (*Client) SetSecret

func (c *Client) SetSecret(ctx context.Context, path, value string, fields, tags map[string]string) error

SetSecret stores a secret.

func (*Client) Stop

func (c *Client) Stop(ctx context.Context) error

Stop stops the daemon.

func (*Client) Unlock

func (c *Client) Unlock(ctx context.Context, password string) error

Unlock unlocks the vault.

type DaemonError

type DaemonError struct {
	StatusCode int
	Code       string
	Message    string
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL