project

package
v0.0.0-...-bf04ae1 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const ProjectSettingFilePath = ".toolchain.yaml"

Variables

This section is empty.

Functions

This section is empty.

Types

type GlacierAuth

type GlacierAuth struct {
	Host         string
	Port         string
	ClientID     string
	ClientSecret string
}

GlacierAuth 鉴权服务配置

type Memory

type Memory struct {
	TTL  int
	Size int
}

type MongoDB

type MongoDB struct {
	Endpoints []string `yaml:"endpoints"`
	UserName  string   `yaml:"username"`
	Password  string   `yaml:"password"`
	Database  string   `yaml:"database"`
	AuthDB    string   `yaml:""`
}

type MySQL

type MySQL struct {
	Host     string
	Port     string
	Database string
	UserName string
	Password string
}

type PostgreSQL

type PostgreSQL struct {
	Host     string
	Port     string
	Database string
	UserName string
	Password string
}

type Project

type Project struct {
	PKG               string       `yaml:"pkg"`
	Name              string       `yaml:"name"`
	AppName           string       `yaml:"-"`
	CapName           string       `yaml:"-"`
	Description       string       `yaml:"description"`
	EnableGlacierAuth bool         `yaml:"enable_glacier_auth"`
	GlacierAuth       *GlacierAuth `yaml:"-"`
	EnableMySQL       bool         `yaml:"enable_mysql"`
	MySQL             *MySQL       `yaml:"-"`
	EnablePostgreSQL  bool         `yaml:"enable_postgre_sql"`
	PostgreSQL        *PostgreSQL  `yaml:"_"`
	EnableMongoDB     bool         `yaml:"enable_mongodb"`
	MongoDB           *MongoDB     `yaml:"-"`
	GenExample        bool         `yaml:"gen_example"`
	HttpFramework     string       `yaml:"http_framework"`
	EnableCache       bool         `yaml:"enable_cache"`
	CacheType         string       `yaml:"cache_type"`
	EnableMemory      bool         `yaml:"enable_memory"`
	Memory            *Memory      `yaml:"-"`
	EnableRedis       bool         `yaml:"enable_redis"`
	Redis             *Redis       `yaml:"-"`
	// contains filtered or unexported fields
}

func LoadConfigFromCLI

func LoadConfigFromCLI() (*Project, error)

LoadConfigFromCLI 配置

func LoadConfigFromYAMLCLI

func LoadConfigFromYAMLCLI() (*Project, error)

func (*Project) Add

func (p *Project) Add() error

Add 创建应用

func (*Project) FuncMap

func (p *Project) FuncMap() template.FuncMap

func (*Project) Init

func (p *Project) Init() error

Init 初始化项目

func (*Project) LoadGlacierAuthConfig

func (p *Project) LoadGlacierAuthConfig() error

func (*Project) LoadMemoryConfig

func (p *Project) LoadMemoryConfig() error

func (*Project) LoadMongoDBConfig

func (p *Project) LoadMongoDBConfig() error

func (*Project) LoadMySQLConfig

func (p *Project) LoadMySQLConfig() error

func (*Project) LoadPostgreSQLConfig

func (p *Project) LoadPostgreSQLConfig() error

func (*Project) LoadRedisConfig

func (p *Project) LoadRedisConfig() error

func (*Project) SaveFile

func (p *Project) SaveFile(filePath string) error

func (*Project) ToYAML

func (p *Project) ToYAML() (string, error)

type ProjectAdd

type ProjectAdd struct {
	PKG              string
	AppName          string
	CapName          string
	EnableMySQL      bool
	EnableMongoDB    bool
	EnablePostgreSQL bool
}

type Redis

type Redis struct {
	Prefix     string
	Address    string
	DB         int
	Password   string
	DefaultTTL int
}

Jump to

Keyboard shortcuts

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