couchdb

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MimeTypeForPath

func MimeTypeForPath(path string) string

Types

type BinaryStoreAdapter

type BinaryStoreAdapter struct {
	// contains filtered or unexported fields
}

BinaryStoreAdapter implements storage.BinaryStore on top of a LiveSyncClient's existing binary-file methods, letting a vault route non-markdown MCP file operations to CouchDB instead of S3 when its "use CouchDB for binaries" setting is on.

func NewBinaryStoreAdapter

func NewBinaryStoreAdapter(client *LiveSyncClient) *BinaryStoreAdapter

func (*BinaryStoreAdapter) Delete

func (a *BinaryStoreAdapter) Delete(ctx context.Context, path string) error

func (*BinaryStoreAdapter) Get

func (*BinaryStoreAdapter) List

func (*BinaryStoreAdapter) Move

func (a *BinaryStoreAdapter) Move(ctx context.Context, oldPath, newPath string) error

func (*BinaryStoreAdapter) Put

func (a *BinaryStoreAdapter) Put(ctx context.Context, path string, content []byte, mimeType string) error

func (*BinaryStoreAdapter) Stat

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(cfg Config) (*Client, error)

func (*Client) Config

func (c *Client) Config() Config

func (*Client) CreateDatabase

func (c *Client) CreateDatabase(ctx context.Context, name string) error

func (*Client) CreateUser

func (c *Client) CreateUser(ctx context.Context, username, password string, roles []string) error

func (*Client) DatabaseSize

func (c *Client) DatabaseSize(ctx context.Context, name string) (int64, error)

DatabaseSize returns name's on-disk footprint in bytes (DiskSize — CouchDB's sizes.file, which includes B-tree overhead rather than just live document bytes).

func (*Client) DatabaseURL

func (c *Client) DatabaseURL(name string) string

func (*Client) DeleteDatabase

func (c *Client) DeleteDatabase(ctx context.Context, name string) error

func (*Client) DeleteUser

func (c *Client) DeleteUser(ctx context.Context, username string) error

func (*Client) GetSetupStatus

func (c *Client) GetSetupStatus(ctx context.Context) (SetupStatus, error)

func (*Client) GetUser

func (c *Client) GetUser(ctx context.Context, username string) (UserInfo, error)

func (*Client) GetUserDatabaseAccess

func (c *Client) GetUserDatabaseAccess(ctx context.Context, username string) ([]string, error)

func (*Client) GrantDatabaseAccess

func (c *Client) GrantDatabaseAccess(ctx context.Context, dbName, username string) error

func (*Client) ListDatabases

func (c *Client) ListDatabases(ctx context.Context) ([]string, error)

func (*Client) ListUsers

func (c *Client) ListUsers(ctx context.Context) ([]UserListEntry, error)

func (*Client) RevokeDatabaseAccess

func (c *Client) RevokeDatabaseAccess(ctx context.Context, dbName, username string) error

func (*Client) SetDatabaseSecurity

func (c *Client) SetDatabaseSecurity(ctx context.Context, dbName string, memberUsernames ...string) error

func (*Client) Setup

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

func (*Client) UpdateUser

func (c *Client) UpdateUser(ctx context.Context, username, password string, roles []string) error

type Config

type Config struct {
	BaseURL  string
	User     string
	Password string
}

type FileDoc

type FileDoc struct {
	Id       string
	Rev      string
	RawBytes []byte
	MimeType string
	Mtime    int64
	Ctime    int64
	Size     int64
	Deleted  bool
}

type FileEntry

type FileEntry struct {
	Path     string
	Mtime    int64
	MimeType string
	Size     int64
}

type LiveSyncClient

type LiveSyncClient struct {
	// contains filtered or unexported fields
}

func NewLiveSyncClient

func NewLiveSyncClient(baseURL, dbName, username, password string) *LiveSyncClient

func (*LiveSyncClient) DeleteFile

func (c *LiveSyncClient) DeleteFile(ctx context.Context, path string) error

func (*LiveSyncClient) DeleteNote

func (c *LiveSyncClient) DeleteNote(ctx context.Context, path string) error

func (*LiveSyncClient) GetNoteMetadata

func (c *LiveSyncClient) GetNoteMetadata(ctx context.Context, path string) (NoteDoc, error)

func (*LiveSyncClient) ListFiles

func (c *LiveSyncClient) ListFiles(ctx context.Context) ([]FileEntry, error)

func (*LiveSyncClient) ListFolders

func (c *LiveSyncClient) ListFolders(ctx context.Context) ([]string, error)

func (*LiveSyncClient) ListNotes

func (c *LiveSyncClient) ListNotes(ctx context.Context) ([]NoteEntry, error)

func (*LiveSyncClient) ListTags

func (c *LiveSyncClient) ListTags(ctx context.Context) ([]string, error)

func (*LiveSyncClient) MoveFile

func (c *LiveSyncClient) MoveFile(ctx context.Context, oldPath, newPath string) error

func (*LiveSyncClient) MoveNote

func (c *LiveSyncClient) MoveNote(ctx context.Context, oldPath, newPath string) error

func (*LiveSyncClient) ReadFile

func (c *LiveSyncClient) ReadFile(ctx context.Context, path string) (FileDoc, error)

func (*LiveSyncClient) ReadNote

func (c *LiveSyncClient) ReadNote(ctx context.Context, path string) (NoteDoc, error)

func (*LiveSyncClient) StatFile

func (c *LiveSyncClient) StatFile(ctx context.Context, path string) (FileEntry, error)

func (*LiveSyncClient) WriteFile

func (c *LiveSyncClient) WriteFile(ctx context.Context, path string, content []byte) error

func (*LiveSyncClient) WriteNote

func (c *LiveSyncClient) WriteNote(ctx context.Context, path, content string) error

type NoteDoc

type NoteDoc struct {
	Id      string
	Rev     string
	Content string
	Mtime   int64
	Ctime   int64
	Size    int64
	Deleted bool
}

type NoteEntry

type NoteEntry struct {
	Path  string
	Mtime int64
}

type SetupStatus

type SetupStatus struct {
	ClusterModeEnabled      bool
	UsersDbInitialized      bool
	ReplicatorDbInitialized bool
}

SetupStatus reports which initial setup steps have been applied to a CouchDB instance.

type UserInfo

type UserInfo struct {
	Name  string
	Roles []string
}

type UserListEntry

type UserListEntry struct {
	Name  string
	Roles []string
}

Jump to

Keyboard shortcuts

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