Documentation
¶
Index ¶
- Constants
- Variables
- type Config
- type Directory
- func (s *Directory) Access1() dsa.AccessServer
- func (s *Directory) Close()
- func (s *Directory) Config() Config
- func (s *Directory) DataSyncClient() (datasync.SyncClient, error)
- func (s *Directory) Exporter3() dse.ExporterServer
- func (s *Directory) Importer3() dsi.ImporterServer
- func (s *Directory) Logger() *zerolog.Logger
- func (s *Directory) Model3() dsm.ModelServer
- func (s *Directory) Reader3() dsr.ReaderServer
- func (s *Directory) Writer3() dsw.WriterServer
- type PostgresConfig
Constants ¶
const ( BackendBoltDB string = "boltdb" BackendPostgres string = "postgres" )
Backend names for Config.Backend. BackendBoltDB is the default when Backend is left empty.
Variables ¶
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 Directory ¶
type Directory struct {
// contains filtered or unexported fields
}
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) 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) 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"`
}