core

package module
v0.0.0-...-965ab7d Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2020 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResultSuccessCode             = 200
	ResultFailCode                = 400
	ResultUnauthorizedCode        = 401
	ResultNotFoundCode            = 404
	ResultInternalServerErrorCode = 500
)

Variables

This section is empty.

Functions

func Backup

func Backup() error

func DumpDatabase

func DumpDatabase() error

func DumpMysqlDatabase

func DumpMysqlDatabase() error

func DumpPostgresDatabase

func DumpPostgresDatabase() error

func FailResult

func FailResult(message string) gin.H

func ParseConf

func ParseConf(config string) error

func Restore

func Restore(file string, useOldConfig bool) error

func RestoreDatabase

func RestoreDatabase() error

func RestoreMysqlDatabase

func RestoreMysqlDatabase() error

func RestorePostgresDatabase

func RestorePostgresDatabase() error

func Result

func Result(code int, message string) gin.H

func SaveConf

func SaveConf() error

func SuccessDataResult

func SuccessDataResult(name string, data interface{}) gin.H

func SuccessResult

func SuccessResult() gin.H

func Unzip

func Unzip(target, out string) error

func Zip

func Zip(source, target string) error

Types

type Config

type Config struct {
	Mode            string   `json:"mode"`
	Name            string   `json:"name"`
	Password        string   `json:"password"`
	UseCategory     bool     `json:"useCategory"`
	OtherCategoryId uint     `json:"otherCategoryId,omitempty"`
	DataDir         string   `json:"dataDir"`
	Db              Database `json:"database"`
	Smtp            Smtp     `json:"smtp"`
	Tls             Tls      `json:"tls"`
}
var Conf *Config

func GetConfigForZip

func GetConfigForZip(target string) (*Config, error)

type Database

type Database struct {
	Driver   string `json:"driver"`
	Address  string `json:"address" form:"address"`
	Port     string `json:"port" form:"port"`
	Dbname   string `json:"dbname" form:"dbname"`
	Username string `json:"username"`
	Password string `json:"password"`
}

type Smtp

type Smtp struct {
	Username string `json:"username"`
	Password string `json:"password"`
	Host     string `json:"host"`
}

type Tls

type Tls struct {
	Enable bool     `json:"enable"`
	Domain []string `json:"domain"`
}

Jump to

Keyboard shortcuts

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