database

package
v0.1.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindAllEnv

func BindAllEnv(v *viper.Viper)

Types

type Config

type Config struct {
	GormDB     *gorm.DB
	Repository repository.Repository

	InstanceName string
	// contains filtered or unexported fields
}

func (*Config) GetEncryptionKey

func (c *Config) GetEncryptionKey() *[32]byte

func (*Config) SetEncryptionKey

func (c *Config) SetEncryptionKey(key *[32]byte)

type ConfigFile

type ConfigFile struct {
	Kind string `mapstructure:"kind" json:"kind,omitempty" default:"sqlite"`

	EncryptionKey string `mapstructure:"encryptionKey" json:"encryptionKey,omitempty"`

	AutoMigrate bool `mapstructure:"autoMigrate" json:"autoMigrate,omitempty" default:"true"`

	SQLite ConfigFileSQLite `mapstructure:"sqlite" json:"sqlite,omitempty"`

	Postgres ConfigFilePostgres `mapstructure:"postgres" json:"postgres,omitempty"`
}

type ConfigFilePostgres

type ConfigFilePostgres struct {
	PostgresHost     string `mapstructure:"host" json:"host,omitempty" default:"postgres"`
	PostgresPort     int    `mapstructure:"port" json:"port,omitempty" default:"5432"`
	PostgresUsername string `mapstructure:"username" json:"username,omitempty" default:"hatchet"`
	PostgresPassword string `mapstructure:"password" json:"password,omitempty" default:"hatchet"`
	PostgresDbName   string `mapstructure:"dbName" json:"dbName,omitempty" default:"hatchet"`
	PostgresForceSSL bool   `mapstructure:"forceSSL" json:"forceSSL,omitempty" default:"false"`
}

type ConfigFileSQLite

type ConfigFileSQLite struct {
	SQLLitePath string `mapstructure:"path" json:"path,omitempty" default:"/hatchet/hatchet.db"`
}

Jump to

Keyboard shortcuts

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