{"modulePath":"github.com/apache/answer","version":"v1.7.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package install\n\n## Constants\n\n```go\nconst UIStaticPath = \"build/static\"\n```\n\n## Functions\n\n```go\nfunc CheckConfigFile(ctx *gin.Context)\n```\nCheckConfigFile check config file if exist when installation @Summary check config file if exist when installation @Description check config file if exist when installation @Tags installation @Accept json @Produce json @Success 200 {object} handler.RespBody{data=install.CheckConfigFileResp{}} @Router /installation/config-file/check \\[post]\n\n```go\nfunc CheckConfigFileAndRedirectToInstallPage(ctx *gin.Context)\n```\nCheckConfigFileAndRedirectToInstallPage if config file not exist try to redirect to install page @Summary if config file not exist try to redirect to install page @Description if config file not exist try to redirect to install page @Tags installation @Accept json @Produce json @Router / \\[get]\n\n```go\nfunc CheckDatabase(ctx *gin.Context)\n```\nCheckDatabase check database if exist when installation @Summary check database if exist when installation @Description check database if exist when installation @Tags installation @Accept json @Produce json @Param data body install.CheckDatabaseReq  true \"CheckDatabaseReq\" @Success 200 {object} handler.RespBody{data=install.CheckConfigFileResp{}} @Router /installation/db/check \\[post]\n\n```go\nfunc GetLangMapping(ctx *gin.Context)\n```\nGetLangMapping get installation language config mapping @Summary get installation language config mapping @Description get installation language config mapping @Tags Lang @Param lang query string true \"installation language\" @Produce json @Success 200 {object} handler.RespBody{} @Router /installation/language/config \\[get]\n\n```go\nfunc InitBaseInfo(ctx *gin.Context)\n```\nInitBaseInfo init base info @Summary init base info @Description init base info @Tags installation @Accept json @Produce json @Param data body install.InitBaseInfoReq  true \"InitBaseInfoReq\" @Success 200 {object} handler.RespBody{} @Router /installation/base-info \\[post]\n\n```go\nfunc InitEnvironment(ctx *gin.Context)\n```\nInitEnvironment init environment @Summary init environment @Description init environment @Tags installation @Accept json @Produce json @Param data body install.CheckDatabaseReq  true \"CheckDatabaseReq\" @Success 200 {object} handler.RespBody{} @Router /installation/init \\[post]\n\n```go\nfunc LangOptions(ctx *gin.Context)\n```\nLangOptions get installation language options @Summary get installation language options @Description get installation language options @Tags Lang @Produce json @Success 200 {object} handler.RespBody{data=\\[]translator.LangOption} @Router /installation/language/options \\[get]\n\n```go\nfunc NewInstallHTTPServer() *gin.Engine\n```\nNewInstallHTTPServer new install http server.\n\n```go\nfunc Run(configPath string)\n```\n\n```go\nfunc TryToInstallByEnv() (installByEnv bool, err error)\n```\n\n```go\nfunc WebPage(c *gin.Context)\n```\n\n## Types\n\n```go\ntype CheckConfigFileResp struct {\n\tConfigFileExist     bool `json:\"config_file_exist\"`\n\tDBConnectionSuccess bool `json:\"db_connection_success\"`\n\tDbTableExist        bool `json:\"db_table_exist\"`\n}\n```\nCheckConfigFileResp check config file if exist or not response\n\n```go\ntype CheckDatabaseReq struct {\n\tDbType      string `validate:\"required,oneof=postgres sqlite3 mysql\" json:\"db_type\"`\n\tDbUsername  string `json:\"db_username\"`\n\tDbPassword  string `json:\"db_password\"`\n\tDbHost      string `json:\"db_host\"`\n\tDbName      string `json:\"db_name\"`\n\tDbFile      string `json:\"db_file\"`\n\tSsl         bool   `json:\"ssl_enabled\"`\n\tSslMode     string `json:\"ssl_mode\"`\n\tSslRootCert string `json:\"ssl_root_cert\"`\n\tSslKey      string `json:\"ssl_key\"`\n\tSslCert     string `json:\"ssl_cert\"`\n}\n```\nCheckDatabaseReq check database\n\n```go\nfunc (r *CheckDatabaseReq) GetConnection() string\n```\nGetConnection get connection string\n\n```go\ntype CheckDatabaseResp struct {\n\tConnectionSuccess bool `json:\"connection_success\"`\n}\n```\nCheckDatabaseResp check database response\n\n```go\ntype Env struct {\n\tAutoInstall string `json:\"auto_install\"`\n\tDbType      string `json:\"db_type\"`\n\tDbUsername  string `json:\"db_username\"`\n\tDbPassword  string `json:\"db_password\"`\n\tDbHost      string `json:\"db_host\"`\n\tDbName      string `json:\"db_name\"`\n\tDbFile      string `json:\"db_file\"`\n\tLanguage    string `json:\"lang\"`\n\n\tSiteName               string `json:\"site_name\"`\n\tSiteURL                string `json:\"site_url\"`\n\tContactEmail           string `json:\"contact_email\"`\n\tAdminName              string `json:\"name\"`\n\tAdminPassword          string `json:\"password\"`\n\tAdminEmail             string `json:\"email\"`\n\tLoginRequired          bool   `json:\"login_required\"`\n\tExternalContentDisplay string `json:\"external_content_display\"`\n}\n```\n\n```go\ntype InitBaseInfoReq struct {\n\tLanguage               string `validate:\"required,gt=0,lte=30\" json:\"lang\"`\n\tSiteName               string `validate:\"required,sanitizer,gt=0,lte=30\" json:\"site_name\"`\n\tSiteURL                string `validate:\"required,gt=0,lte=512,url\" json:\"site_url\"`\n\tContactEmail           string `validate:\"required,email,gt=0,lte=500\" json:\"contact_email\"`\n\tAdminName              string `validate:\"required,gte=2,lte=30\" json:\"name\"`\n\tAdminPassword          string `validate:\"required,gte=8,lte=32\" json:\"password\"`\n\tAdminEmail             string `validate:\"required,email,gt=0,lte=500\" json:\"email\"`\n\tLoginRequired          bool   `json:\"login_required\"`\n\tExternalContentDisplay string `validate:\"required,oneof=always_display ask_before_display\" json:\"external_content_display\"`\n}\n```\nInitBaseInfoReq init base info request\n\n```go\nfunc (r *InitBaseInfoReq) Check() (errFields []*validator.FormErrorField, err error)\n```\n\n```go\nfunc (r *InitBaseInfoReq) FormatSiteUrl()\n```\n\n```go\ntype InitEnvironmentResp struct {\n\tSuccess            bool   `json:\"success\"`\n\tCreateConfigFailed bool   `json:\"create_config_failed\"`\n\tDefaultConfig      string `json:\"default_config\"`\n\tErrType            string `json:\"err_type\"`\n}\n```\nInitEnvironmentResp init environment response\n\n","path":"github.com/apache/answer/internal/install","name":"install","synopsis":"","isRedistributable":true}
