directory

package
v0.0.0-...-549d4bb Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BackendBoltDB   string = "boltdb"
	BackendPostgres string = "postgres"
)

Backend names for Config.Backend. BackendBoltDB is the default when Backend is left empty.

Variables

View Source
var (
	ErrUnknownBackend     = fmt.Errorf("directory: unknown backend, expected %q or %q", BackendBoltDB, BackendPostgres)
	ErrPostgresDSNUnset   = errors.New("directory: backend is postgres but postgres.dsn is not set")
	ErrDataSyncBoltDBOnly = errors.New("directory: datasync is only supported with the boltdb backend")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	DBPath         string         `json:"db_path"`
	RequestTimeout time.Duration  `json:"request_timeout"`
	Seed           bool           `json:"seed_metadata"`
	EnableV2       bool           `json:"enable_v2"`
	Backend        string         `json:"backend"`
	Postgres       PostgresConfig `json:"postgres"`
}

type Directory

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

func Get

func Get() (*Directory, error)

func New

func New(ctx context.Context, config *Config, logger *zerolog.Logger, adlLogger *adl.Logger) (*Directory, error)

func Open

func Open(ctx context.Context, config *Config, logger *zerolog.Logger, adlLogger *adl.Logger) (*Directory, error)

Open constructs a new, independent Directory instance, bypassing the process-wide singleton that New/Get share. eameraldd itself should keep using New/Get; Open is for tooling that needs more than one Directory alive in the same process (e.g. mrld-db migrate-to-postgres, which holds a BoltDB-backed source and a Postgres-backed destination open at once).

func (*Directory) Access1

func (s *Directory) Access1() dsa.AccessServer

func (*Directory) Close

func (s *Directory) Close()

func (*Directory) Config

func (s *Directory) Config() Config

func (*Directory) DataSyncClient

func (s *Directory) DataSyncClient() (datasync.SyncClient, error)

DataSyncClient returns the aserto-edge sync plugin's client. It errors when the directory is backed by Postgres: datasync's watermark file is tied to a BoltDB file path and its stats are raw bbolt bucket stats, neither of which has a Postgres equivalent yet.

func (*Directory) Exporter3

func (s *Directory) Exporter3() dse.ExporterServer

func (*Directory) Importer3

func (s *Directory) Importer3() dsi.ImporterServer

func (*Directory) Logger

func (s *Directory) Logger() *zerolog.Logger

func (*Directory) Model3

func (s *Directory) Model3() dsm.ModelServer

func (*Directory) Reader3

func (s *Directory) Reader3() dsr.ReaderServer

func (*Directory) Writer3

func (s *Directory) Writer3() dsw.WriterServer

type PostgresConfig

type PostgresConfig struct {
	DSN string `json:"dsn"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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