interfacecase

package
v0.0.0-...-b652da8 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: Apache-2.0 Imports: 5 Imported by: 4

Documentation

Overview

自动生成模板ApiCase

自动生成模板TestCase

自动生成模板ApiConfig

自动生成模板TimerTask

自动生成模板ApiMenu

自动生成模板InterfaceTemplate

Index

Constants

View Source
const (
	CaseTypeApi         CaseType = 1 // api 运行
	CaseTypeStep        CaseType = 2 // 步骤运行
	CaseTypeCases       CaseType = 3 // 用例运行
	CaseTypeTask        CaseType = 4 // 定时任务运行
	CaseTypeBoomerDebug CaseType = 5 // 性能任务调试
	CaseTypeBoomer      CaseType = 6 // 性能任务运行
	CaseTypeTag         CaseType = 7 // 标签运行
	RunTypeDebug        RunType  = 1 // 调试模式
	RunTypeRuning       RunType  = 2 // 立即运行
	RunTypeRunBack      RunType  = 3 // 后台运行
	RunTypeRunTimer     RunType  = 4 // 定时执行
	RunTypeRunSave      RunType  = 5 // 调试并保存
	RunTypeCI           RunType  = 6 // 调试并保存
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiCase

type ApiCase struct {
	global.GVA_MODEL
	Operator
	Name        string        `json:"name,omitempty" form:"name" gorm:"column:name;comment:用例名称;"`
	Status      *bool         `json:"status,omitempty" form:"status" gorm:"column:status;comment:状态;"`
	Describe    string        `json:"describe,omitempty" form:"describe" gorm:"column:describe;comment:备注;"`
	RunNumber   *int          `json:"runNumber,omitempty" form:"runNumber" gorm:"column:run_number;comment:运行次数;"`
	RunConfig   *ApiConfig    `json:"runConfig,omitempty" form:"runConfig"`
	RunConfigID uint          `json:"RunConfigID,omitempty" form:"RunConfigID" gorm:"column:RunConfigID;comment:运行配置;"`
	ApiCaseStep []ApiCaseStep `json:"case,omitempty" form:"case" gorm:"many2many:ApiCaseRelationship;"`
	//Performance []Performance   `json:"performance,omitempty" form:"performance" gorm:"many2many:PerformanceRelationship;"`
	FrontCase  *bool    `json:"front_case,omitempty" form:"front_case" gorm:"comment:是否为前置用例"`
	EntryID    int      `json:"-"`
	ApiMenuID  uint     `json:"-" gorm:"comment:所属菜单"`
	ApiMenu    *ApiMenu `json:"-"`
	ApiEnvName *string  `json:"api_env_name" gorm:"comment:所属环境名称;"`
	ApiEnvID   uint     `json:"api_env_id" gorm:"comment:所属环境;"`
}

ApiCase 结构体 如果含有time.Time 请自行import time包

type ApiCaseRelationship

type ApiCaseRelationship struct {
	global.GVA_MODEL
	ApiCaseStep   ApiCaseStep
	ApiCaseStepId uint `gorm:"comment:测试步骤"` // 测试步骤
	ApiCase       ApiCase
	ApiCaseId     uint `gorm:"comment:测试用例"` // 测试用例
	Sort          uint `gorm:"comment:排序"`   // 排序
}

type ApiCaseStep

type ApiCaseStep struct {
	global.GVA_MODEL
	Operator
	Name          string      `json:"name,omitempty" form:"name" gorm:"column:name;comment:步骤名称;"`
	FrontCase     *bool       `json:"front_case,omitempty" form:"front_case" gorm:"comment:允许设置为前置用例;"`
	TStep         []*ApiStep  `json:"TStep,omitempty" form:"TStep" gorm:"many2many:ApiCaseStepRelationship;"`
	ApiCase       []ApiCase   `json:"case,omitempty" form:"case" gorm:"many2many:ApiCaseRelationship;"`
	RunConfigID   uint        `json:"RunConfigID,omitempty" form:"RunConfigID" gorm:"comment:运行配置;"`
	RunConfigName *string     `json:"RunConfigName,omitempty" form:"RunConfigName" gorm:"comment:运行配置名称;"`
	ApiMenu       ApiMenu     `json:"-"`
	ApiMenuID     uint        `json:"-" gorm:"comment:所属菜单;"`
	Type          ApiType     `json:"type,omitempty" form:"type" gorm:"column:type;comment:接口类型"`
	ApiStepType   ApiStepType `json:"api_step_type,omitempty" gorm:"column:api_step_type;comment:性能测试step类型"`
	ApiEnvName    *string     `json:"api_env_name,omitempty" gorm:"comment:所属环境名称;"`
	ApiEnvID      uint        `json:"api_env_id,omitempty" gorm:"comment:所属环境;"`
}

ApiCaseStep 结构体 如果含有time.Time 请自行import time包

type ApiCaseStepRelationship

type ApiCaseStepRelationship struct {
	global.GVA_MODEL
	ApiStep       ApiStep
	ApiStepId     uint `gorm:"comment:测试步骤"`
	ApiCaseStep   ApiCaseStep
	ApiCaseStepId uint `gorm:"comment:测试步骤"`
	Sort          uint `gorm:"comment:排序"`
}

type ApiConfig

type ApiConfig struct {
	global.GVA_MODEL
	Operator
	Name           string              `json:"name,omitempty" form:"name" gorm:"column:name;comment:配置名称;size:255;"`
	BaseUrl        string              `json:"base_url,omitempty" form:"base_url" gorm:"column:base_url;comment:默认域名;size:255;"`
	Variables      datatypes.JSONMap   `json:"variables,omitempty" form:"variables" gorm:"column:variables;comment:变量;type:text"`
	Headers        datatypes.JSONMap   `json:"headers,omitempty" form:"headers" gorm:"column:headers;comment:请求头;type:text"`
	Parameters     datatypes.JSONMap   `json:"parameters,omitempty" form:"parameters" gorm:"column:parameters;comment:参数;type:text"`
	VariablesJson  datatypes.JSON      `json:"variables_json,omitempty" form:"variables_json"`
	HeadersJson    datatypes.JSON      `json:"headers_json,omitempty" form:"headers_json" gorm:"column:headers_json;comment:;type:text"`
	Weight         int                 `json:"weight,omitempty" form:"weight" gorm:"column:weight;weight:;"`
	Default        bool                `json:"default,omitempty" form:"default" gorm:"column:default;comment:默认配置;"`
	Timeout        float32             `json:"timeout,omitempty,omitempty" form:"timeout" gorm:"comment:超时时间" `
	AllowRedirects bool                `json:"allow_redirects,omitempty,omitempty" form:"allow_redirects" gorm:"column:allow_redirects;comment:;"`
	Verify         bool                `json:"verify,omitempty" form:"verify" gorm:"column:verify;comment:;"`
	Export         customType.TypeArgs `json:"export,omitempty" gorm:"column:export;comment:导出参数;"`
	SetupCase      *ApiCaseStep        `json:"setup_case,omitempty" `
	SetupCaseID    *uint               `json:"setup_case_id,omitempty" form:"setup_case_id" gorm:"comment:前置用例"`
	Environs       map[string]string   `json:"environs,omitempty" yaml:"environs,omitempty" gorm:"-"` // environment variables
	CaseID         uint                `json:"case_id,omitempty" gorm:"-"`
	ReportID       uint                `json:"report_id,omitempty" gorm:"-"`
	Retry          uint                `json:"retry" gorm:"comment:重试次数"`
}

ApiConfig 结构体 如果含有time.Time 请自行import time包

type ApiDebugTalk

type ApiDebugTalk struct {
	global.GVA_MODEL
	Operator
	FileType FileType `json:"file_type" form:"file_type" gorm:"comment:文件类型"`
	Content  string   `json:"content,omitempty" form:"content" gorm:"column:content;type:text;comment:文件内容"`
}

type ApiEnv

type ApiEnv struct {
	global.GVA_MODEL
	Operator
	Default bool   `json:"default,omitempty" form:"default" gorm:"column:default;comment:默认环境;"`
	Key     string `json:"key,omitempty" form:"key"`
	Name    string `json:"name,omitempty" form:"name"`
	Remarks string `json:"remarks"`
}

type ApiEnvDetail

type ApiEnvDetail struct {
	global.GVA_MODEL
	Operator
	Key   string            `json:"key"  form:"key"`
	Name  string            `json:"name,omitempty" form:"name"`
	Value datatypes.JSONMap `json:"value"`
}

type ApiGrpc

type ApiGrpc struct {
	global.GVA_MODEL
	URL         string            `json:"url,omitempty" yaml:"url" gorm:"column:url;comment:请求地址"`
	Headers     datatypes.JSONMap `json:"headers,omitempty" form:"headers" gorm:"column:headers;comment:请求头;type:text"`
	HeadersJson datatypes.JSON    `json:"headers_json,omitempty" form:"headers_json" gorm:"column:headers_json;comment:请求头json数据格式;"`
	Body        datatypes.JSONMap `json:"body,omitempty" gorm:"column:body;comment:请求体"`
	Timeout     float32           `json:"timeout,omitempty" yaml:"timeout,omitempty" gorm:"column:timeout;comment:超时时间"`
	Type        GrpcType          `json:"type,omitempty" yaml:"type,omitempty" gorm:"column:type;comment:请求类型"`
	Detail      datatypes.JSONMap `json:"detail,omitempty" form:"detail" gorm:"column:detail;comment:请求服务器详情;type:text"`

	Parent uint `json:"-"`
}

type ApiMenu

type ApiMenu struct {
	global.GVA_MODEL
	Operator
	Name     string `json:"name,omitempty" form:"name" gorm:"column:name;comment:菜单名称;"`
	Parent   uint   `json:"parent,omitempty" form:"parent" gorm:"column:parent;comment:父节点id;"`
	MenuType string `json:"menuType,omitempty" form:"menuType" gorm:"column:menu_type;comment:菜单类型;"`
}

ApiMenu 结构体 如果含有time.Time 请自行import time包

type ApiMessage

type ApiMessage struct {
	global.GVA_MODEL
	Operator
	Name      string      `json:"name" form:"name" gorm:"column:name;comment:消息名称;"`
	Type      MessageType `json:"type" form:"type" gorm:"column:type;comment:消息类型;"`
	TypeName  string      `json:"type_name" form:"type_name" gorm:"column:type_name;comment:消息类型名称;"`
	WebHook   string      `json:"webhook" form:"webhook" gorm:"column:webhook;comment:webhook地址;"`
	Signature string      `json:"signature" form:"signature" gorm:"column:signature;comment:签名;"`
	Fail      bool        `json:"fail" form:"fail" gorm:"column:fail;comment:仅失败时发送;"`
}

type ApiMessageLog

type ApiMessageLog struct {
	global.GVA_MODEL
	Operator
	ApiMessageID uint       `json:"api_message_id,omitempty" form:"api_message_id" gorm:"column:api_message_id;comment:消息ID;"`
	ApiMessage   ApiMessage `json:"api_message,omitempty" form:"api_message"`
	Message      string     `json:"message,omitempty" form:"message" gorm:"column:message;comment:消息内容;type:text"`
	Status       bool       `json:"status,omitempty" form:"status" gorm:"column:status;comment:消息发送状态;"`
	StatusCode   int        `json:"status_code,omitempty" form:"status_code" gorm:"column:status_code;comment:消息发送状态码;"`
}

type ApiReport

type ApiReport struct {
	global.GVA_MODEL
	Operator
	Name       string             `json:"name,omitempty"`
	Success    *bool              `json:"success,omitempty"`
	Stat       *ApiReportStat     `json:"stat,omitempty"`
	StatID     uint               `json:"-"`
	Time       *ApiReportTime     `json:"time,omitempty"`
	TimeID     uint               `json:"-"`
	Platform   datatypes.JSON     `json:"platform,omitempty"`
	Details    []ApiReportDetails `json:"details,omitempty"`
	CaseType   CaseType           `json:"runType,omitempty"` //1、api,2、case,3、task
	RunType    RunType            `json:"type,omitempty"`    //1、调试,2、立即运行,3、后台运行
	Status     int                `json:"status,omitempty"`
	SetupCase  bool               `json:"setup_case,omitempty"`
	Describe   string             `json:"describe,omitempty" form:"describe" gorm:"column:describe;comment:;"`
	ApiEnvName string             `json:"api_env_name,omitempty" gorm:"comment:所属环境名称;"`
	ApiEnvID   uint               `json:"api_env_id,omitempty" gorm:"comment:所属环境;"`
	Hostname   string             `json:"hostname,omitempty" gorm:"comment:主机名;"`
}

type ApiReportCI

type ApiReportCI struct {
	global.GVA_MODEL
	Key              string            `json:"key" yaml:"key"`
	TagID            uint              `json:"tag" form:"tag"`
	TaskID           uint              `json:"task" form:"task"`
	EnvID            uint              `json:"env" form:"env"`
	ReportID         uint              `json:"report_id" form:"report_id"`
	Report           *ApiReport        `json:"report"`
	Project          system.Project    `json:"-"`
	ProjectID        uint              `json:"project_id,omitempty" yaml:"project_id"`
	CallbackUrl      string            `json:"callback_url" form:"callback_url"`
	CallbackResponse string            `json:"callback_response" form:"callback_response" gorm:"column:callback_response;type:text;comment:回调返回内容"`
	Other            datatypes.JSONMap `json:"other" form:"other"`
}

type ApiReportDetails

type ApiReportDetails struct {
	global.GVA_MODEL
	CaseID       uint                      `json:"caseID,omitempty"`
	Name         string                    `json:"name,omitempty"`
	Success      bool                      `json:"success,omitempty"`
	Stat         datatypes.JSON            `json:"stat,omitempty"`
	Time         datatypes.JSON            `json:"time,omitempty"`
	InOut        datatypes.JSON            `json:"in_out,omitempty"`
	Records      []ApiReportDetailsRecords `json:"records,omitempty"`
	ApiRecordsID uint                      `json:"-"`
	RootDir      string                    `json:"root_dir,omitempty"`
	ApiReportID  uint                      `json:"-"`
}

type ApiReportDetailsRecords

type ApiReportDetailsRecords struct {
	global.GVA_MODEL
	ParntID            uint                          `json:"parntID,omitempty"`
	Name               string                        `json:"name,omitempty"`
	StepType           string                        `json:"step_type,omitempty"`
	Success            bool                          `json:"success,omitempty"`
	ElapsedMs          int                           `json:"elapsed_ms,omitempty"`
	ValidateNumber     uint                          `json:"validate_number,omitempty" form:"validate_number"`
	Data               []ApiReportDetailsRecordsData `json:"data,omitempty"`
	ExportVars         datatypes.JSON                `json:"export_vars,omitempty"`
	ContentSize        int                           `json:"content_size,omitempty"`
	ApiReportDetailsID uint                          `json:"-"`
}

type ApiReportDetailsRecordsData

type ApiReportDetailsRecordsData struct {
	ID                        int                                  `json:"ID,omitempty"`
	ParntID                   int                                  `json:"parntID,omitempty"`
	Name                      string                               `json:"name,omitempty"`
	StepType                  string                               `json:"step_type,omitempty"`
	Success                   bool                                 `json:"success,omitempty"`
	ElapsedMs                 int                                  `json:"elapsed_ms,omitempty"`
	HttpStat                  *ApiReportDetailsRecordsDataHttpstat `json:"httpstat,omitempty"`
	Attachment                string                               `json:"attachments,omitempty"`
	HttpStatID                uint                                 `json:"-"`
	Data                      datatypes.JSON                       `json:"data,omitempty"`
	ExportVars                datatypes.JSON                       `json:"export_vars,omitempty"`
	ContentSize               int                                  `json:"content_size,omitempty"`
	ApiReportDetailsRecordsID uint                                 `json:"-"`
	Retry                     uint                                 `json:"retry,omitempty" yaml:"retry,omitempty"`
	Skip                      bool                                 `json:"skip" yaml:"skip"`
}

type ApiReportDetailsRecordsDataHttpstat

type ApiReportDetailsRecordsDataHttpstat struct {
	global.GVA_MODEL
	Connect          int `json:"Connect,omitempty"`
	ContentTransfer  int `json:"ContentTransfer,omitempty"`
	DNSLookup        int `json:"DNSLookup,omitempty"`
	NameLookup       int `json:"NameLookup,omitempty"`
	Pretransfer      int `json:"Pretransfer,omitempty"`
	ServerProcessing int `json:"ServerProcessing,omitempty"`
	StartTransfer    int `json:"StartTransfer,omitempty"`
	TCPConnection    int `json:"TCPConnection,omitempty"`
	TLSHandshake     int `json:"TLSHandshake,omitempty"`
	Total            int `json:"Total,omitempty"`
}

type ApiReportStat

type ApiReportStat struct {
	global.GVA_MODEL
	TestCases   *ApiReportStatTestcases `json:"testcases,omitempty"`
	TestCasesID uint                    `json:"-"`
	TestSteps   *ApiReportStatTeststeps `json:"teststeps,omitempty"`
	TestStepsID uint                    `json:"-"`
}

type ApiReportStatTestcases

type ApiReportStatTestcases struct {
	global.GVA_MODEL
	Total   int `json:"total"`
	Success int `json:"success"`
	Fail    int `json:"fail"`
}

type ApiReportStatTeststeps

type ApiReportStatTeststeps struct {
	global.GVA_MODEL
	Total     int `json:"total"`
	Successes int `json:"successes"`
	Failures  int `json:"failures"`
	Error     int `json:"error"`
	Skip      int `json:"skip"`
}

type ApiReportTime

type ApiReportTime struct {
	global.GVA_MODEL
	StartAt  time.Time `json:"start_at,omitempty"`
	Duration float64   `json:"duration,omitempty"`
}

type ApiRequest

type ApiRequest struct {
	global.GVA_MODEL
	Agreement      string            `json:"agreement,omitempty" form:"agreement" gorm:"column:agreement;comment:协议"`
	Method         string            `json:"method,omitempty" form:"method" gorm:"column:method;comment:请求方法"`
	HTTP2          bool              `json:"http2,omitempty" form:"http2"  gorm:"column:http2;comment:是否为http2;"`
	Url            string            `json:"url,omitempty" form:"url" gorm:"column:url;comment:请求url;"`
	Params         datatypes.JSONMap `json:"params,omitempty" form:"params" gorm:"column:params;comment:url参数;type:text"`
	Headers        datatypes.JSONMap `json:"headers,omitempty" form:"headers" gorm:"column:headers;comment:请求头;type:text"`
	Data           datatypes.JSONMap `json:"data,omitempty" form:"data" gorm:"column:data;comment:request body data;type:text"`
	ParamsJson     datatypes.JSON    `json:"params_json,omitempty" form:"params_json" gorm:"column:params_json;comment:url参数json数据格式;"`
	HeadersJson    datatypes.JSON    `json:"headers_json,omitempty" form:"headers_json" gorm:"column:headers_json;comment:请求头json数据格式;"`
	DataJson       datatypes.JSON    `json:"data_json,omitempty" form:"data_json" gorm:"column:data_json;comment:request body data json数据格式;"`
	Json           datatypes.JSON    `json:"json,omitempty" form:"json"`
	Timeout        float32           `json:"timeout,omitempty" form:"timeout"  gorm:"comment:超时时间"`
	AllowRedirects bool              `json:"allow_redirects,omitempty" form:"allow_redirects" gorm:"column:allow_redirects;comment:;"`
	Verify         bool              `json:"verify,omitempty" form:"verify" gorm:"column:verify;comment:;"`
}

type ApiStep

type ApiStep struct {
	global.GVA_MODEL
	Operator
	Name    string      `json:"name,omitempty" form:"name" gorm:"column:name;comment:接口名称"`
	ApiType ApiType     `json:"type,omitempty" form:"type" gorm:"column:api_type;comment:接口类型"`
	Request *ApiRequest `json:"request,omitempty" form:"request;comment:http接口"`
	Grpc    *ApiGrpc    `json:"gRPC,omitempty" yaml:"gRPC,omitempty"`

	Transaction *ApiStepTransaction `json:"transaction,omitempty" yaml:"transaction,omitempty;comment:事务"`
	Rendezvous  *ApiStepRendezvous  `json:"rendezvous,omitempty" yaml:"rendezvous,omitempty;comment:集合点"`
	ThinkTime   *ApiStepThinkTime   `json:"think_time,omitempty" yaml:"think_time,omitempty;comment:思考时间"`

	ThinkTimeID   uint `json:"think_time_id,omitempty" gorm:"comment:思考时间"`
	TransactionID uint `json:"transaction_id,omitempty" gorm:"comment:事务"`
	RendezvousID  uint `json:"rendezvous_id,omitempty" gorm:"comment:集合点"`
	RequestID     uint `json:"request_id,omitempty" gorm:"comment:http请求"`
	GrpcID        uint `json:"grpc_id,omitempty" gorm:"comment:grpc请求"`

	Variables       datatypes.JSONMap      `json:"variables,omitempty" form:"variables" gorm:"column:variables;comment:变量;type:text"`
	Extract         datatypes.JSONMap      `json:"extract,omitempty" form:"extract" gorm:"column:extract;comment:导出参数;type:text"`
	Validate        customType.TypeArgsMap `json:"validate,omitempty" form:"validate" gorm:"column:validate;comment:断言;type:text"`
	ValidateNumber  uint                   `json:"validate_number,omitempty" form:"validate_number;comment:断言数量"`
	ValidateJson    datatypes.JSON         `json:"validate_json,omitempty" form:"validate_json;comment:变量json格式" `
	ExtractJson     datatypes.JSON         `json:"extract_json,omitempty" form:"extract_json;comment:导出参数json格式"`
	VariablesJson   datatypes.JSON         `json:"variables_json,omitempty" form:"variables_json;comment:断言json类型"`
	Hooks           string                 `json:"hooks,omitempty" form:"hooks" gorm:"column:hooks;"`
	SetupHooks      customType.TypeArgs    `json:"setup_hooks,omitempty" form:"setup_hooks,omitempty" gorm:"column:setup_hooks;type:text"`
	TeardownHooks   customType.TypeArgs    `json:"teardown_hooks,omitempty" form:"teardown_hooks,omitempty" gorm:"column:teardown_hooks;type:text"`
	TTestCase       []ApiCaseStep          `json:"testCase,omitempty" form:"testCase" gorm:"many2many:ApiCaseStepRelationship;"`
	Sort            uint                   `json:"sort,omitempty" form:"sort" gorm:"column:sort;"`
	ExportHeader    datatypes.JSON         `json:"export_header,omitempty" gorm:"column:export_header;comment:导出请求头到全局config;type:text"`
	ExportParameter datatypes.JSON         `json:"export_parameter,omitempty" gorm:"column:export_parameter;comment:导出参数到全局config;type:text"`
	Retry           uint                   `json:"retry" gorm:"comment:重试次数"`
	Skip            customType.TypeArgsMap `json:"skip,omitempty" form:"skip" gorm:"column:skip;comment:跳过执行;type:text"`

	Parent    uint    `json:"-"`
	ApiMenuID uint    `json:"-"`
	ApiMenu   ApiMenu `json:"-"`
}

ApiStep 结构体 如果含有time.Time 请自行import time包

type ApiStepRendezvous

type ApiStepRendezvous struct {
	global.GVA_MODEL
	Name    string  `json:"name,omitempty" yaml:"name"`                 // required
	Percent float32 `json:"percent,omitempty" yaml:"percent,omitempty"` // default to 1(100%)
	Number  int64   `json:"number,omitempty" yaml:"number,omitempty"`
	Timeout int64   `json:"timeout,omitempty" yaml:"timeout,omitempty"` // milliseconds
}

type ApiStepThinkTime

type ApiStepThinkTime struct {
	global.GVA_MODEL
	Time float64 `json:"time,omitempty" yaml:"time"`
}

type ApiStepTransaction

type ApiStepTransaction struct {
	global.GVA_MODEL
	Name string          `json:"name,omitempty" yaml:"name"`
	Type TransactionType `json:"type,omitempty" yaml:"type"`
}

type ApiStepType

type ApiStepType string
const (
	ApiStepTypeTransaction      ApiStepType = "Transaction"
	ApiStepTypeTransactionStart ApiStepType = "TransactionStart"
	ApiStepTypeTransactionEnd   ApiStepType = "TransactionEnd"
	ApiStepTypeRendezvous       ApiStepType = "Rendezvous"
)

type ApiTimerTask

type ApiTimerTask struct {
	global.GVA_MODEL
	Operator
	Name            string            `json:"name,omitempty" form:"name" gorm:"column:name;comment:任务名称;"`
	RunTime         string            `json:"runTime,omitempty" form:"runTime" gorm:"column:run_time;comment:运行时间cron;"`
	NextRunTime     *time.Time        `json:"nextRunTime,omitempty" form:"nextRunTime" gorm:"column:next_run_time;comment:下次运行时间;"`
	Status          *bool             `json:"status,omitempty" form:"status" gorm:"column:status;comment:运行状态;"`
	Describe        string            `json:"describe,omitempty" form:"describe" gorm:"column:describe;comment:备注;"`
	RunNumber       *int              `json:"runNumber,omitempty" form:"runNumber" gorm:"column:run_number;comment:运行次数;"`
	RunConfig       ApiConfig         `json:"config,omitempty" form:"config"`
	RunConfigID     uint              `json:"RunConfigID,omitempty" form:"RunConfigID" gorm:"comment:运行配置"`
	TestCase        []*ApiCase        `json:"TestCase,omitempty" form:"TestCase" gorm:"many2many:ApiTimerTaskRelationship;"`
	EntryID         int               `json:"-"`
	ApiTimerTaskTag []ApiTimerTaskTag `json:"apiTimerTaskTag,omitempty" form:"apiTimerTaskTag" gorm:"many2many:ApiTimerTaskTagRelationship;"`
	TagIds          []uint            `json:"tagIds" gorm:"-"`
	ApiEnvName      *string           `json:"api_env_name" gorm:"comment:所属环境名称;"`
	ApiEnvID        uint              `json:"api_env_id" gorm:"comment:所属环境;"`
	ApiMessageID    uint              `json:"api_message_id" gorm:"comment:消息发送;"`
	ApiMessage      *ApiMessage       `json:"-"`
}

ApiTimerTask 结构体 如果含有time.Time 请自行import time包

type ApiTimerTaskRelationship

type ApiTimerTaskRelationship struct {
	global.GVA_MODEL
	ApiTimerTask   ApiTimerTask
	ApiTimerTaskId uint `gorm:"comment:定时任务"`
	ApiCase        ApiCase
	ApiCaseId      uint `gorm:"comment:测试用例"`
	Sort           uint `gorm:"comment:排序"`
}

type ApiTimerTaskTag

type ApiTimerTaskTag struct {
	global.GVA_MODEL
	Operator
	ApiTimerTask []ApiTimerTask `json:"apiTimerTask,omitempty" form:"apiTimerTask" gorm:"many2many:ApiTimerTaskTagRelationship;"`
	Name         string         `json:"name"`
	Remarks      string         `json:"remarks"`
}

type ApiTimerTaskTagRelationship

type ApiTimerTaskTagRelationship struct {
	ApiTimerTask      ApiTimerTask
	ApiTimerTaskId    uint `gorm:"comment:定时任务"`
	ApiTimerTaskTag   ApiTimerTaskTag
	ApiTimerTaskTagId uint `gorm:"comment:定时任务标签"`
}

type ApiType

type ApiType int
const (
	ApiTypeTemplate        ApiType = 1 // 接口模板
	ApiTypeCase            ApiType = 2 // 接口测试用例
	ApiTypeCasePerformance ApiType = 3 // 性能测试用例
)

type ApiUserConfig

type ApiUserConfig struct {
	global.GVA_MODEL
	Operator
	ApiConfig   *ApiConfig `json:"api_config"`
	ApiConfigID *uint      `json:"api_config_id" gorm:"comment:接口配置ID"`
	ApiEnv      *ApiEnv    `json:"api_env"`
	ApiEnvID    *uint      `json:"api_env_id"`
	UserID      uint       `json:"-" gorm:"comment:用户ID"`
}

type CaseType

type CaseType int

type FileType

type FileType uint
const (
	FileDebugTalk           FileType = 1
	FileDebugTalkDefault    FileType = 10
	FileDebugTalkGen        FileType = 2
	FileDebugTalkGenDefault FileType = 20
)

type GrpcType

type GrpcType string
const (
	GrpcTypeSimple              GrpcType = "Simple"
	GrpcTypeServerSideStream    GrpcType = "ServerSideStream"
	GrpcTypeClientSideStream    GrpcType = "ClientSideStream"
	GrpcTypeBidirectionalStream GrpcType = "BidirectionalStream"
)

type HrpCase

type HrpCase struct {
	ID        uint
	Name      string
	Confing   ApiConfig     `json:"config,omitempty" form:"config"`
	TestSteps []interface{} `json:"teststeps,omitempty" yaml:"teststeps,omitempty"`
}

type HrpCaseStep

type HrpCaseStep struct {
	ID          uint
	Name        string
	TestCase    interface{}         `json:"testcase,omitempty" yaml:"testcase,omitempty"`
	Transaction *ApiStepTransaction `json:"transaction,omitempty" yaml:"transaction,omitempty;comment:事务"`
	Rendezvous  *ApiStepRendezvous  `json:"rendezvous,omitempty" yaml:"rendezvous,omitempty;comment:集合点"`
	ThinkTime   *ApiStepThinkTime   `json:"think_time,omitempty" yaml:"think_time,omitempty;comment:思考时间"`
	Len         int
}

type HrpPyPkg

type HrpPyPkg struct {
	global.GVA_MODEL
	Name        string `json:"name,omitempty" form:"name" gorm:"uniqueIndex:idx_name"`
	Version     string `json:"version,omitempty" form:"version" gorm:"column:version;comment:;"`
	IsUninstall *bool  `json:"isUninstall,omitempty" form:"isUninstall" gorm:"column:is_uninstall;comment:;"`
}

func (HrpPyPkg) TableName

func (HrpPyPkg) TableName() string

type HrpTestCase

type HrpTestCase struct {
	ID        uint
	Name      string
	Confing   ApiConfig  `json:"config,omitempty" form:"config"`
	TestSteps []*ApiStep `json:"teststeps,omitempty" yaml:"teststeps,omitempty"`
}
type MenuType int

type MessageType

type MessageType string
const MessageTypeDingtalk MessageType = "dingtalk"
const MessageTypeDingtalkText MessageType = "dingtalk_text"
const MessageTypeFeishu MessageType = "feishu"
const MessageTypeWechat MessageType = "wechat"
const MessageTypeWechatText MessageType = "wechat_text"

type Operator

type Operator struct {
	CreatedBy *uint `json:"CreatedBy,omitempty" gorm:"column:created_by_id;comment:创建者"`
	UpdateBy  *uint `json:"UpdateBy,omitempty" gorm:"column:update_by_id;comment:更新者"`
	DeleteBy  *uint `json:"DeleteBy,omitempty" gorm:"column:delete_by_id;comment:删除者"`

	Project   system.Project `json:"-"`
	ProjectID uint           `json:"project_id,omitempty"`
}

type Performance

type Performance struct {
	global.GVA_MODEL
	Operator
	Name        string     `json:"name,omitempty" form:"name" gorm:"column:name;comment:性能任务名称;"`
	State       State      `json:"status,omitempty" form:"status" gorm:"column:status;comment:状态;"`
	Describe    string     `json:"describe,omitempty" form:"describe" gorm:"column:describe;comment:备注;"`
	RunConfig   *ApiConfig `json:"config,omitempty" form:"config"`
	RunConfigID uint       `json:"RunConfigID,omitempty" form:"RunConfigID" gorm:"column:RunConfigID;comment:运行配置;"`

	FrontCase           *bool              `json:"front_case,omitempty" form:"front_case"`
	EntryID             int                `json:"-"`
	ApiMenuID           uint               `json:"-" gorm:"comment:所属菜单"`
	PerformanceReport   *PerformanceReport `json:"Report"`
	PerformanceReportId uint               `json:"report_id"`
	ApiEnvName          *string            `json:"api_env_name" gorm:"comment:所属环境名称;"`
	ApiEnvID            uint               `json:"api_env_id" gorm:"comment:所属环境;"`
}

type PerformanceRelationship

type PerformanceRelationship struct {
	global.GVA_MODEL
	Performance   *Performance
	PerformanceId uint `json:"PerformanceId" gorm:"comment:性能任务"`
	//ApiCase       *ApiCase
	//ApiCaseId     uint `gorm:"comment:测试用例"`
	ApiCaseStep   *ApiCaseStep
	ApiCaseStepId uint `json:"ApiCaseStepId" gorm:"comment:测试步骤"`
	Sort          uint `gorm:"comment:排序"`
}

type PerformanceReport

type PerformanceReport struct {
	global.GVA_MODEL
	Name                    string                    `json:"name"`
	State                   State                     `json:"state"`
	PerformanceReportDetail []PerformanceReportDetail `json:"performance_report_detail"`
	PerformanceID           uint                      `json:"performance_id"`
	ProjectID               uint                      `json:"-"`
	Project                 system.Project            `json:"-"`
	TotalStats              datatypes.JSONMap         `json:"stats_total" gorm:"column:stats_total;comment:;type:text"`
	TotalAvgResponseTime    float64                   `json:"total_avg_response_time"`
	TotalMinResponseTime    float64                   `json:"total_min_response_time"`
	TotalMaxResponseTime    float64                   `json:"total_max_response_time"`
	TotalRPS                float64                   `json:"total_rps"`
	TotalFailRatio          float64                   `json:"total_fail_ratio"`
	TotalFailPerSec         float64                   `json:"total_fail_per_sec"`
	UserCount               int64                     `json:"user_count"`
}

type PerformanceReportDetail

type PerformanceReportDetail struct {
	global.GVA_MODEL
	UserCount            int64             `json:"user_count"`
	State                State             `json:"state"`
	TotalStats           datatypes.JSONMap `json:"stats_total" gorm:"column:stats_total;comment:;type:text"`
	TransactionsPassed   int64             `json:"transactions_passed"`
	TransactionsFailed   int64             `json:"transactions_failed"`
	TotalAvgResponseTime float64           `json:"total_avg_response_time"`
	TotalMinResponseTime float64           `json:"total_min_response_time"`
	TotalMaxResponseTime float64           `json:"total_max_response_time"`
	TotalRPS             float64           `json:"total_rps"`
	TotalFailRatio       float64           `json:"total_fail_ratio"`
	TotalFailPerSec      float64           `json:"total_fail_per_sec"`
	Duration             float64           `json:"duration"`
	Errors               datatypes.JSON    `json:"errors" gorm:"column:errors;comment:;type:text"`
	PerformanceReportID  uint

	PerformanceReportTotalStats []PerformanceReportTotalStats `json:"stats"`
}

type PerformanceReportMaster

type PerformanceReportMaster struct {
	global.GVA_MODEL
	State               int32 `json:"State"`
	Workers             int32 `json:"workers"`
	TargetUsers         int64 `json:"target_users"`
	CurrentUsers        int32 `json:"current_users"`
	PerformanceReportID uint  `json:"performance_report_id"`
}

type PerformanceReportTotalStats

type PerformanceReportTotalStats struct {
	global.GVA_MODEL
	Name                      string  `json:"name"`
	Method                    string  `json:"method"`
	StartTime                 int64   `json:"start_time"`
	NumFailures               int     `json:"num_failures"`
	NumRequests               int     `json:"num_requests"`
	MaxResponseTime           int     `json:"max_response_time"`
	MinResponseTime           int     `json:"min_response_time"`
	NumNoneRequests           int     `json:"num_none_requests"`
	TotalResponseTime         int     `json:"total_response_time"`
	TotalContentLength        int     `json:"total_content_length"`
	LastRequestTimestamp      int64   `json:"last_request_timestamp"`
	CurrentRps                float64 `json:"current_rps"`
	CurrentFailPerSec         float64 `json:"current_fail_per_sec"`
	PerformanceReportDetailID uint

	ResponseTimer datatypes.JSONMap `json:"response_timer"`
}

type PerformanceReportWork

type PerformanceReportWork struct {
	global.GVA_MODEL
	WorkID                    string  `json:"work_id"`
	IP                        string  `json:"ip"`
	OS                        string  `json:"os"`
	Arch                      string  `json:"arch"`
	State                     int32   `json:"state"`
	Heartbeat                 int32   `json:"heartbeat"`
	UserCount                 int64   `json:"user_count"`
	WorkerCpuUsage            float64 `json:"worker_cpu_usage"`
	CpuUsage                  float64 `json:"cpu_usage"`
	CpuWarningEmitted         bool    `json:"cpu_warning_emitted"`
	WorkerMemoryUsage         float64 `json:"worker_memory_usage"`
	MemoryUsage               float64 `json:"memory_usage"`
	PerformanceReportWorkerID uint    `json:"performance_report_id"`
}

type PerformanceReportWorker

type PerformanceReportWorker struct {
	global.GVA_MODEL
	PerformanceReportID   uint                    `json:"performance_report_id"`
	PerformanceReportWork []PerformanceReportWork `json:"performance_report_work"`
}

type RunType

type RunType int

type State

type State int
const (
	StateInit     State = iota + 1 // initializing
	StateSpawning                  // spawning
	StateRunning                   // running
	StateStopping                  // stopping
	StateStopped                   // stopped
	StateQuitting                  // quitting
	StateMissing                   // missing
	StateError                     // 运行报错
)

type TransactionType

type TransactionType string
const (
	TransactionStart TransactionType = "start"
	TransactionEnd   TransactionType = "end"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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