Documentation ¶
Index ¶
- Variables
- type DB
- func (db *DB) Authenticate() error
- func (db *DB) CheckIfExists(user User) (bool, *driver.DocumentMeta)
- func (db *DB) Connect() error
- func (db *DB) Create(user User) *driver.DocumentMeta
- func (db *DB) Delete(user User) *driver.DocumentMeta
- func (db *DB) DeleteDB() error
- func (db *DB) Init()
- func (db *DB) InitializeCollection(collectionName string) error
- func (db *DB) InitializeDatabase(dbName string) error
- func (db *DB) ReadAll() []*User
- func (db *DB) ReadOne(name string) (*User, *driver.DocumentMeta, error)
- func (db *DB) Update(user User) *driver.DocumentMeta
- func (db *DB) UpdateMeta(meta driver.DocumentMeta)
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ARANGO_ROOT_PASSWORD = os.Getenv("ARANGO_ROOT_PASSWORD") DB_PROTOCOL = os.Getenv("DB_PROTOCOL") DB_HOST = os.Getenv("DB_HOST") DB_PORT = os.Getenv("DB_PORT") DB_NAME = os.Getenv("DB_NAME") DB_COLLECTION = os.Getenv("DB_COLLECTION") )
required env vars for establishing the conn
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
main struct for the database
func (*DB) Authenticate ¶
func (*DB) CheckIfExists ¶
func (db *DB) CheckIfExists(user User) (bool, *driver.DocumentMeta)
func (*DB) InitializeCollection ¶
creates a collection if non-existant, initializes the driver.Collection
func (*DB) InitializeDatabase ¶
creates a database if non-existant, initializes the driver.Database
func (*DB) UpdateMeta ¶
func (db *DB) UpdateMeta(meta driver.DocumentMeta)
update the meta on the database struct
Click to show internal directories.
Click to hide internal directories.