adapter

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2022 License: ISC Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Revision = ""

Revision is set the the current git sha, or "dev"

View Source
var Tag = ""

Tag is set to the current git tag, or the current date

Functions

func Usage

func Usage()

Usage prints usage help to stdout

Types

type Adapter

type Adapter interface {
	Close()
}

Adapter is a bridge between Letarette and a SQL database, implementing a Letarette Document Manager for a Letarette space using two SQL queries.

func New

func New(cfg Config, errorHandler func(error)) (Adapter, error)

New creates an Adapter instance, connected to both NATS and the database, ready to start handling index requests.

type Config

type Config struct {
	Nats struct {
		URLS     []string `default:"nats://localhost:4222"`
		SeedFile string
		RootCAs  []string
		Topic    string `default:"leta"`
	}
	Index struct {
		Space string `default:"docs"`
	}
	Db struct {
		Driver     string `required:"true"`
		Connection string
	}
	SQL struct {
		IndexSQLFile    string `default:"indexrequest.sql"`
		DocumentSQLFile string `default:"documentrequest.sql"`
	}
}

Config holds the main configuration

func LoadConfig

func LoadConfig() (cfg Config, err error)

LoadConfig loads configuration variables from the environment and returns a fully populated Config instance.

Jump to

Keyboard shortcuts

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