Documentation ¶
Index ¶
- Constants
- Variables
- func ApplySchemata(fileOrDirPath string, db DB) error
- func Dir(useLocal bool, name string) http.FileSystem
- func FS(useLocal bool) http.FileSystem
- func FSByte(useLocal bool, name string) ([]byte, error)
- func FSMustByte(useLocal bool, name string) []byte
- func FSMustString(useLocal bool, name string) string
- func FSString(useLocal bool, name string) (string, error)
- func LoadFixtures(fileOrDirPath string, db DB) error
- func LoadFixturesFromFile(filename string, db DB) error
- func LoadSchemataFromFile(filename string) ([]*dal.Collection, error)
- func MustGetCollection(db DB, name string) *dal.Collection
- type Collection
- type Configuration
- type DB
- type Filter
- type Model
- type Record
- type RecordSet
- type Server
Constants ¶
const ApplicationName = `pivot`
const ApplicationSummary = `an extensible database abstraction service`
const ApplicationVersion = `3.1.2`
Variables ¶
var DefaultAddress = `127.0.0.1`
var DefaultPort = 29029
var DefaultResultLimit = 25
var DefaultUiDirectory = `embedded`
var MonitorCheckInterval = time.Duration(10) * time.Second
var NetrcFile = ``
Functions ¶
func ApplySchemata ¶ added in v3.0.55
Calls LoadSchemataFromFile from all *.json files in the given directory.
func Dir ¶
func Dir(useLocal bool, name string) http.FileSystem
Dir returns a http.Filesystem for the embedded assets on a given prefix dir. If useLocal is true, the filesystem's contents are instead used.
func FS ¶
func FS(useLocal bool) http.FileSystem
FS returns a http.Filesystem for the embedded assets. If useLocal is true, the filesystem's contents are instead used.
func FSByte ¶
FSByte returns the named file from the embedded assets. If useLocal is true, the filesystem's contents are instead used.
func FSMustByte ¶
FSMustByte is the same as FSByte, but panics if name is not present.
func FSMustString ¶
FSMustString is the string version of FSMustByte.
func LoadFixtures ¶ added in v3.0.55
Calls LoadFixturesFromFile from all *.json files in the given directory.
func LoadFixturesFromFile ¶ added in v3.0.55
Loads a JSON-encoded array of dal.Record objects from a file into the given DB backend instance.
func LoadSchemataFromFile ¶
func LoadSchemataFromFile(filename string) ([]*dal.Collection, error)
Loads and registers a JSON-encoded array of dal.Collection objects into the given DB backend instance.
func MustGetCollection ¶ added in v3.1.0
func MustGetCollection(db DB, name string) *dal.Collection
A panicky version of backends.Backend.GetCollection
Types ¶
type Collection ¶ added in v3.0.24
type Collection = dal.Collection
type Configuration ¶
type Configuration struct { Backend string `json:"backend"` Indexer string `json:"indexer"` Autoexpand bool `json:"autoexpand"` AutocreateCollections bool `json:"autocreate"` Environments map[string]Configuration `json:"environments"` }
func LoadConfigFile ¶
func LoadConfigFile(path string) (Configuration, error)
func (*Configuration) ForEnv ¶
func (self *Configuration) ForEnv(env string) Configuration
type DB ¶ added in v3.0.24
create handy type aliases to avoid importing from all over the place
func NewDatabase ¶
Create a new database connection with the default options.
func NewDatabaseWithOptions ¶
func NewDatabaseWithOptions(connection string, options backends.ConnectOptions) (DB, error)
Create a new database connection with the given options.
type Server ¶
type Server struct { Address string ConnectionString string ConnectOptions backends.ConnectOptions UiDirectory string Autoexpand bool // contains filtered or unexported fields }