models

package
v0.0.0-...-c48d56e Latest Latest
Warning

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

Go to latest
Published: May 3, 2022 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdvanceConfig

type AdvanceConfig struct {
	// IsRecursionDiff 递归diff json模式
	IsRecursionDiff bool `json:"is_recursion_diff" bson:"is_recursion_diff"`
	// IsIgnoreArraySequence 忽略json数组类型的顺序
	// 如: [1, 2] == [2, 1]
	IsIgnoreArraySequence bool `json:"is_ignore_array_sequence" bson:"is_ignore_array_sequence"`
}

type FilterConfig

type FilterConfig struct {
	// HttpPathRegexFilter 正则过滤Http请求路径
	HttpPathRegexFilter []string `json:"http_path_regex_filter,omitempty" bson:"http_path_regex_filter"`
}

type Record

type Record struct {
	TaskID  int64  `json:"task_id"`
	OldReq  []byte `json:"old_req"`
	OldResp []byte `json:"old_resp"`
	NewResp []byte `json:"new_resp"`
	// Diff 差异比对结果,形式为EBNF表达式。
	Diff string `json:"diff,omitempty"`
	// DiffRate 差异比对率,基于Levenshtein算法给出。
	DiffRate float64 `json:"diff_rate"`
}

type RecordMeta

type RecordMeta struct {
	CosKey   string `json:"cos_key"`
	Path     string `json:"path"`
	DiffRate string `json:"diff_rate"`
}

type Task

type Task struct {
	// ID 任务id
	ID int64 `json:"id" bson:"id"`
	// Name 任务名称 全局唯一
	Name string `json:"name" bson:"name"`
	// Description 任务描述
	Description string `json:"description" bson:"description"`
	// Owner 任务负责人 todo:可以有多个负责人
	Owner User `json:"owner" bson:"owner"`
	// IsRunning Diff任务运行状态
	IsRunning bool `json:"is_running" bson:"is_running"`

	TrafficConfig *TrafficConfig `json:"traffic_config" bson:"traffic_config"`
	FilterConfig  *FilterConfig  `json:"filter_config" bson:"filter_config"`
	AdvanceConfig *AdvanceConfig `json:"advance_config" bson:"advance_config"`

	// TotalRecord 流量回放的流量数
	TotalRecord int64 `json:"total_record" bson:"total_record"`
	// SuccessRecord 成功回放的流量数
	SuccessRecord int64 `json:"success_record" bson:"success_record"`
	// CreatedTime 任务创建时间
	CreatedTime string `json:"created_time" bson:"created_time"`
	// UpdatedTime 配置最后变更时间
	UpdatedTime string `json:"updated_time" bson:"updated_time"`
}

Task diff任务结构体

type TrafficConfig

type TrafficConfig struct {
	// Device 基准服务实例监听网卡
	Device string `json:"device" bson:"device"`
	// Port 基准服务实例监听端口
	Port uint16 `json:"port" bson:"port"`
	// Addr 被测服务地址
	Addr string `json:"addr" bson:"addr"`
	// OnlineAddr 线上服务实例地址
	OnlineAddr string `json:"online_addr"`
}

type User

type User struct {
	// ID GitHub账户id
	ID int `json:"id" bson:"id"`
	// Login GitHub账户名称
	Login string `json:"login" bson:"login"`
	// AvatarUrl 头像图片url
	AvatarUrl string `json:"avatar_url" bson:"avatar_url"`
	// Email GitHub账户邮箱
	Email string `json:"email" bson:"email"`
}

User 用户信息数据结构体

Jump to

Keyboard shortcuts

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