min

package module
v0.0.0-...-58f306f Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

README

Min

min which is the smallest SDK package

Documentation

Index

Constants

View Source
const (
	Success = "SUCCESS" // 成功
	Fail    = "FAIL"    // 失败
	Run     = "RUNING"  // 运行中
	Init    = "INIT"    // 初始化
	Queue   = "QUEUE"   // 队列中

	SimpleFilePerm = 0666
	DangerPerm     = 0777

	InfoDir = "info"

	AppListFile = "apps.json"
)

Variables

View Source
var (
	PATH = ""
)

Functions

func GetBasePath

func GetBasePath() string

GetBasePath 获取当前的路径

func InitStorage

func InitStorage(path string) (err error)

InitStorage 初始化存储路径

func PathExist

func PathExist(path string) (res bool)

PathExist 路径存在

func PathJoin

func PathJoin(path string, filename string) string

PathJoin 路径拼接

func PathNotExist

func PathNotExist(path string) (res bool)

PathNotExist 路径不存在

Types

type App

type App struct {
	Project string `json:"project,omitempty" yaml:"project,omitempty"`
	Name    string `json:"name" yaml:"name"`
}

func (App) CancelApp

func (a App) CancelApp(path string) (err error)

func (*App) Delete

func (a *App) Delete() (err error)

func (*App) New

func (a *App) New() (err error)

func (*App) RegisterApp

func (a *App) RegisterApp(path string) (err error)

type AppInfo

type AppInfo struct {
	Name string `json:"name"`
}

type AppList

type AppList map[string]AppInfo

type DNA

type DNA struct {
	Name  string            `yaml:"name" json:"name"`
	Env   map[string]string `yaml:"env" json:"env"`
	Genes []GeneForWork     `yaml:"genes" json:"genes"`
}

DNA 运行使用的大数据结构

func HandleMinFile

func HandleMinFile(file MinFile) (dna *DNA, err error)

HandleMinFile 配置文件转换到运行的结构体

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 string      `yaml:"status" json:"status"`
}

GeneForWork (基因)实际运行使用的阶段级别的数据结构

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      string            `yaml:"-" json:"status,omitempty"`
}

MP 最小的单位,CICD最小的执行单位

type MPForWork

type MPForWork struct {
	Single *MP
	Multi  map[string][]MP
}

MPForWork 支线

func HandleMPs

func HandleMPs(MPList []MP) (MPB []MPForWork)

HandleMPs 处理处理单元

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 YamlLoad

func YamlLoad(path string) (anriFile *MinFile, err error)

YamlLoad 读取配置文件(yaml)类型

func YamlLoadByByte

func YamlLoadByByte(content []byte) (anriFile *MinFile, err error)

YamlLoadByByte 读取配置文件

type Project

type Project struct {
	Name string `json:"name" yaml:"name"`
}

func (*Project) Delete

func (p *Project) Delete() (err error)

func (*Project) New

func (p *Project) New() (err error)

Jump to

Keyboard shortcuts

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