config

package
v0.0.0-...-b5ec117 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SourceURL      = "github://ganboonhong/gotp/migration"
	StatusFilename = "status.yaml"
	// enable foreign key by default,  https://github.com/mattn/go-sqlite3#connection-string
	DBOptions = "?_fk=true"

	Key = "78b8d028113fd29e496d428347f89254"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	UserID          int
	AppName         string
	MigrationSource string
}

func New

func New() *Config

func NewTestConfig

func NewTestConfig(name string) *Config

NewTestConfig uses customized application name (which will be sub directory name) to isolate unit test

func (*Config) DSN

func (c *Config) DSN() string

DSN returns data source name for sqlite.

func (*Config) DatabasePath

func (c *Config) DatabasePath() string

DatabasePath returns absolute path of where sqlite file locates.

func (*Config) Dir

func (c *Config) Dir() string

Dir returns application configuration directory. Note that configuration directory is OS-specific. See https://pkg.go.dev/os#UserConfigDir for more information.

Jump to

Keyboard shortcuts

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