install

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const UIStaticPath = "build/static"

Variables

This section is empty.

Functions

func CheckConfigFile

func CheckConfigFile(ctx *gin.Context)

CheckConfigFile 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]

func CheckDatabase

func CheckDatabase(ctx *gin.Context)

CheckDatabase 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]

func InitBaseInfo

func InitBaseInfo(ctx *gin.Context)

InitBaseInfo 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]

func InitEnvironment

func InitEnvironment(ctx *gin.Context)

InitEnvironment 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]

func LangOptions

func LangOptions(ctx *gin.Context)

LangOptions 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]

func NewInstallHTTPServer

func NewInstallHTTPServer() *gin.Engine

NewInstallHTTPServer new install http server.

func Run

func Run(configPath string)

func WebPage

func WebPage(c *gin.Context)

Types

type CheckConfigFileResp

type CheckConfigFileResp struct {
	ConfigFileExist     bool `json:"config_file_exist"`
	DBConnectionSuccess bool `json:"db_connection_success"`
	DbTableExist        bool `json:"db_table_exist"`
}

CheckConfigFileResp check config file if exist or not response

type CheckDatabaseReq

type CheckDatabaseReq struct {
	DbType     string `validate:"required,oneof=postgres sqlite3 mysql" json:"db_type"`
	DbUsername string `json:"db_username"`
	DbPassword string `json:"db_password"`
	DbHost     string `json:"db_host"`
	DbName     string `json:"db_name"`
	DbFile     string `json:"db_file"`
}

CheckDatabaseReq check database

func (*CheckDatabaseReq) GetConnection

func (r *CheckDatabaseReq) GetConnection() string

GetConnection get connection string

type CheckDatabaseResp

type CheckDatabaseResp struct {
	ConnectionSuccess bool `json:"connection_success"`
}

CheckDatabaseResp check database response

type InitBaseInfoReq

type InitBaseInfoReq struct {
	Language      string `validate:"required,gt=0,lte=30" json:"lang"`
	SiteName      string `validate:"required,gt=0,lte=30" json:"site_name"`
	SiteURL       string `validate:"required,gt=0,lte=512,url" json:"site_url"`
	ContactEmail  string `validate:"required,email,gt=0,lte=500" json:"contact_email"`
	AdminName     string `validate:"required,gt=4,lte=30" json:"name"`
	AdminPassword string `validate:"required,gte=8,lte=32" json:"password"`
	AdminEmail    string `validate:"required,email,gt=0,lte=500" json:"email"`
}

InitBaseInfoReq init base info request

func (*InitBaseInfoReq) FormatSiteUrl

func (r *InitBaseInfoReq) FormatSiteUrl()

type InitEnvironmentResp

type InitEnvironmentResp struct {
	Success            bool   `json:"success"`
	CreateConfigFailed bool   `json:"create_config_failed"`
	DefaultConfig      string `json:"default_config"`
	ErrType            string `json:"err_type"`
}

InitEnvironmentResp init environment response

Jump to

Keyboard shortcuts

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