initdb

package
v0.0.0-...-6e4d488 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrViperEmpty = errors.New("配置服务未初始化")
)

Functions

func Check

func Check(ctx iris.Context)

Check 检测是否需要初始化项目

func GetAll

func GetAll(ctx iris.Context)

func Init

func Init(ctx iris.Context)

InitDB 初始化项目接口

func InitDB

func InitDB(req *Request) error

InitDB 创建数据库并初始化

func Party

func Party() module.WebModule

Party 初始化模块

Types

type Cache

type Cache struct {
	Host     string `json:"host"  validate:"required"`
	Port     string `json:"port"  validate:"required"`
	Password string `json:"password"`
	PoolSize int    `json:"poolSize"`
	DB       int    `json:"db"`
}

type Request

type Request struct {
	Sql       Sql    `json:"sql"`
	SqlType   string `json:"sqlType" validate:"required"`
	Cache     Cache  `json:"cache"`
	CacheType string `json:"cacheType"  validate:"required"`
	Level     string `json:"level"` // debug,release,test
	Addr      string `json:"addr"`
}

func (*Request) Request

func (req *Request) Request(ctx iris.Context) error

type Sql

type Sql struct {
	Host     string `json:"host"  validate:"required"`
	Port     string `json:"port"  validate:"required"`
	UserName string `json:"userName" validate:"required"`
	Password string `json:"password"  validate:"required"`
	DBName   string `json:"dbName" validate:"required"`
	LogMode  bool   `json:"logMode"`
}

Jump to

Keyboard shortcuts

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