Documentation ¶
Index ¶
- Constants
- Variables
- func DockerBuild(obj DockerBuildParams) (err error)
- func ExecCmd(theCmd *exec.Cmd) (err error)
- func GetBasePath() string
- func GitPull(obj GitParams) (err error)
- func InitStorage(path string) (err error)
- func ListSynthesis(list []MP, cellSpace string) (err error)
- func PathExist(path string) (res bool)
- func SendEmail(mailConf MailboxConf) (err error)
- func Shell(obj ShellParams) (err error)
- type App
- func (a *App) CancelApp(path string) (err error)
- func (a *App) Delete() (err error)
- func (a *App) GetConfigJson() (aac *AppAdminConfig, err error)
- func (a *App) GetConfigYaml() (mf *MinFile, err error)
- func (a *App) LoadConfigJsonByByte(content []byte) (err error)
- func (a *App) LoadConfigJsonByFile(path string) (err error)
- func (a *App) LoadConfigYamlByByte(content []byte) (err error)
- func (a *App) LoadConfigYamlByFile(path string) (err error)
- func (a *App) New() (err error)
- func (a *App) NewProductionLine(num int) (pl *DNA, err error)
- func (a *App) RegisterApp(path string) (err error)
- func (a *App) Run() (plObj *DNA, err error)
- type AppAdminConfig
- type AppInfo
- type AppList
- type DNA
- type DockerBuildParams
- type Gene
- type GeneForWork
- type GitParams
- type MP
- type MPForWork
- type MailboxConf
- type MinFile
- type MiniMin
- type Project
- type RunLogJson
- type ShellParams
- type Status
Constants ¶
View Source
const ( Success Status = "SUCCESS" // 成功 Fail Status = "FAIL" // 失败 Run Status = "RUNNING" // 运行中 Init Status = "INIT" // 初始化 Queue Status = "QUEUE" // 队列中 SimpleFilePerm = 0666 // 普通文件权限 SimpleDirPerm = 0755 // 普通文件夹权限 DangerPerm = 0777 // 危险权限 AppListFile = "apps.json" // app列表存储文件名称 EnvJsonFile = ".env.json" ConfigYamlFile = "config.yaml" // yaml配置文件名 ConfigJsonFile = "config.json" // json配置文件夹名 InfoDir = "info" // 信息文件夹名 RunLogJsonFile = "run_log.json" // json配置文件夹名 )
Variables ¶
View Source
var (
PATH = ""
)
Functions ¶
func DockerBuild ¶
func DockerBuild(obj DockerBuildParams) (err error)
func ListSynthesis ¶
func SendEmail ¶
func SendEmail(mailConf MailboxConf) (err error)
func Shell ¶
func Shell(obj ShellParams) (err error)
Types ¶
type App ¶
type App struct { Project Name string `json:"name" yaml:"name"` Path string `json:"path,omitempty" yaml:"path,omitempty"` }
App app
func (*App) GetConfigJson ¶
func (a *App) GetConfigJson() (aac *AppAdminConfig, err error)
GetConfigJson 获取配置
func (*App) GetConfigYaml ¶
GetConfigYaml 获取运行配置
func (*App) LoadConfigJsonByByte ¶
LoadConfigJsonByFile 通过文件加载配置(管理的json文件)
func (*App) LoadConfigJsonByFile ¶
LoadConfigJsonByFile 通过文件加载配置(管理的json文件)
func (*App) LoadConfigYamlByByte ¶
LoadConfigYamlByByte 通过内容加载配置(CI/CD运行使用的文件)
func (*App) LoadConfigYamlByFile ¶
LoadConfigYamlByFile 通过文件加载配置(CI/CD运行使用的文件)
func (*App) NewProductionLine ¶
NewProductionLine 新启动一条生产线
type AppAdminConfig ¶
type AppAdminConfig struct { MaxStorageDays int `json:"max_storage_days,omitempty"` MaxStorageTimes int `json:"max_storage_times,omitempty"` }
AppAdminConfig app管理的设置
type DNA ¶
type DNA struct { Num string `yaml:"-" json:"num"` Path string `yaml:"-" json:"path"` Env map[string]string `yaml:"env" json:"env"` Genes []GeneForWork `yaml:"genes" json:"genes"` }
DNA 运行使用的最外层数据结构
func (*DNA) HandleMinFile ¶
HandleMinFile 配置文件转换到运行的结构体
func (*DNA) LoadMinFile ¶
type DockerBuildParams ¶
type Gene ¶
type Gene struct { Name string `yaml:"name" json:"name"` MPs []MP `yaml:"MPs" json:"MPs"` Ignore bool `yaml:"ignore,omitempty" json:"ignore,omitempty"` When string `yaml:"when,omitempty" json:"when,omitempty"` }
Gene (基因)解析文件产生的对应顺序
type GeneForWork ¶
type GeneForWork struct { Name string `yaml:"name" json:"name"` MPs []MPForWork `yaml:"MPs" json:"MPs"` Ignore bool `yaml:"ignore,omitempty" json:"ignore,omitempty"` When string `yaml:"when,omitempty" json:"when,omitempty"` Status Status `yaml:"status" json:"status"` }
GeneForWork (基因)实际运行使用的阶段级别的数据结构
type GitParams ¶
type GitParams struct { URL string `yaml:"url" json:"url"` User string `yaml:"user;omitempty" json:"user;omitempty"` Password string `yaml:"password;omitempty" json:"password;omitempty"` SecretKey string `yaml:"secret_key;omitempty" json:"secret_key;omitempty"` Alias string `yaml:"alias;omitempty" json:"alias;omitempty"` Cell string `yaml:"-" json:"-"` }
type MP ¶
type MP struct { Name string `yaml:"name" json:"name"` Description string `yaml:"description,omitempty" json:"description,omitempty"` AminoAcid string `yaml:"amino_acid" json:"amino_acid"` Chain string `yaml:"chain,omitempty" json:"chain,omitempty"` Params map[string]string `yaml:"params,omitempty" json:"params,omitempty"` Ignore bool `yaml:"ignore,omitempty" json:"ignore,omitempty"` When string `yaml:"when,omitempty" json:"when,omitempty"` Status Status `yaml:"-" json:"status,omitempty"` }
MP 最小的单位,CI/CD最小的执行单位
type MailboxConf ¶
type MailboxConf struct { Sender string `json:"sender"` SMTPPort int SPassword string SMTPAddr string Title string `json:"title"` // 邮件标题 Body string `json:"body"` // 邮件内容 Addressee string `json:"addressee"` // 收件人列表 }
MailboxConf 邮箱配置
type MinFile ¶
type MinFile struct { Name string `yaml:"name" json:"name"` Env map[string]string `yaml:"env" json:"env"` Genes []Gene `yaml:"genes" json:"genes"` }
MinFile 配置文件结构
func YamlLoadByByte ¶
YamlLoadByByte 读取配置文件
type Project ¶
type Project struct { Name string `json:"name" yaml:"name"` Path string `json:"path,omitempty" yaml:"path,omitempty"` }
Project 工程
type RunLogJson ¶
type RunLogJson struct { Num int `json:"num"` StartTime sql.NullTime `json:"start_time"` EndTime sql.NullTime `json:"end_time"` Status Status `json:"status"` }
RunLogJson 运行记录的json记录文件
type ShellParams ¶
type ShellParams struct {
Cmd string `json:"cmd"`
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.