model

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: GPL-3.0 Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionInputArg

type ActionInputArg struct {
	Description string `yaml:"description"`
	Default     string `yaml:"default"`
	Required    bool   `yaml:"required"`
}

type ActionResult

type ActionResult struct {
	CodeInfo     string
	Artifactorys []Artifactory    `json:"artifactorys"`
	Reports      []Report         `json:"reports"`
	Deploys      []DeployInfo     `json:"deploys"`
	BuildData    []BuildInfo      `json:"buildData"`
	MetaScanData []MetaScanReport `json:"metaScanData"`
}

type ActionRun

type ActionRun struct {
	Using string       `yaml:"using"`
	Steps []ActionStep `yaml:"steps"`
}

type ActionStep

type ActionStep struct {
	Run   string `yaml:"run"`
	Shell string `yaml:"shell"`
}

type Artifactory

type Artifactory struct {
	Name string `json:"name"`
	Url  string `json:"url"`
}

Artifactory 构建物

type BuildInfo added in v1.0.3

type BuildInfo struct {
	ImageName string `json:"imageName"`
}

type Command

type Command int
const (
	Command_Start Command = iota
	Command_Stop
)

type ContractCheckResult

type ContractCheckResult[T ResultDetailType] struct {
	Name        string                          `json:"name"`
	Result      string                          `json:"result"`
	Tool        string                          `json:"tool"`
	SolcVersion string                          `json:"solcVersion"`
	Context     []ContractCheckResultDetails[T] `json:"context"`
	Total       int                             `json:"total"`
}

func NewContractCheckResult

func NewContractCheckResult[T ResultDetailType](name string, result string, tool string, context []ContractCheckResultDetails[T], total int) ContractCheckResult[T]

type ContractCheckResultDetails

type ContractCheckResultDetails[T ResultDetailType] struct {
	Name     string `json:"name"`
	Issue    int    `json:"issue"`
	GasLimit string `json:"gasLimit"`
	Message  T      `json:"message"`
}

func NewContractCheckResultDetails

func NewContractCheckResultDetails[T ResultDetailType](name string, issue int, message T) ContractCheckResultDetails[T]

type ContractMethodsPropertiesReportDetails

type ContractMethodsPropertiesReportDetails struct {
	Contract   string `json:"contract"`
	Category   string `json:"category"`
	Function   string `json:"function"`
	Visibility string `json:"visibility"`
	ViewPure   string `json:"view_pure"`
	Returns    string `json:"returns"`
	Modifiers  string `json:"modifiers"`
}

func NewContractMethodsPropertiesReportDetails

func NewContractMethodsPropertiesReportDetails(contract, category, function, visibility, viewPure, returns, modifiers string) ContractMethodsPropertiesReportDetails

type ContractStyleGuideValidationsReportDetails

type ContractStyleGuideValidationsReportDetails struct {
	Line         string `json:"line"`
	Column       string `json:"column"`
	Level        string `json:"level"`
	OriginalText string `json:"originalText"`
	Note         string `json:"note"`
	Tool         string `json:"tool"`
}

func NewContractStyleGuideValidationsReportDetails

func NewContractStyleGuideValidationsReportDetails(line, column, level, originalText, note, tool string) ContractStyleGuideValidationsReportDetails

type DeployInfo added in v1.0.3

type DeployInfo struct {
	Name string `json:"name"`
	Cid  string `json:"cid"`
	Url  string `json:"url"`
}

type EslintCheckReportDetails added in v1.0.2

type EslintCheckReportDetails struct {
	Line         string `json:"line"`
	Column       string `json:"column"`
	Level        string `json:"level"`
	OriginalText string `json:"originalText"`
	Note         string `json:"note"`
	Tool         string `json:"tool"`
}

type GasUsageForDeployments added in v1.0.3

type GasUsageForDeployments struct {
	ContractName string `json:"contractName"`
	Min          string `json:"min"`
	Max          string `json:"max"`
	Avg          string `json:"avg"`
	Limit        string `json:"limit"`
}

type GasUsageForMethods added in v1.0.3

type GasUsageForMethods struct {
	ContractName string `json:"contractName"`
	Method       string `json:"method"`
	Min          string `json:"min"`
	Max          string `json:"max"`
	Avg          string `json:"avg"`
	Calls        string `json:"calls"`
}

type IssuesInfo added in v1.0.3

type IssuesInfo struct {
	ContractName string   `json:"contractName"`
	IssuesInfo   []string `json:"issuesInfo"`
}

type Job

type Job struct {
	Version   string            `yaml:"version,omitempty" json:"version"`
	Name      string            `yaml:"name,omitempty" json:"name"`
	Stages    map[string]Stage  `yaml:"stages,omitempty" json:"stages"`
	Parameter map[string]string `yaml:"parameter,omitempty" json:"parameter"`
	UserId    string            `yaml:"user_id"`
}

func (*Job) StageSort

func (job *Job) StageSort() ([]StageDetail, error)

StageSort job 排序

type JobDetail

type JobDetail struct {
	Id int `json:"id"`
	Job
	Status       Status        `json:"status"`
	TriggerMode  string        `yaml:"triggerMode" json:"triggerMode"`
	Stages       []StageDetail `json:"stages"`
	StartTime    time.Time     `yaml:"startTime" json:"startTime"`
	Duration     int64         `json:"duration"`
	ActionResult `yaml:"actionResult" json:"actionResult"`
	Output       *output.Output `json:"output"`
	Error        string         `yaml:"error,omitempty" json:"error"`
}

func (*JobDetail) AddArtifactory

func (jd *JobDetail) AddArtifactory(file *os.File) error

func (*JobDetail) ToString

func (jd *JobDetail) ToString() string

type JobDetailDecrement

type JobDetailDecrement []JobDetail

func (JobDetailDecrement) Len

func (s JobDetailDecrement) Len() int

func (JobDetailDecrement) Less

func (s JobDetailDecrement) Less(i, j int) bool

func (JobDetailDecrement) Swap

func (s JobDetailDecrement) Swap(i, j int)

type JobDetailPage

type JobDetailPage struct {
	Data     []JobDetail `json:"data"`
	Total    int         `json:"total"`
	Page     int         `json:"page"`
	PageSize int         `json:"pageSize"`
}

type JobLog

type JobLog struct {
	// 开始时间
	StartTime time.Time `json:"startTime"`
	// 持续时间
	Duration time.Duration `json:"duration"`

	// 日志内容
	Content string `json:"content"`

	// 最后一行 行号
	LastLine int `json:"lastLine"`
}

type JobPage

type JobPage struct {
	Data     []JobVo `json:"data"`
	Total    int     `json:"total"`
	Page     int     `json:"page"`
	PageSize int     `json:"pageSize"`
}

type JobStageLog

type JobStageLog struct {
	// 开始时间
	StartTime time.Time `json:"startTime"`
	// 持续时间
	Duration time.Duration `json:"duration"`

	// 日志内容
	Content string `json:"content"`

	// 最后一行 行号
	LastLine int `json:"lastLine"`

	// 是否结束
	End bool `yaml:"end" json:"end"`
}

type JobVo

type JobVo struct {
	Version          string           `yaml:"version" json:"version"`
	Name             string           `yaml:"name" json:"name"`
	Stages           map[string]Stage `yaml:"stages" json:"stages"`
	Status           Status           `json:"status"`
	StartTime        time.Time        `yaml:"startTime" json:"startTime"`
	Duration         int64            `json:"duration"`
	TriggerMode      string           `yaml:"triggerMode" json:"triggerMode"`
	PipelineDetailId int              `json:"pipelineDetailId"`
	Error            string           `json:"error"`
	CreateTime       time.Time        `json:"createTime"`
}

type JobVoTimeDecrement

type JobVoTimeDecrement []JobVo

func (JobVoTimeDecrement) Len

func (s JobVoTimeDecrement) Len() int

func (JobVoTimeDecrement) Less

func (s JobVoTimeDecrement) Less(i, j int) bool

func (JobVoTimeDecrement) Swap

func (s JobVoTimeDecrement) Swap(i, j int)

type MetaScanReport added in v1.0.3

type MetaScanReport struct {
	Total          int64  `json:"total"`
	CheckResult    string `json:"checkResult"`
	ResultOverview string `json:"resultOverview"`
	Tool           string `json:"tool""`
}

type Node

type Node struct {
	// ip 地址
	Name    string
	Address string
}

type QueueMessage

type QueueMessage struct {
	JobName    string
	JobId      int
	JobContent string
	Command    Command
}

func NewStartQueueMsg

func NewStartQueueMsg(name, content string, id int) *QueueMessage

func NewStopQueueMsg

func NewStopQueueMsg(name, content string, id int) *QueueMessage

type RemoteAction

type RemoteAction struct {
	Name        string                    `yaml:"name"`
	Description string                    `yaml:"description"`
	Author      string                    `yaml:"author"`
	Inputs      map[string]ActionInputArg `yaml:"inputs"`
	Runs        ActionRun                 `yaml:"runs"`
}

type Report

type Report struct {
	Id      int    `json:"id"`
	Url     string `json:"url"`
	Type    int    `json:"type"` // 2 合约检查,前端检查  3 openai 报告
	Content string `json:"content"`
}

Report 构建物报告

type SendJobError added in v1.0.3

type SendJobError struct {
	ErrorNode string // 出错的节点是哪个,记下来,删掉它
	JobName   string
	JobID     int
	Err       error
}

func (*SendJobError) Error added in v1.0.3

func (e *SendJobError) Error() string

type Stage

type Stage struct {
	Steps []Step   `yaml:"steps,omitempty" json:"steps"`
	Needs []string `yaml:"needs,omitempty" json:"needs"`
}

type StageDetail

type StageDetail struct {
	Name      string    `json:"name"`
	Stage     Stage     `json:"stage"`
	Status    Status    `json:"status"`
	StartTime time.Time `json:"startTime"`
	Duration  int64     `json:"duration"`
}

func NewStageDetail

func NewStageDetail(name string, stage Stage) StageDetail

func (*StageDetail) ToString

func (s *StageDetail) ToString() string

type Status

type Status int
const (
	STATUS_NOTRUN  Status = 0
	STATUS_RUNNING Status = 1
	STATUS_FAIL    Status = 2
	STATUS_SUCCESS Status = 3
	STATUS_STOP    Status = 4
)

func IntToStatus added in v1.0.3

func IntToStatus(s int) (Status, error)

func (Status) ToString added in v1.0.3

func (s Status) ToString() string

type StatusChangeMessage

type StatusChangeMessage struct {
	JobName string
	JobId   int
	Status  Status
}

func NewStatusChangeMsg

func NewStatusChangeMsg(name string, id int, status Status) StatusChangeMessage

type Step

type Step struct {
	Name      string            `yaml:"name,omitempty" json:"name"`
	Id        string            `yaml:"id,omitempty" json:"id"`
	Uses      string            `yaml:"uses,omitempty" json:"uses"`
	With      map[string]string `yaml:"with,omitempty" json:"with"`
	RunsOn    string            `yaml:"runs-on,omitempty" json:"runsOn"`
	Volumes   []string          `yaml:"volumes" json:"volumes"`
	Run       string            `yaml:"run,omitempty" json:"run"`
	Status    Status            `yaml:"status,omitempty" json:"status"`
	StartTime time.Time         `yaml:"startTime,omitempty" json:"startTime"`
	Duration  int64             `yaml:"duration,omitempty" json:"duration"`
}

type Template

type Template struct {
	Id          int    `yaml:"id,omitempty" json:"id"`
	Name        string `yaml:"name,omitempty" json:"name"`
	Description string `yaml:"description,omitempty" json:"description"`
	Tag         string `yaml:"tag,omitempty" json:"tag"`
	ImageName   string `yaml:"imageName,omitempty" json:"imageName"`
}

type TemplateChinese

type TemplateChinese struct {
	Id                 int    `yaml:"id,omitempty" json:"id"`
	Name               string `yaml:"name,omitempty" json:"name"`
	DescriptionChinese string `yaml:"descriptionChinese,omitempty" json:"description"`
	Tag                string `yaml:"tag,omitempty" json:"tag"`
	ImageName          string `yaml:"imageName,omitempty" json:"imageName"`
}

type TemplateDetail

type TemplateDetail struct {
	Id          int    `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Yaml        string `json:"yaml"`
}

type TemplateEnglish

type TemplateEnglish struct {
	Id                 int    `yaml:"id,omitempty" json:"id"`
	Name               string `yaml:"name,omitempty" json:"name"`
	DescriptionEnglish string `yaml:"descriptionEnglish,omitempty" json:"description"`
	Tag                string `yaml:"tag,omitempty" json:"tag"`
	ImageName          string `yaml:"imageName,omitempty" json:"imageName"`
}

type TemplateVo

type TemplateVo struct {
	Id          int    `yaml:"id" json:"id"`
	Name        string `yaml:"name" json:"name"`
	Description string `yaml:"description" json:"description"`
	Tag         string `yaml:"tag" json:"tag"`
	ImageName   string `yaml:"imageName" json:"imageName"`
	Template    string `yaml:"template" json:"template"`
}

type TestResult added in v1.0.3

type TestResult struct {
	Result        int    `json:"result"`
	UnitTestTitle string `json:"unitTestTitle"`
}

type UnitTestResult added in v1.0.3

type UnitTestResult struct {
	ContractName   string       `json:"contractName"`
	TestResultList []TestResult `json:"TestResultList"`
}

Jump to

Keyboard shortcuts

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