cli

package
v1.4.1-RC2 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultConfigFileName                  = "config.yaml"
	DefaultCacheFileName                   = "cache.db"
	DefaultReservedUsernamesConfigFileName = "reserved-usernames.json"
)

Variables

View Source
var (
	ConfigFileDir  = "/conf/"
	UploadFilePath = "/uploads/"
	I18nPath       = "/i18n/"
	CacheDir       = "/cache/"
)

Functions

func BuildNewAnswer

func BuildNewAnswer(buildDir, outputPath string, plugins []string, originalAnswerInfo OriginalAnswerInfo) (err error)

BuildNewAnswer builds a new answer with specified plugins

func CheckConfigFile

func CheckConfigFile(configPath string) bool

func CheckDBConnection

func CheckDBConnection(dataConf *data.Database) bool

CheckDBConnection check database whether the connection is normal

func CheckDBTableExist

func CheckDBTableExist(dataConf *data.Database) bool

CheckDBTableExist check database whether the table is already exists

func CheckUploadDir

func CheckUploadDir() bool

func DumpAllData

func DumpAllData(dataConf *data.Database, dumpDataPath string) error

DumpAllData dump all database data to sql

func FormatAllPath

func FormatAllPath(dataDirPath string)

func GetConfigFilePath

func GetConfigFilePath() string

GetConfigFilePath get config file path

func InstallAllInitialEnvironment

func InstallAllInitialEnvironment(dataDirPath string)

InstallAllInitialEnvironment install all initial environment

func InstallConfigFile

func InstallConfigFile(configFilePath string) error

func InstallI18nBundle

func InstallI18nBundle(replace bool)

func MergeI18nFilesLocal added in v1.3.6

func MergeI18nFilesLocal(originalI18nDir, targetI18nDir string) (err error)

MergeI18nFilesLocal merge i18n files

func ReplaceI18nFilesLocal added in v1.3.6

func ReplaceI18nFilesLocal(i18nDir string) error

ReplaceI18nFilesLocal replace i18n files

func SetDefaultConfig

func SetDefaultConfig(dbConf *data.Database, cacheConf *data.CacheConf, field *ConfigField) error

SetDefaultConfig set default config

Types

type ConfigField

type ConfigField struct {
	AllowPasswordLogin bool `json:"allow_password_login"`
	// The slug name of plugin that you want to deactivate
	DeactivatePluginSlugName string `json:"deactivate_plugin_slug_name"`
}

type OriginalAnswerInfo

type OriginalAnswerInfo struct {
	Version  string
	Revision string
	Time     string
}

type YamlPluginContent added in v1.3.6

type YamlPluginContent struct {
	Plugin map[string]any `yaml:"plugin"`
}

Jump to

Keyboard shortcuts

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