statping: Index | Files

package configs

import ""


Package Files

configs_form.go connection.go database.go file.go latest_sql.go load.go methods.go migration.go struct.go


const SqliteFilename = "statping.db"

func Connect Uses

func Connect(configs *DbConfig, retry bool) error

Connect will attempt to connect to the sqlite, postgres, or mysql database

func ConnectConfigs Uses

func ConnectConfigs(configs *DbConfig, retry bool) error

func CreateAdminUser Uses

func CreateAdminUser(c *DbConfig) error

func TriggerSamples Uses

func TriggerSamples() error

type DbConfig Uses

type DbConfig struct {
    DbConn      string `yaml:"connection" json:"connection"`
    DbHost      string `yaml:"host" json:"-"`
    DbUser      string `yaml:"user" json:"-"`
    DbPass      string `yaml:"password" json:"-"`
    DbData      string `yaml:"database" json:"-"`
    DbPort      int    `yaml:"port" json:"-"`
    ApiSecret   string `yaml:"api_secret" json:"-"`
    Project     string `yaml:"-" json:"-"`
    Description string `yaml:"-" json:"-"`
    Domain      string `yaml:"-" json:"-"`
    Username    string `yaml:"-" json:"-"`
    Password    string `yaml:"-" json:"-"`
    Email       string `yaml:"-" json:"-"`
    Error       error  `yaml:"-" json:"-"`
    Location    string `yaml:"location" json:"-"`
    SqlFile     string `yaml:"sqlfile,omitempty" json:"-"`
    LocalIP     string `yaml:"-" json:"-"`

    Db  database.Database `yaml:"-" json:"-"`
    // contains filtered or unexported fields

DbConfig struct is used for the Db connection and creates the 'config.yml' file

func LoadConfigFile Uses

func LoadConfigFile(configFile string) (*DbConfig, error)

func LoadConfigForm Uses

func LoadConfigForm(r *http.Request) (*DbConfig, error)

func LoadConfigs Uses

func LoadConfigs(cfgFile string) (*DbConfig, error)

func (*DbConfig) BackupAssets Uses

func (d *DbConfig) BackupAssets() error

BackupAssets is a temporary function (to version 0.90.*) to backup your customized theme to a new folder called 'assets_backup'.

func (*DbConfig) Close Uses

func (d *DbConfig) Close()

func (*DbConfig) ConnectionString Uses

func (d *DbConfig) ConnectionString() string

func (*DbConfig) CreateDatabase Uses

func (d *DbConfig) CreateDatabase() error

CreateDatabase will CREATE TABLES for each of the Statping elements

func (*DbConfig) DatabaseChanges Uses

func (d *DbConfig) DatabaseChanges() error

func (*DbConfig) Delete Uses

func (d *DbConfig) Delete() error

Save will initially create the config.yml file

func (*DbConfig) DropDatabase Uses

func (d *DbConfig) DropDatabase() error

DropDatabase will DROP each table Statping created

func (*DbConfig) MigrateDatabase Uses

func (d *DbConfig) MigrateDatabase() error

MigrateDatabase will migrate the database structure to current version. This function will NOT remove previous records, tables or columns from the database. If this function has an issue, it will ROLLBACK to the previous state.

func (*DbConfig) Save Uses

func (d *DbConfig) Save(directory string) error

Save will initially create the config.yml file

func (*DbConfig) Update Uses

func (d *DbConfig) Update() error

Migrate function

type Sampler Uses

type Sampler interface {
    Samples() []database.DbObject

type SamplerFunc Uses

type SamplerFunc func() error

Package configs imports 27 packages (graph). Updated 2020-05-29. Refresh now. Tools for package owners.