command

package
v0.0.0-...-8b2948b Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2017 License: MIT Imports: 16 Imported by: 0

README

使用方式

easy-takeout [flags]

easy-takeout [commands] [flags]

可用命令简介

generate

使用模板解析生成html文件

执行该命令会将template/中的html文件渲染并写入public/

在template/static中的文件不会被解析,并且会原封不动的拷贝到到public中

可以通过 "."的方式调用Config中的属性 e.g. {{.BaseUrl}} => http://127.0.0.1

关于渲染规则可以看render库

migrate

在数据库中创建/修改表格

server

一切准备就绪后,就可以开启服务

print

以toml格式打印当前配置

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AvaliableCommand = map[string]Command{}
View Source
var HelpDescription = `Usage of easy-takeout:
Usage:
  easy-takeout [flags]
  easy-takeout [commands] [flags]
`

Functions

func Execute

func Execute()

config get priority command > configFile

func PrintCommands

func PrintCommands()

func UsageGenerate

func UsageGenerate()

Types

type Command

type Command struct {
	Description string
	Executer    func(c *Config)
}

type Config

type Config struct {
	BaseUrl      string                 `toml:"baseurl" json:"baseurl" yaml:"baseurl"`
	DbAddress    string                 `toml:"dbaddress" json:"dbaddress" yaml:"dbaddress"`
	DbType       string                 `toml:"dbtype" json:"dbtype" yaml:"dbtype"`
	NeedLogin    bool                   `toml:"needlogin" json:"needlogin" yaml:"needlogin"`
	DbArgs       map[string]interface{} `toml:"dbargs" json:"dbargs" yaml:"dbargs"`
	CacheAddress string                 `toml:"cacheaddress" json:"cacheaddress" yaml:"cacheaddress"`
	Watch        bool                   `toml:"watch" json:"watch" yaml:"watch"`

	Custom map[string]interface{} `toml:"custom" json:"custom" yaml:"custom"`
}

Jump to

Keyboard shortcuts

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