goydb

package
v0.0.0-...-14d575d Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2021 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// DatabaseDir directory path where the databases and
	// attachments should be stored
	DatabaseDir string `env:"GOYDB_DB_DIR" envDefault:"./dbs"`
	// PublicDir the public directory that should be served by
	// the default server implementation
	PublicDir string `env:"GOYDB_PUBLIC" envDefault:"./public"`
	// EnablePublicDir allows to enable/disable the public directory serving
	EnablePublicDir bool `env:"GOYDB_ENABLE_PUBLIC" envDefault:"true"`
	// ListenAddress contains the default address to listen to.
	// Not respected if the server is generated by the user.
	ListenAddress string `env:"GOYDB_LISTEN" envDefault:":7070"`
	// CookieSecret a secret that is used to verify the
	// integrity, usually generated using openssl rand -hex 32
	CookieSecret string `env:"GOYDB_SECRET" envDefault:"21ccf11d067cec8eebd663af3dc8785521d1cc366f0d533e6740c1cb6840dceb"`
	// Aministrators list of username:password sperated by ","
	// for multiple users
	Aministrators string `env:"GOYDB_ADMINS" envDefault:"admin:secret"`
	// Containers are zip file based containers that should be mounted before the
	// database application
	Containers []public.Container
}

func NewConfig

func NewConfig() (*Config, error)

NewConfig will create a new configuration based on the given environment values. Errors while parsing the environment are returned.

func (*Config) BuildDatabase

func (c *Config) BuildDatabase() (*Goydb, error)

BuildDatabase builds the storage and http handler based on the given configuration.

func (*Config) ParseFlags

func (c *Config) ParseFlags()

ParseFlags to change the configuration

type Goydb

type Goydb struct {
	*storage.Storage
	Handler http.Handler
}

Jump to

Keyboard shortcuts

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