view

package
v0.5.9 Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: Apache-2.0 Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// ConfigFormatToml ..
	ConfigFormatToml = "toml"
	// ConfigFormatYaml ..
	ConfigFormatYaml = "yaml"
	// INI格式
	ConfigFormatINI = "ini"

	// ConfigureUsedType ..
	ConfigureUsedTypeSupervisor = 1
	ConfigureUsedTypeSystemd    = 2
)
View Source
const (
	VersionSettingName      string = "version"
	ConfigDepSettingName    string = "config_dep"
	EtcdSettingName         string = "etcd"
	GrafanaSettingName      string = "grafana"
	GatewaySettingName      string = "gateway"
	K8SClusterSettingName   string = "k8s_cluster"
	TestPlatformSettingName string = "test_platform"
)

Variables

View Source
var (
	// ConfigFormats Verified list
	ConfigFormats = []ConfigFormat{ConfigFormatToml, ConfigFormatYaml, ConfigFormatINI}
)
View Source
var (
	// todo can't global config
	// 对各项配置进行设置,设置项写到此处才能生效
	SettingFieldConfigs = map[string]SettingFieldConfig{
		VersionSettingName: {
			Default: `[]`,
			Validate: func(value string) error {
				return nil
			},
		},
		EtcdSettingName: {
			Default: `[]`,
			Validate: func(value string) error {
				return nil
			},
		},
		GrafanaSettingName: {
			Default: `{"host":"","header_name":"",scheme:""}`,
			Validate: func(value string) error {
				setting := SettingGrafana{}
				err := json.Unmarshal([]byte(value), &setting)
				if err != nil {
					return err
				}

				scheme := strings.ToLower(setting.Scheme)
				if scheme != "http" && scheme != "https" {
					return fmt.Errorf("无效的协议: %s", scheme)
				}

				return nil
			},
		},
		ConfigDepSettingName: {
			Default: `{"interval":720}`,
			Validate: func(value string) error {
				return nil
			},
		},
		GatewaySettingName: {
			Default: "[]",
			Validate: func(value string) error {
				field := SettingGateway{}
				err := json.Unmarshal([]byte(value), &field)
				if err != nil {
					return err
				}

				settingMap := make(map[string]SettingGatewayItem)
				for _, item := range field {
					if _, ok := settingMap[item.Domain]; ok {

						return fmt.Errorf("域名 %s 存在重复配置", item.Domain)
					}

					settingMap[item.Domain] = item
				}

				return nil
			},
		},
		K8SClusterSettingName: {
			Default: "{\"list\":[]}",
			Validate: func(value string) error {
				data := SettingK8SCluster{}
				err := json.Unmarshal([]byte(value), &data)
				if err != nil {
					return err
				}

				err = validator.New().Struct(&data)
				if err != nil {
					return err
				}

				return nil
			},
		},
		TestPlatformSettingName: {
			Default: "{\"enable\":false}",
			Validate: func(value string) error {
				data := SettingTestPlatform{}

				err := json.Unmarshal([]byte(value), &data)
				if err != nil {
					return err
				}

				err = validator.New().Struct(&data)
				if err != nil {
					return err
				}

				return nil
			},
		},
	}
)
View Source
var (
	TabNameMap = map[string]string{
		"detail":  "详情",
		"monitor": "监控",
		"confgo":  "配置",
		"applog":  "日志",
		"pprof":   "Pprof",
		"etcd":    "Etcd",
		"event":   "事件",
	}
)

Functions

func CheckConfigFormat added in v0.2.0

func CheckConfigFormat(format ConfigFormat) bool

CheckConfigFormat 检查配置文件格式是否符合要求

func CheckSettingNameValid added in v0.2.0

func CheckSettingNameValid(settingName string) bool

Types

type APIListItem added in v0.2.0

type APIListItem struct {
	Path   string `json:"path"`
	Method string `json:"method"`
}

type APIPermItem added in v0.2.0

type APIPermItem struct {
	Method string `json:"method"`
	Path   string `json:"path"`
}

type AccessTokenItem added in v0.2.0

type AccessTokenItem struct {
	Name      string `json:"name"`
	AppID     string `json:"app_id"`
	AppSecret string `json:"app_secret"`
}

type AppAction added in v0.3.0

type AppAction struct {
	Action   string `json:"action" query:"action"`
	AppName  string `json:"app_name" query:"app_name"`
	NodeName string `json:"node_name" query:"node_name"`
	Typ      uint   `json:"typ" query:"typ"`
}

type AppListWithEnvItem added in v0.2.0

type AppListWithEnvItem struct {
	db.AppInfo
	Envs []string `json:"envs"`
}

type AppPermItem added in v0.2.0

type AppPermItem struct {
	Aid           int      `json:"aid"`
	AppName       string   `json:"app_name"`
	AvailableEnvs []string `json:"available_envs"` // 可选的环境
	AllowEnvs     []string `json:"allow_envs"`     // 可用的环境
}

type AppTabVisit added in v0.4.3

type AppTabVisit struct {
	Aid      uint32 `json:"aid"`
	AppName  string `json:"app_name"`
	VisitSum int    `json:"visit_sum"`
}

type BatchCheckResourceVersionItem added in v0.2.0

type BatchCheckResourceVersionItem struct {
	Name          string    `json:"name"`
	Value         string    `json:"value"`
	Version       uint      `json:"version"`
	LatestVersion uint      `json:"latest_version"`
	UpdatedAt     time.Time `json:"updated_at"`
}

type ClusterConfigInfo added in v0.4.3

type ClusterConfigInfo struct {
	Doc            string    `json:"doc"`
	SyncStatus     string    `json:"sync_status"`
	ChangeLog      string    `json:"change_log"`
	Version        string    `json:"version"` // 发布到Juno Proxy的版本号
	CreatedAt      time.Time `gorm:"column:created_at" json:"created_at"`
	ConfigFilePath string    `json:"config_file_path"`
}

ClusterConfigInfo ..

type ClusterInfo added in v0.4.3

type ClusterInfo struct {
	Name     string   `json:"name"`
	Env      []string `json:"env"`
	ZoneCode string   `json:"zone_code"`
	ZoneName string   `json:"zone_name"`
}

ClusterInfo ..

type ClusterList added in v0.4.3

type ClusterList struct {
	List []ClusterInfo `json:"list"`
}

ClusterList ..

type CmcCnt added in v0.3.0

type CmcCnt struct {
	DayTime string `json:"day_time" gorm:"day_time"`
	Cnt     int    `gorm:"cnt" json:"cnt"`
}

CmcCnt ..

type ConfigFormat added in v0.2.0

type ConfigFormat string

ConfigFormat ..

type ConfigResourceVersion added in v0.2.0

type ConfigResourceVersion struct {
	Version   uint      `json:"version"`
	CreatedAt time.Time `json:"created_at"`
}

type ConfigurationPublishData added in v0.2.0

type ConfigurationPublishData struct {
	Content  string   `json:"content"`
	Metadata Metadata `json:"metadata"`
}

ConfigurationPublishData ..

type ConfigurationStatus added in v0.2.0

type ConfigurationStatus struct {
	// etcd store data
	FileName   string `json:"file_name"`
	Version    string `json:"md5"`
	Hostname   string `json:"hostname"`
	Env        string `json:"env"`
	Timestamp  int64  `json:"timestamp"`
	IP         string `json:"ip"`
	HealthPort string `json:"health_port"`

	// attach key
	ZoneCode      string `json:"zone_code"`
	EffectVersion string `json:"effect_version"`
}

ConfigurationStatus ..

type CreateHttpTestCase added in v0.3.0

type CreateHttpTestCase struct {
	Name         string           `json:"name" valid:"required"`
	CollectionID uint             `json:"collection_id" valid:"required"`
	URL          string           `json:"url"`
	Method       string           `json:"method"`
	Query        db.HttpTestParam `json:"query"`
	Headers      db.HttpTestParam `json:"headers"`
	ContentType  string           `json:"content_type"`
	Body         string           `json:"body"`
}

type CreateHttpTestCollection added in v0.3.0

type CreateHttpTestCollection struct {
	AppName string `json:"app_name" validate:"required"`
	Name    string `json:"name" validate:"required"`
}

type CronJob added in v0.4.0

type CronJob struct {
	ID            uint           `json:"id"`
	Name          string         `json:"name"`
	Username      string         `json:"username"`
	AppName       string         `json:"app_name"`
	Env           string         `json:"env"`
	Zone          string         `json:"zone"`
	Timeout       uint           `json:"timeout"`
	RetryCount    uint           `json:"retry_count"`
	RetryInterval uint           `json:"retry_interval"`
	Script        string         `json:"script"`
	Enable        bool           `json:"enable"`
	JobType       db.CronJobType `json:"job_type"`
	Timers        []CronJobTimer `json:"timers"`
	Nodes         []string       `json:"nodes"`
}

task platform struct 需要执行的 cron cmd 命令 注册到 /cronsun/cmd/groupName/<id>

type CronJobListItem added in v0.4.0

type CronJobListItem struct {
	CronJob

	Status         *db.CronTaskStatus `json:"status"`
	LastExecutedAt *time.Time         `json:"last_executed_at"`
}

task platform struct 需要执行的 cron cmd 命令 注册到 /cronsun/cmd/groupName/<id>

type CronJobTimer added in v0.4.0

type CronJobTimer struct {
	ID    uint   `json:"id"`
	JobID uint   `json:"job_id"`
	Cron  string `json:"cron"`
}

task platform struct 需要执行的 cron cmd 命令 注册到 /cronsun/cmd/groupName/<id>

type CronTask added in v0.4.0

type CronTask struct {
	ID          string            `json:"id"`
	JobID       uint              `json:"job_id"`
	ExecutedAt  *time.Time        `json:"executed_at"`
	FinishedAt  *time.Time        `json:"finished_at"`
	RetryCount  uint              `json:"retry_count"`
	Status      db.CronTaskStatus `json:"status"`
	Node        string            `json:"node"`
	ExecuteType int               `json:"execute_type"`
}

task platform struct 需要执行的 cron cmd 命令 注册到 /cronsun/cmd/groupName/<id>

type CronTaskDetail added in v0.4.0

type CronTaskDetail struct {
	CronTask

	Log    string `json:"log"`
	Script string `json:"script"`
}

task platform struct 需要执行的 cron cmd 命令 注册到 /cronsun/cmd/groupName/<id>

type DiffUrlList added in v0.4.3

type DiffUrlList struct {
	Name    string `json:"name" query:"name"`       // 配置文件名称
	DiffUrl string `json:"diffUrl" query:"diffUrl"` // diff链接地址
}

type EnvStatic added in v0.3.0

type EnvStatic struct {
	Env string `json:"env"`
	Cnt int    `json:"cnt"`
}

EnvStatic ..

type EtcdInfo

type EtcdInfo struct {
	Key            string `json:"key"`
	CreateRevision int    `json:"createRevision"`
	ModRevision    int    `json:"modRevision"`
	Version        int    `json:"version"`
	Value          []byte `json:"value"`
}

type GovernIdcStatus

type GovernIdcStatus struct {
	ZoneCode string `json:"zone_code"`
	Status   string `json:"status"`
	Message  string `json:"message"`
}

type GovernServerStats

type GovernServerStats struct {
	IP       string      `json:"ip"`
	Hostname string      `json:"hostname"`
	Time     string      `json:"time"` // 每次展示数据的时间
	Err      string      `json:"err"`
	Servers  interface{} `json:"servers"`
}

type GrpcHistoryItem added in v0.3.0

type GrpcHistoryItem struct {
	ID          uint             `json:"id"`
	MethodID    uint             `json:"method_id"`
	AppName     string           `json:"app_name"`
	ServiceName string           `json:"service_name"`
	MethodName  string           `json:"method_name"`
	Input       string           `json:"input"`
	Metadata    db.ProtoMetadata `json:"metadata"`
	Output      string           `json:"output"`
	Status      string           `json:"status"`
	Error       string           `json:"error"`
	TimeCost    int64            `json:"time_cost"`
	Addr        string           `json:"addr"`
	TestPassed  bool             `json:"test_passed"`
	CreatedAt   time.Time        `json:"created_at"`
}

type GrpcHistoryListItem added in v0.3.0

type GrpcHistoryListItem struct {
	ID         uint      `json:"id"`
	MethodID   uint      `json:"method_id"`
	MethodName string    `json:"method_name"`
	Status     string    `json:"status"`
	Error      string    `json:"error"`
	TimeCost   int64     `json:"time_cost"`
	TestPassed bool      `json:"test_passed"`
	CreatedAt  time.Time `json:"created_at"`
}

type GrpcMethodItem added in v0.3.0

type GrpcMethodItem struct {
	ID          uint   `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

type GrpcResponse added in v0.3.0

type GrpcResponse struct {
	Error      string             `json:"error"`
	Status     string             `json:"status"`
	TimeCost   int64              `json:"time_cost"`
	Output     string             `json:"output"`
	Logs       db.MapStringString `json:"logs"`
	TestPassed bool               `json:"test_passed"`
}

type GrpcTestCase added in v0.4.0

type GrpcTestCase struct {
	grpctester.RequestPayload
	MethodDescriptor json.RawMessage `json:"method_descriptor"`
}

type GrpcUseCaseDetail added in v0.3.0

type GrpcUseCaseDetail struct {
	ID          uint             `json:"id"`
	MethodID    uint             `json:"method_id"`
	Uid         uint             `json:"uid"`
	Name        string           `json:"name"`
	Input       string           `json:"input"`
	Metadata    db.ProtoMetadata `json:"metadata"`
	AppName     string           `json:"app_name"`
	ServiceName string           `json:"service_name"`
	MethodName  string           `json:"method_name"`
	Script      string           `json:"script"`
}

type GrpcUseCaseItem added in v0.3.0

type GrpcUseCaseItem struct {
	ID       uint             `json:"id"`
	Name     string           `json:"name"`
	Input    string           `json:"input"`
	Metadata db.ProtoMetadata `json:"metadata"`
}

type HttTestLogListItem added in v0.3.0

type HttTestLogListItem struct {
	ID           uint   `json:"id"`
	OperatorType string `json:"operator_type"` // 执行人类型
	OperatorID   uint   `json:"operator_id"`   // 执行人ID

	Name string `json:"name"`

	// Request
	URL    string `json:"url"`
	Method string `json:"method"`

	// Response
	Size int64 `json:"size"`
	Cost int64 `json:"cost"`
	Code int   `json:"code"`
}

列表项,移除大字段和列表展示不需要的字段

type HttpCollectionTestLog added in v0.4.0

type HttpCollectionTestLog struct {
	TestID   uint              `json:"test_id"`
	TestName string            `json:"test_case_name"`
	Action   string            `json:"action"` // output, fail, pass
	Output   *string           `json:"output,omitempty"`
	Result   *xtest.TestResult `json:"result,omitempty"`
}

type HttpTestCase added in v0.3.0

type HttpTestCase struct {
	ID          uint             `json:"id" validate:"required"`
	Name        string           `json:"name"`
	URL         string           `json:"url"`
	Method      string           `json:"method"`
	Query       db.HttpTestParam `json:"query"`
	Headers     db.HttpTestParam `json:"headers"`
	ContentType string           `json:"content_type"`
	Body        string           `json:"body"`
	Script      string           `json:"script"`
}

type HttpTestCollection added in v0.3.0

type HttpTestCollection struct {
	ID        uint           `json:"id"`
	AppName   string         `json:"app_name"`
	Name      string         `json:"name"`
	CreatedAt time.Time      `json:"created_at"`
	TestCases []HttpTestCase `json:"test_cases"`
}

type HttpTestLog added in v0.3.0

type HttpTestLog struct {
	OperatorType string `json:"operator_type"` // 执行人类型
	OperatorID   uint   `json:"operator_id"`   // 执行人ID

	Name string `json:"name"`

	// Request
	URL         string           `json:"url"`
	Method      string           `json:"method"`
	Query       db.HttpTestParam `json:"query"`
	Headers     db.HttpTestParam `json:"headers"`
	ContentType string           `json:"content_type"`
	Body        string           `json:"body"`

	// Response
	ResponseBody    string            `json:"response_body"`
	ResponseHeaders db.MapStringArray `json:"response_headers"`
	Size            int64             `json:"size"`
	Cost            int64             `json:"cost"`
	Code            int               `json:"code"`
}

type HttpTestResponse added in v0.3.0

type HttpTestResponse struct {
	Code     int                 `json:"code"`
	Body     string              `json:"body"`
	Headers  map[string][]string `json:"headers"`
	Size     int64               `json:"size"`
	TimeCost int64               `json:"time_cost"`
	Success  bool                `json:"success"`
	Logs     db.MapStringString  `json:"logs"`
	Error    string              `json:"error"`
}

type JobRule added in v0.4.0

type JobRule struct {
	ID             string   `json:"id"`
	Timer          string   `json:"timer"`
	GroupIDs       []string `json:"gids"`
	NodeIDs        []string `json:"nids"`
	ExcludeNodeIDs []string `json:"exclude_nids"`

	Schedule cron.Schedule `json:"-"`
}

task platform struct 需要执行的 cron cmd 命令 注册到 /cronsun/cmd/groupName/<id>

type JunoAgent added in v0.2.0

type JunoAgent struct {
	HostName string `json:"host_name"`
	IPPort   string `json:"ip"`
}

JunoAgent ..

type K8sConfig added in v0.4.3

type K8sConfig struct {
	ZoneCode string
	Domain   string
	Token    string
}

K8sConfig k8s config

type ListGroupItem added in v0.2.0

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

type ListGrpcProtoItem added in v0.3.0

type ListGrpcProtoItem struct {
	ID          uint   `json:"id"`
	AppName     string `json:"app_name"`
	FileName    string `json:"file_name"`
	PackageName string `json:"package_name"`
}

type ListHttpCollection added in v0.3.0

type ListHttpCollection struct {
	AppName  string `query:"app_name" validate:"required"`
	Page     int    `query:"page"`
	PageSize int    `query:"page_size"`
}

type ListUserItem added in v0.2.0

type ListUserItem struct {
	UID      uint     `json:"uid"`
	UserName string   `json:"user_name"`
	NickName string   `json:"nick_name"`
	Access   string   `json:"access"`
	Groups   []string `json:"groups"`
}

type MakeGrpcRequest added in v0.3.0

type MakeGrpcRequest struct {
	MethodID uint             `json:"method_id"`
	Input    string           `json:"input"`
	Address  string           `json:"address"`
	Metadata db.ProtoMetadata `json:"metadata"`
	Script   string           `json:"script"`
}
type MenuTree []MenuTreeItem
type MenuTreeItem struct {
	Name     string   `json:"name"`
	Path     string   `json:"path"`
	Icon     string   `json:"icon"`
	Children MenuTree `json:"children"`
}

type Metadata added in v0.2.0

type Metadata struct {
	Timestamp int64    `json:"timestamp"`
	Version   string   `json:"version"`
	Format    string   `json:"format"`
	Paths     []string `json:"paths"`
}

Metadata ..

type Pagination

type Pagination struct {
	Current  int   `json:"current"`
	Total    int64 `json:"total"`
	PageSize int   `json:"pageSize"`
}

响应

func NewPagination

func NewPagination(current int, pageSize int) *Pagination

type PodList added in v0.4.3

type PodList struct {
	Items []*v1.Pod `json:"items"`
}

PodList ..

type QueryHttpTestCollection added in v0.3.0

type QueryHttpTestCollection struct {
	CollectionID uint `query:"collection_id" json:"collection_id" validate:"required"`
}

type QueryHttpTestUseCase added in v0.3.0

type QueryHttpTestUseCase struct {
	UseCaseID uint `query:"id" json:"id" validate:"required"`
}

type RelationApps

type RelationApps struct {
	AppName    string `json:"appName"`
	Name       string `json:"name"`
	Type       string `json:"type"`
	Addr       string `json:"addr"`
	UpdateTime int64  `json:"update_time"`
	Info       string `json:"info"`
}

type ReportInfo

type ReportInfo struct {
	Id         int     `json:"id"`
	Aid        int     `json:"aid"`
	AppName    string  `json:"appName" gorm:"column:app_name"`
	Normalized float64 `json:"normalized"`
	Warn       int     `json:"warn"`
	Dpainc     int     `json:"dpainc" gorm:"column:dpainc"`
	Error      int     `json:"error"`
	Merror     int     `json:"merror" gorm:"column:merror"`
	Fatal      int     `json:"fatal"`
	Person     string  `json:"person" gorm:"column:users"`
	Timestamp  int     `json:"timestamp" gorm:"column:timestamp"`
}

type ReqAddEtcd

type ReqAddEtcd struct {
	Prefix      string `json:"prefix"`
	AppName     string `json:"appName"`
	ServiceName string `json:"serviceName"`
	Suffix      string `json:"suffix"`
	ZoneCode    string `json:"zone_code"`
	Env         string `json:"env"`
	DataSource  string `json:"dataSource"`
	Value       string `json:"value"`
}

type ReqAliyunLogDefault added in v0.4.0

type ReqAliyunLogDefault struct {
	Env     string `query:"env" json:"env" valid:"required"`
	Query   string `query:"query" json:"query" valid:"required"`
	Typ     string `query:"typ" json:"typ" valid:"required"`
	AppName string `query:"app_name"  json:"app_name" valid:"required"`
	Aid     string `query:"aid" json:"aid" valid:"required"`
}

ReqAliyunLogDefault env, query, typ, appNam

type ReqAppAction added in v0.3.0

type ReqAppAction struct {
	Action   string `json:"action" query:"action" validate:"required"`
	Typ      uint   `json:"typ" query:"typ" validate:"required"`
	NodeName string `json:"node_name" query:"node_name" validate:"required"`
	AppName  string `json:"app_name" query:"app_name" validate:"required"`
	ZoneCode string `json:"zone_code" query:"zone_code" validate:"required"`
	Env      string `json:"env" query:"env" validate:"required"`
}

type ReqAppList

type ReqAppList struct {
	CurrentPage int    `json:"currentPage" form:"currentPage"` // 项目名称
	ShowNum     int    `json:"showNum"  form:"showNum"`        // gitlab项目ID
	Lang        string `json:"lang" form:"lang"`               // filter by lang
	Qs          string `json:"qs" form:"qs"`                   // 模糊搜索
	Sort        string `json:"sort" form:"sort"`               // 模糊搜索
}

ReqAppList ...

type ReqAppListWithEnv added in v0.2.0

type ReqAppListWithEnv struct {
	SearchText string `query:"searchText"`
	Page       int    `query:"page"`
	PageSize   int    `query:"pageSize"`
}

type ReqAppSearch

type ReqAppSearch struct {
	Repos string `json:"repos" form:"repos"`
	Stats string `json:"stats" form:"stats"`
	Q     string `json:"q" form:"q"`
	Files string `json:"files" form:"files"`
	I     string `json:"i" form:"i"`
	Ctx   string `json:"ctx" form:"ctx"`
}

ReqAppSearch ...

type ReqBatchCheckResourceVersion added in v0.2.0

type ReqBatchCheckResourceVersion []struct {
	Name    string `json:"name"`
	Version uint   `json:"version"`
	Zone    string `json:"zone"` // zone code
	Env     string `json:"env"`
}

type ReqBindProtoToApp added in v0.3.0

type ReqBindProtoToApp struct {
	ProtoID uint   `json:"proto_id" validate:"required"` // PB 文件路径
	AppName string `json:"app_name" validate:"required"`
}

type ReqChangeAppGroup added in v0.2.0

type ReqChangeAppGroup struct {
	AppName   string `json:"app_name"`
	AppEnv    string `json:"app_env"`
	GroupName string `json:"group_name"`
}

type ReqChangeUserGroup added in v0.2.0

type ReqChangeUserGroup struct {
	UID    uint     `json:"uid"`
	Groups []string `json:"groups"`
}

type ReqConfigInstanceList added in v0.2.0

type ReqConfigInstanceList struct {
	ConfigurationID uint   `json:"id" query:"id" validate:"required"`
	Env             string `json:"env" query:"env" validate:"required"`
	ZoneCode        string `json:"zone_code" query:"zone_code" validate:"required"`
}

type ReqConfigPublish added in v0.2.0

type ReqConfigPublish struct {
	AppName      string   `json:"app_name"`
	ZoneCode     string   `json:"zone_code"`
	Port         string   `json:"port"`
	FileName     string   `json:"file_name"`
	Format       string   `json:"format"`
	Content      string   `json:"content"`
	InstanceList []string `json:"instance_list"`
	Env          string   `json:"env"`
	Version      string   `json:"version"`
	PubK8S       bool     `json:"pub_k8s"`
}

ReqConfigPublish configuration publish request struct

type ReqConfiguratorsPut added in v0.4.3

type ReqConfiguratorsPut struct {
	IdcCode string `json:"idcCode"`
	Env     string `json:"env"`
	AppName string `json:"appName"`
	RegKey  string `json:"regKey"`
	Enable  string `json:"enable"`
	Weight  string `json:"weight"`
	Group   string `json:"group"`
}

type ReqCreateAccessToken added in v0.2.0

type ReqCreateAccessToken struct {
	Name string `json:"name" valid:"required"`
}

type ReqCreateConfig added in v0.2.0

type ReqCreateConfig struct {
	AppName  string       `json:"app_name" validate:"required"`
	Env      string       `json:"env" validate:"required"`
	Zone     string       `json:"zone" validate:"required"`
	FileName string       `json:"file_name" validate:"required"`                  // 文件名(不带后缀)
	Format   ConfigFormat `json:"format" validate:"required,oneof=yaml toml ini"` // 格式后缀名(比如: toml, yaml)
}

ReqCreateConfig ..

type ReqCreateConfigResource added in v0.2.0

type ReqCreateConfigResource struct {
	Env         string   `json:"env" validate:"required"`
	Zone        string   `json:"zone" validate:"required"`
	Name        string   `json:"name" validate:"required"`
	Value       string   `json:"value" validate:"required"`
	IsGlobal    bool     `json:"is_global"`
	Description string   `json:"description" validate:"required"`
	Visible     bool     `json:"visible"`
	Tags        []string `json:"tags"`
}

type ReqCreateConfigResourceVersion added in v0.2.0

type ReqCreateConfigResourceVersion struct {
	ID          uint     `json:"id" validate:"required"`
	Value       string   `json:"value" validate:"required"`
	Description string   `json:"description" validate:"required"`
	Tags        []string `json:"tags"`
}

type ReqCreateGRPCUseCase added in v0.3.0

type ReqCreateGRPCUseCase struct {
	MethodID uint             `json:"method_id" validate:"required"`
	Name     string           `json:"name" validate:"required"`
	Input    string           `json:"input"`
	Metadata db.ProtoMetadata `json:"metadata"`
}

type ReqDeleteAccessToken added in v0.2.0

type ReqDeleteAccessToken struct {
	AppID string `json:"app_id" valid:"required"`
}

type ReqDeleteConfig added in v0.2.0

type ReqDeleteConfig struct {
	ID uint `json:"id" validate:"required"`
}

ReqDeleteConfig ..

type ReqDetailConfig added in v0.2.0

type ReqDetailConfig struct {
	ID uint `json:"id" validate:"required" query:"id"`
}

ReqDetailConfig ..

type ReqDetailConfigResource added in v0.2.0

type ReqDetailConfigResource struct {
	ID uint `json:"id" validate:"required"`
}

type ReqDiffConfig added in v0.2.0

type ReqDiffConfig struct {
	ID             uint   `query:"id"`             // 配置ID
	HistoryID      uint   `query:"history_id"`     // 版本ID
	AppName        string `query:"appName"`        // 应用名称
	Env            string `query:"env"`            // 环境
	ServiceVersion string `query:"serviceVersion"` // 服务器版本
	PublishVersion string `query:"publishVersion"` // 发布版本
}

ReqDiffConfig ..

type ReqDiffReleaseConfig added in v0.4.3

type ReqDiffReleaseConfig struct {
	AppName    string   `query:"appName" validate:"required"` // 应用名
	Env        string   `query:"env" validate:"required"`     // 环境
	ConfigName string   `query:"configName"`                  // 配置文件名称
	IpList     []string `query:"ipList"`                      // ips
}

ReqDiffReleaseConfig ..

type ReqEtcdServiceList

type ReqEtcdServiceList struct {
	AppName  string `json:"appName"`
	ZoneCode string `json:"zone_code"`
}

type ReqEventList added in v0.3.0

type ReqEventList struct {
	AppName string `query:"app_name"`
	Env     string `query:"env"`
	Zone    string `query:"zone"`

	Page     int `query:"page"`
	PageSize int `query:"page_size"`
}

type ReqGetAppConfig added in v0.4.3

type ReqGetAppConfig struct {
	Aid uint `json:"aid" query:"aid" valid:"required"`
}

type ReqGetAppPerm added in v0.2.0

type ReqGetAppPerm struct {
	GroupName     string `json:"group_name"`
	AppNameSearch string `json:"app_name_search"`
	PageSize      int    `json:"size"`
	Page          int    `json:"page"`
}

type ReqGetConfigResourceByName added in v0.2.0

type ReqGetConfigResourceByName struct {
	Name string `json:"name"`
	Env  string `json:"env"`
	Zone string `json:"zone"` // Zone Code
}

type ReqGetEtcdList

type ReqGetEtcdList struct {
	Prefix      string `query:"prefix" json:"prefix"`
	AppName     string `query:"appName"  json:"appName"`
	ServiceName string `query:"serviceName"  json:"serviceName"`
	Suffix      string `query:"suffix"  json:"suffix"`
	ZoneCode    string `query:"zoneCode"  json:"zoneCode"`
	Env         string `query:"env"  json:"env"`
}

type ReqGetFrameVersion added in v0.3.0

type ReqGetFrameVersion struct {
	AppName string `json:"appName"`
}

type ReqGetGroupAPIPerm added in v0.2.0

type ReqGetGroupAPIPerm struct {
	GroupName string `query:"group_name" valid:"required"`
}

type ReqGetGroupMenuPerm added in v0.2.0

type ReqGetGroupMenuPerm struct {
	GroupName string `query:"group_name"`
}

type ReqGetTabVisit added in v0.4.3

type ReqGetTabVisit struct {
	StartTime int64 `json:"startTime"`
	EndTime   int64 `json:"endTime"`
}

GetTabVisit

func (*ReqGetTabVisit) Check added in v0.4.3

func (a *ReqGetTabVisit) Check() error

type ReqGovern added in v0.4.3

type ReqGovern struct {
	AppName string `json:"appName"`
	IdcCode string `json:"idcCode"`
	Env     string `json:"env"`
	TypeId  int    `json:"typeId"`
}

type ReqGrpcHistoryList added in v0.3.0

type ReqGrpcHistoryList struct {
	Page      int  `query:"page"`
	PageSize  int  `query:"page_size"`
	ServiceID uint `query:"service_id" validate:"required"`
}

type ReqHTTPProxy added in v0.2.0

type ReqHTTPProxy struct {
	Address string            `json:"address"`
	URL     string            `json:"url"`
	Type    string            `json:"type"`    // GET POST
	Timeout int               `json:"timeout"` // seconds
	Body    json.RawMessage   `json:"body"`
	Params  map[string]string `json:"params"`
}

ReqHTTPProxy ..

type ReqHistoryConfig added in v0.2.0

type ReqHistoryConfig struct {
	ID   uint `query:"id" json:"id" validate:"required"` // 配置文件ID
	Size int  `query:"size"  json:"size" validate:"required"`
	Page int  `query:"page"  json:"page"`
}

ReqHistoryConfig ..

type ReqList added in v0.4.3

type ReqList struct {
	AppName string `json:"appName"`
	IdcCode string `json:"idcCode"`
	Env     string `json:"env"`
}

type ReqListAccessToken added in v0.2.0

type ReqListAccessToken struct {
	Page     int `query:"page"`
	PageSize int `query:"page_size" valid:"required"`
}

type ReqListConfig added in v0.2.0

type ReqListConfig struct {
	AppName string `query:"app_name" validate:"required"`
	Env     string `query:"env" validate:"required"`
}

ReqListConfig ..

type ReqListConfigResource added in v0.2.0

type ReqListConfigResource struct {
	Page     int      `query:"page" json:"page"`
	PageSize int      `query:"pageSize" json:"page_size" validate:"required"`
	Env      []string `query:"env" json:"env"`
	Zone     []string `query:"zone" json:"zone"`
	Tag      string   `query:"tag" json:"tag"`
	Query    string   `query:"query" json:"query"`
}

type ReqListGRPCUseCases added in v0.3.0

type ReqListGRPCUseCases struct {
	ServiceID uint `query:"service_id" validate:"required"`
}

type ReqListHttpTestHistory added in v0.3.0

type ReqListHttpTestHistory struct {
	AppName  string `query:"app_name" validate:"required"`
	Page     int    `query:"page"`
	PageSize int    `query:"page_size"`
}

type ReqListPProf added in v0.3.0

type ReqListPProf struct {
	ZoneCode string `query:"zone_code"`
	AppName  string `query:"app_name"`
	HostName string `query:"host_name"`
	Env      string `query:"env"`
}

ReqListPProf ..

type ReqListPipeline added in v0.4.0

type ReqListPipeline struct {
	AppName  string `query:"app_name"`
	ZoneCode string `query:"zone_code"`
	Env      string `query:"env"`
}

type ReqListUser added in v0.2.0

type ReqListUser struct {
	GroupName string `query:"group_name"`
	Search    string `query:"search"`
	Page      int    `query:"page"`
	PageSize  int    `query:"page_size"`
}

type ReqLockConfig added in v0.4.0

type ReqLockConfig struct {
	ConfigID uint `query:"id" json:"id" validate:"required"`
}

type ReqMethodDetail added in v0.3.0

type ReqMethodDetail struct {
	ID uint `query:"id" validate:"required"`
}

type ReqNodeHeartBeat added in v0.2.0

type ReqNodeHeartBeat struct {
	Hostname     string `json:"hostname"`
	IP           string `json:"ip"`
	RegionCode   string `json:"region_code"`
	RegionName   string `json:"region_name"`
	ZoneCode     string `json:"zone_code"`
	ZoneName     string `json:"zone_name"`
	AppName      string `json:"app_name"`
	Env          string `json:"env"`
	AgentType    int    `json:"agent_type"`
	AgentVersion string `json:"agent_version"`
	ProxyType    int    `json:"proxy_type"`
	ProxyVersion string `json:"proxy_version"`
}

ReqNodeHeartBeat ..

type ReqOptionCreate added in v0.2.0

type ReqOptionCreate struct {
	db.Option
}

type ReqOptionDelete added in v0.2.0

type ReqOptionDelete struct {
	db.Option
}

type ReqOptionInfo added in v0.2.0

type ReqOptionInfo struct {
	Id          int    `query:"id"`
	OptionTitle string `query:"option_title"`
}

机房信息

type ReqOptionList added in v0.2.0

type ReqOptionList struct {
	CurrentPage int `query:"currentPage"`
	PageSize    int `query:"pageSize"`
}

type ReqOptionUpdate added in v0.2.0

type ReqOptionUpdate struct {
	db.Option
}

type ReqPostAppConfig added in v0.4.3

type ReqPostAppConfig struct {
	Aid    uint              `json:"aid" valid:"required"`
	Config db.UserConfigInfo `json:"config" valid:"required"`
}

type ReqPostUserVisit added in v0.4.3

type ReqPostUserVisit struct {
	Aid      uint   `json:"aid" valid:"required"`
	AppName  string `json:"appName"`   // 项目id
	ZoneCode string `json:"zone_code"` // 环境
	Env      string `json:"env"`       // 环境
	Tab      string `json:"tab"`
	Url      string `json:"url"` // url
}

func (*ReqPostUserVisit) Check added in v0.4.3

func (a *ReqPostUserVisit) Check() error

type ReqPublishConfig added in v0.2.0

type ReqPublishConfig struct {
	ID       uint     `json:"id" validate:"required"` // 配置ID
	HostName []string `json:"host_name"`              // 发布的实例机器名称的列表,如果为空,则发布所有机器
	Version  *string  `json:"version"`                // 版本号
	PubK8S   bool     `json:"pub_k8s"`                // 是否发布集群
	All      int      `json:"all"`                    //是否发布所有实例
}

ReqPublishConfig ..

type ReqQueryGRPCUseCase added in v0.3.0

type ReqQueryGRPCUseCase struct {
	MethodID uint `query:"id"`
}

type ReqQueryGrpcService added in v0.3.0

type ReqQueryGrpcService struct {
	ServiceID uint `query:"service_id" validate:"required"`
}

type ReqQueryHistoryItem added in v0.3.0

type ReqQueryHistoryItem struct {
	HistoryID uint `query:"history_id" validate:"required"`
}

type ReqQueryJobs added in v0.4.0

type ReqQueryJobs struct {
	AppName  *string `query:"app_name"`
	Enable   *bool   `query:"enable"`
	Name     *string `query:"name"`
	User     *string `query:"username"`
	Page     int     `query:"page"`
	PageSize int     `query:"page_size"`
}

task platform struct 需要执行的 cron cmd 命令 注册到 /cronsun/cmd/groupName/<id>

type ReqQueryTaskItem added in v0.4.0

type ReqQueryTaskItem struct {
	TaskID uint `query:"task_id"`
}

type ReqQueryTasks added in v0.4.0

type ReqQueryTasks struct {
	ID         uint     `query:"id"`
	ExecutedAt []string `query:"executed_at"`
	Page       int      `query:"page"`
	PageSize   int      `query:"page_size"`
}

task platform struct 需要执行的 cron cmd 命令 注册到 /cronsun/cmd/groupName/<id>

type ReqQueryTestTasks added in v0.4.0

type ReqQueryTestTasks struct {
	PipelineID uint `query:"pipeline_id"`
	Page       int  `query:"page"`
	PageSize   int  `query:"page_size"`
}

type ReqReadInstanceConfig added in v0.3.0

type ReqReadInstanceConfig struct {
	ConfigID uint   `query:"id" validate:"required"`
	HostName string `query:"host_name" validate:"required"`
}

type ReqRegistryQuery

type ReqRegistryQuery struct {
	AppName  string `json:"appName"`
	IDCCode  string `json:"zone_code"`
	IP       string `json:"ip"`
	HostName string `json:"hostname"`
	Env      string `json:"env"`
}

type ReqRelationApps

type ReqRelationApps struct {
	Current  int      `json:"current"`
	PageSize int      `json:"pageSize"`
	Env      string   `json:"env"`
	IsAddr   int      `json:"isAddr"`
	IsApp    int      `json:"isApp"`
	AppList  []string `json:"appList"`
	Types    []string `json:"types"`
	AddrList []string `json:"addrList"`
}

type ReqReportList

type ReqReportList struct {
	Current  int    `json:"current"`
	PageSize int    `json:"pageSize"`
	Aid      int    `json:"aid"`
	AppName  string `json:"appName"`
	StatDate int64  `json:"statDate"`
}

请求

type ReqReportRangeList

type ReqReportRangeList struct {
	Aid       int `json:"aid"`
	StartTime int `json:"startTime"`
	EndTime   int `json:"endTime"`
}

type ReqRunProfile added in v0.3.0

type ReqRunProfile struct {
	ZoneCode       string `json:"zone_code"`
	AppName        string `json:"app_name"`
	HostName       string `json:"host_name"`
	Env            string `json:"env"`
	DurationSecond int    `json:"duration_second"` //持续时间秒
}

ReqRunProfile ..

func (*ReqRunProfile) IsValid added in v0.4.11

func (req *ReqRunProfile) IsValid() (isValid bool, msg string)

type ReqSendGRPCRequest added in v0.3.0

type ReqSendGRPCRequest struct {
	ReqCreateGRPCUseCase
	Address string `json:"address" validate:"required"`
	Script  string `json:"script"`
}

type ReqSendHttpRequest added in v0.3.0

type ReqSendHttpRequest struct {
	ID          uint             `json:"id" validate:"required"`
	Name        string           `json:"name" validate:"required"`
	URL         string           `json:"url" validate:"required"`
	Method      string           `json:"method" validate:"required"`
	Query       db.HttpTestParam `json:"query"`
	Headers     db.HttpTestParam `json:"headers"`
	ContentType string           `json:"content_type"`
	Body        string           `json:"body"`
	Script      string           `json:"script"` //测试脚本
}

type ReqSentinelRuleAdd

type ReqSentinelRuleAdd struct {
	Prefix      string `json:"prefix"`
	AppName     string `json:"appName"`
	ServiceName string `json:"serviceName"`
	Suffix      string `json:"suffix"`
	ZoneCode    string `json:"zone_code"`
	DataSource  string `json:"dataSource"`
}

type ReqSetGroupAPIPerm added in v0.2.0

type ReqSetGroupAPIPerm struct {
	GroupName string        `json:"group_name"`
	APIList   []APIListItem `json:"api_list"`
}

type ReqSetGroupAppPerm added in v0.2.0

type ReqSetGroupAppPerm struct {
	GroupName string   `json:"group_name" valid:"required"`
	AppName   string   `json:"app_name" valid:"required"`
	Env       []string `json:"env"`
	Action    []string `json:"action"`
}

type ReqSetGroupMenuPerm added in v0.2.0

type ReqSetGroupMenuPerm struct {
	GroupName string   `json:"group_name"`
	Menu      []string `json:"menu"`
}

type ReqToolDedail

type ReqToolDedail struct {
	Id int `json:"id" form:"id"`
}

ReqToolDedail ...

type ReqToolList

type ReqToolList struct {
	CurrentPage int    `json:"currentPage" form:"currentPage"`
	ShowNum     int    `json:"showNum"  form:"showNum"`
	QueryObj    string `json:"queryObj" form:"queryObj"`
}

ReqToolList ...

type ReqUpdateConfig added in v0.2.0

type ReqUpdateConfig struct {
	ID      uint   `json:"id" validate:"required"`
	Message string `json:"message" validate:"required"`
	Content string `json:"content" validate:"required"`
}

ReqUpdateConfig ..

type ReqUpdateGRPCUseCase added in v0.3.0

type ReqUpdateGRPCUseCase struct {
	ID       uint             `json:"id" validate:"required"`
	MethodID uint             `json:"method_id" validate:"required"`
	Name     string           `json:"name" validate:"required"`
	Input    string           `json:"input"`
	Metadata db.ProtoMetadata `json:"metadata"`
	Script   string           `json:"script"`
}

type ReqUpdateGroup added in v0.2.0

type ReqUpdateGroup struct {
	OriginalName string `json:"name"`
	CurrentName  string `json:"current_name"`
}

type ReqUpdatePipeline added in v0.4.0

type ReqUpdatePipeline struct {
	ID     uint   `json:"id" validate:"required"`
	Name   string `json:"name" validate:"required,min=4,max=32"`
	Branch string `json:"branch" validate:"required,min=1,max=32"`
}

type ReqUpdateSettings added in v0.2.0

type ReqUpdateSettings struct {
	Name    string `json:"name"`
	Content string `json:"content"`
}

更新设置

type ReqUseCaseDetail added in v0.3.0

type ReqUseCaseDetail struct {
	ID uint `json:"id"`
}

type ReqUserAppViewHistory

type ReqUserAppViewHistory struct {
	Aid uint `json:"aid" valid:"required"`
}

ReqUserAppViewHistory 应用浏览记录埋点请求

type ReqUserApps

type ReqUserApps struct {
	Page     uint   `json:"page" valid:"required"`
	PageSize uint   `json:"pageSize" valid:"required"`
	QS       string `json:"qs"`
}

ReqUserApps 用户应用的请求

type ReqUserEvents

type ReqUserEvents struct {
	// FromTime uint `json:"fromTime" valid:"required"` // 获取从什么时候开始的数据
	PageSize uint `json:"pageSize" valid:"required"`
	Page     uint `json:"page" valid:"required"`
}

ReqUserEvents 获取用户相关事件的入参

type ResourceList

type ResourceList []db.AppTopology

func (ResourceList) Len

func (p ResourceList) Len() int

func (ResourceList) Less

func (p ResourceList) Less(i, j int) bool

func (ResourceList) Swap

func (p ResourceList) Swap(i, j int)

type RespAliyunLogDefault added in v0.4.0

type RespAliyunLogDefault struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
	Data string `json:"data"`
}

RespAliyunLogDefault ..

type RespAppAction added in v0.3.0

type RespAppAction struct {
	Code int         `json:"code"`
	Msg  string      `json:"msg"`
	Data interface{} `json:"data"`
}

type RespAppCommit

type RespAppCommit struct {
	Aid          int    `json:"aid"`
	Commit       string `json:"commit"`
	ReporterPath string `json:"reporterPath"`
}

type RespAppInfo

type RespAppInfo struct {
	Aid       int    `json:"aid"`
	Name      string `json:"name"`
	Lang      string `json:"lang"`
	AppName   string `json:"appName"`
	GitlabURL string `json:"gitlabUrl"`
	ProtoDir  string `json:"proto_dir"`
}

RespAppInfo ...

type RespAppInstance

type RespAppInstance struct {
	IP   string
	Host string
}

RespAppInstance ...

type RespAppListWithEnv added in v0.2.0

type RespAppListWithEnv struct {
	List       []AppListWithEnvItem `json:"list"`
	Pagination Pagination           `json:"pagination"`
}

type RespAppNumber

type RespAppNumber struct {
	TotalNumber  int `json:"totalNumber"`
	NewNumber    int `json:"newNumber"`
	DeleteNumber int `json:"deleteNumber"`
}

RespAppNumber ...

type RespAppPkgAllList

type RespAppPkgAllList struct {
	Aid        int    `json:"aid"`
	AppName    string `json:"appName"`
	DepName    string `json:"depName"`
	DepBranch  string `json:"depBranch"`
	DepVersion string `json:"depVersion"`
	UpdateTime string `json:"update_time"`
}
type RespAppPkgLinkList struct {
	Aid     int    `json:"aid"`
	DepName string `json:"depName"`
}

type RespAppProjectList

type RespAppProjectList struct {
	Aid     int    `json:"aid"`
	AppName string `json:"appName"`
	WebUrl  string `json:"webUrl"`
}

type RespAppResource

type RespAppResource struct {
	Aid   int    `json:"aid"`
	Addr  string `json:"addr"`
	Name  string `json:"name"`
	Env   string `json:"env"`
	Type  string `json:"type"`
	Info  string `json:"info"`
	IdcID int    `json:"idcId"`
}

RespAppResource ...

type RespAppStatistics

type RespAppStatistics struct {
	AppCount     int `json:"appCount"`
	AppNodeCount int `json:"appNodeCount"`
}

type RespBatchCheckResourceVersion added in v0.2.0

type RespBatchCheckResourceVersion []BatchCheckResourceVersionItem

type RespConfig

type RespConfig struct {
	AppName string          `json:"app_name"`
	Aid     int             `json:"aid"`
	Config  []RespOneConfig `json:"config"`
}

type RespConfigInstanceItem added in v0.2.0

type RespConfigInstanceItem struct {
	ConfigurationStatusID uint   `json:"configuration_status_id"`
	Env                   string `json:"env"`
	IP                    string `json:"ip"`
	HostName              string `json:"host_name"`
	DeviceID              int    `json:"device_id"`
	RegionCode            string `json:"region_code"`
	RegionName            string `json:"region_name"`
	ZoneCode              string `json:"zone_code"`
	ZoneName              string `json:"zone_name"`
	ConfigFilePath        string `json:"config_file_path"`
	ConfigFileUsed        uint   `json:"config_file_used"` // 1 supervisor 2 systemd
	ConfigFileSynced      uint   `json:"config_file_synced"`
	ConfigFileTakeEffect  uint   `json:"config_file_take_effect"`
	SyncAt                string `json:"sync_at"`
	ChangeLog             string `json:"change_log"`
	Version               string `json:"version"` // 发布到Juno Proxy的版本号
}

RespConfigInstanceItem ..

type RespConfigInstanceList added in v0.2.0

type RespConfigInstanceList []RespConfigInstanceItem

type RespDetailConfig added in v0.2.0

type RespDetailConfig struct {
	ID              uint       `json:"id"`
	AID             uint       `json:"aid"`
	Name            string     `json:"name"`
	Content         string     `json:"content"`
	Format          string     `json:"format"` // Yaml/Toml
	Env             string     `json:"env"`    // 环境
	Zone            string     `json:"zone"`   // 机房Zone
	CreatedAt       time.Time  `json:"created_time"`
	UpdatedAt       time.Time  `json:"update_time"`
	PublishedAt     *time.Time `json:"published"`         // 未发布/发布时间
	CurrentEditUser *User      `json:"current_edit_user"` //当前正在编辑的用户名
}

RespDetailConfig Contains configuration content

type RespDetailConfigResource added in v0.2.0

type RespDetailConfigResource struct {
	UserName      string                  `json:"user_name"`
	Name          string                  `json:"name"`
	Env           string                  `json:"env"`
	ZoneName      string                  `json:"zone_name"`
	ZoneCode      string                  `json:"zone_code"`
	IsGlobal      bool                    `json:"is_global"`
	Description   string                  `json:"description"`
	LatestVersion uint                    `json:"latest_version"`
	LastUpdate    time.Time               `json:"last_update"`
	Versions      []ConfigResourceVersion `json:"versions"`
	Tags          []string                `json:"tags"`
	Value         string                  `json:"value"`
}

type RespDetailGrpcMethod added in v0.3.0

type RespDetailGrpcMethod struct {
	ID      uint   `json:"id"`
	AppName string `json:"app_name"`
	Proto   struct {
		ID          uint   `json:"id"`
		FileName    string `json:"file_name"`
		PackageName string `json:"package_name"`
	} `json:"proto"`
	Service struct {
		ID   uint   `json:"id"`
		Name string `json:"name"`
	} `json:"service"`
	Name       string      `json:"name"`
	Comment    string      `json:"comment"`
	InputType  interface{} `json:"input_type"`
	OutputType interface{} `json:"output_type"`
}

type RespDiffConfig added in v0.2.0

type RespDiffConfig struct {
	Origin   *RespDetailConfig `json:"origin,omitempty"`
	Modified RespDetailConfig  `json:"modified"`
}

RespDiffConfig ..

type RespDiffReleaseConfig added in v0.4.3

type RespDiffReleaseConfig struct {
	HasNew      bool          `json:"hasNew" query:"hasNew"` // 服务器配置与发布配置是否一致;true:有更新,false:没更新
	DiffUrlList []DiffUrlList `json:"diffUrlList" query:"diffUrlList"`
}

RespDiffReleaseConfig ..

type RespDroneStatus

type RespDroneStatus struct {
	RepoId      int    `json:"repoId"`
	RepoLink    string `json:"repoLink"`
	BuildStatus string `json:"buildStatus"`
	BuildEvent  string `json:"buildEvent"`
}

type RespEnvZone added in v0.2.0

type RespEnvZone map[string][]RespEnvZoneItem // env => zones

type RespEnvZoneItem added in v0.2.0

type RespEnvZoneItem struct {
	ZoneCode string `json:"zone_code"`
	ZoneName string `json:"zone_name"`
}

type RespEtcdInfo

type RespEtcdInfo struct {
	Key            string `json:"key"`
	CreateRevision int64  `json:"create_revision"`
	ModRevision    int64  `json:"mod_revision"`
	Version        int64  `json:"version"`
	Value          string `json:"value"`
	Lease          int64  `json:"lease"`
}

type RespEtcdServiceList

type RespEtcdServiceList struct {
	AppName  string `json:"appName"`
	ZoneCode string `json:"zone_code"`
}

type RespGetAppPerm added in v0.2.0

type RespGetAppPerm struct {
	List       []AppPermItem `json:"list"`
	Pagination Pagination    `json:"pagination"`
}

type RespGetFrameVersion added in v0.3.0

type RespGetFrameVersion struct {
	FrameVersion string `json:"frameVersion"`
	VersionKey   string `json:"versionKey"`
}

type RespGetGroupAPIPerm added in v0.2.0

type RespGetGroupAPIPerm []APIPermItem

type RespGetMenuPerm added in v0.2.0

type RespGetMenuPerm []string

type RespGrpcAppServiceTreeItem added in v0.3.0

type RespGrpcAppServiceTreeItem struct {
	AppName  string                `json:"app_name"`
	Services []RespGrpcServiceItem `json:"services"`
}

type RespGrpcHistoryList added in v0.3.0

type RespGrpcHistoryList struct {
	Pagination Pagination            `json:"pagination"`
	List       []GrpcHistoryListItem `json:"list"`
}

type RespGrpcServiceItem added in v0.3.0

type RespGrpcServiceItem struct {
	ID          uint   `json:"id"`
	FileName    string `json:"proto_name"`
	PackageName string `json:"package_name"`
	ProtoID     uint   `json:"proto_id"`
	Name        string `json:"name"`
}

type RespGrpcServiceMethodItem added in v0.4.0

type RespGrpcServiceMethodItem struct {
	ID          uint                        `json:"id"`
	FileName    string                      `json:"proto_name"`
	PackageName string                      `json:"package_name"`
	ProtoID     uint                        `json:"proto_id"`
	Name        string                      `json:"name"`
	Methods     []RespListMethodUseCaseItem `json:"methods"`
}

type RespHistoryConfig added in v0.2.0

type RespHistoryConfig struct {
	Pagination Pagination               `json:"pagination"`
	List       []*RespHistoryConfigItem `json:"list"`
}

RespHistoryConfig ..

type RespHistoryConfigItem added in v0.2.0

type RespHistoryConfigItem struct {
	ID              uint      `json:"id"`
	UID             uint      `json:"uid"` // 发布人ID
	AccessTokenID   uint      `json:"access_token_id"`
	AccessTokenName string    `json:"access_token_name"`
	UserName        string    `json:"user_name"`
	ChangeLog       string    `json:"change_log"`
	ConfigurationID uint      `json:"configuration_id"`
	Version         string    `json:"version"` // 发布到Juno Proxy的版本号
	CreatedAt       time.Time `json:"created_at"`
	CurrentVersion  int       `json:"current_version"` //是不是当前版本
}

RespHistoryConfigItem ..

type RespIDCList

type RespIDCList struct {
	RegionCode string `json:"regionCode" gorm:"column:region_code"`
	RegionName string `json:"regionName" gorm:"column:region_name"`
	ZoneCode   string `json:"zone_code" gorm:"column:zone_code"`
}

type RespIDCStructure

type RespIDCStructure struct {
	JunoZone         string            `json:"junoZone"`
	GovernStatusList []GovernIdcStatus `json:"governIdcList"`
	IDCList          []db.Zone         `json:"idcList"`
}

type RespInfo added in v0.4.3

type RespInfo struct {
	Id         int    `json:"id" gorm:"not null;column:id"` //id类型?
	AppName    string `json:"appName" gorm:"not null;column:app_name"`
	IdcId      uint32 `json:"idcId" gorm:"not null;column:idc_id"` //id类型?
	Aid        uint32 `json:"aid" gorm:"not null;column:aid"`      //id类型?
	HostName   string `json:"hostName" gorm:"not null;column:host_name"`
	Ip         string `json:"ip" gorm:"not null;column:ip"`
	DeviceID   int    `json:"deviceId" gorm:"not null;column:device_id"`
	Env        string `json:"env"gorm:"not null"`
	RegionCode string `json:"regionCode"gorm:"not null"`
	RegionName string `json:"regionName"gorm:"not null"`
	IdcCode    string `json:"idcCode"gorm:"not null"`

	RegKey         string          `gorm:"not null"json:"regKey"`
	RegValue       json.RawMessage `gorm:"not null;type:text"json:"regValue"`
	Scheme         string          `gorm:"not null"json:"scheme"`
	Address        string          `gorm:"not null"json:"address"`
	VcsInfo        string          `gorm:"not null;"json:"vcsInfo"`
	ProcessStartAt int64           `gorm:"not null"json:"processStartAt"`
	Enable         int8            `gorm:"not null"json:"enable"`
	Type           string          `gorm:"not null"json:"type"`
	Weight         int64           `gorm:"not null"json:"weight"`
	Group          string          `gorm:"not null"json:"group"`
}

type RespListAccessToken added in v0.2.0

type RespListAccessToken struct {
	Pagination Pagination        `json:"pagination"`
	List       []AccessTokenItem `json:"list"`
}

type RespListAppGroup added in v0.2.0

type RespListAppGroup []ListGroupItem

type RespListConfig added in v0.2.0

type RespListConfig []RespListConfigItem

RespListConfig ..

type RespListConfigItem added in v0.2.0

type RespListConfigItem struct {
	ID           uint           `json:"id"`
	AID          uint           `json:"aid"`
	Name         string         `json:"name"`
	Format       string         `json:"format"` // Yaml/Toml
	Env          string         `json:"env"`    // 环境
	Zone         string         `json:"zone"`   // 机房Zone
	CreatedAt    time.Time      `json:"created_time"`
	UpdatedAt    time.Time      `json:"update_time"`
	DeletedAt    gorm.DeletedAt `json:"deleted_at"`
	PublishedAt  *time.Time     `json:"published"`     // 未发布/发布时间
	ConfigStatus uint32         `json:"config_status"` // 配置发布状态,0:未知 1:已发布 2:未发布
}

RespListConfigItem Does not contain configuration content to prevent configuration from being too long

type RespListConfigResource added in v0.2.0

type RespListConfigResource struct {
	Pagination Pagination                   `json:"pagination"`
	List       []RespListConfigResourceItem `json:"list"`
}

type RespListConfigResourceItem added in v0.2.0

type RespListConfigResourceItem struct {
	ID            uint      `json:"id"`
	UID           uint      `json:"uid"`
	UserName      string    `json:"user_name"`
	Name          string    `json:"name"`
	Env           string    `json:"env"`
	ZoneName      string    `json:"zone_name"`
	ZoneCode      string    `json:"zone_code"`
	IsGlobal      bool      `json:"is_global"`
	Description   string    `json:"description"`
	LatestVersion uint      `json:"latest_version"`
	LastUpdate    time.Time `json:"last_update"`
	Value         string    `json:"value"`
	Tags          []string  `json:"tags"`
}

type RespListGRPCProto added in v0.3.0

type RespListGRPCProto []ListGrpcProtoItem

type RespListHttpTestCollection added in v0.3.0

type RespListHttpTestCollection struct {
	Pagination Pagination           `json:"pagination"`
	List       []HttpTestCollection `json:"list"`
}

type RespListHttpTestHistory added in v0.3.0

type RespListHttpTestHistory struct {
	List       []HttTestLogListItem `json:"list"`
	Pagination Pagination           `json:"pagination"`
}

type RespListMethodUseCaseItem added in v0.3.0

type RespListMethodUseCaseItem struct {
	GrpcMethodItem
	UseCases []GrpcUseCaseItem `json:"use_cases"`
}

type RespListUser added in v0.2.0

type RespListUser struct {
	List       []ListUserItem `json:"list"`
	Pagination Pagination     `json:"pagination"`
}

type RespListUserGroup added in v0.2.0

type RespListUserGroup []ListGroupItem

type RespOneConfig

type RespOneConfig struct {
	Env      string `json:"env"`
	ZoneCode string `json:"zone_code"`
	Content  string `json:"content"`
	AppName  string `json:"app_name"`
	Aid      int    `json:"aid"`
	Format   string `json:"format"`
	FileName string `json:"fileName"`
}

type RespReadInstanceConfigItem added in v0.3.0

type RespReadInstanceConfigItem struct {
	ConfigID uint   `json:"config_id"`
	FileName string `json:"file_name"`
	Content  string `json:"content"`
	Error    string `json:"error"`
}

type RespRegisterInfo

type RespRegisterInfo struct {
	AppName   string `json:"app_name"`
	IP        string `json:"ip"`
	HostName  string `json:"host_name"`
	RegKey    string `json:"reg_key"`
	StartTime string `json:"start_time"`
	VCSInfo   string `json:"vcs_info"`
}

type RespRegistryItem

type RespRegistryItem struct {
	ID             int32  `json:"id"`
	AppName        string `json:"appName"`
	RegKey         string `json:"regKey"`
	RegValue       string `json:"regValue"`
	Region         string `json:"region"`
	Zone           string `json:"zone"`
	Scheme         string `json:"scheme"`
	Address        string `json:"address"`
	IP             string `json:"ip"`
	HostName       string `json:"hostname"`
	Type           string `json:"type"`
	Enable         int8   `json:"enable"`
	Group          string `json:"group"`
	Weight         int64  `json:"weight"`
	ProcessStartAt int64  `json:"processStartAt"`
	CreateAt       int64  `json:"createAt"`
	UpdateAt       int64  `json:"updateAt"`
}

查询结果记录

type RespRegistryQuery

type RespRegistryQuery struct {
	List []RespRegistryItem `json:"list"`
}

查询结果

type RespRelationApps

type RespRelationApps struct {
	Current  int            `json:"current"`
	PageSize int            `json:"pageSize"`
	Total    int64          `json:"total"`
	List     []RelationApps `json:"list"`
	AddrList []string       `json:"addrList"`
}

type RespReportList

type RespReportList struct {
	Pagination Pagination   `json:"pagination"`
	List       []ReportInfo `json:"list"`
}

type RespToolDetail

type RespToolDetail struct {
	Id         uint64 `gorm:"primary_key"`
	Name       string
	Url        string
	PicUrl     string
	Desc       string
	CreateTime int64
}

RespToolDetail ...

type RespToolList

type RespToolList struct {
	CurrentPage int            `json:"currentPage"`
	TotalPage   int            `json:"totalPage"`
	ShowNum     int            `json:"showNum"`
	List        []*db.ToolInfo `json:"list"`
}

RespToolList ...

type RespUserApps

type RespUserApps struct {
	Pagination Pagination   `json:"pagination"`
	List       []db.AppInfo `json:"list"`
}

RespUserApps 用户应用响应

type RespUserEvents

type RespUserEvents struct {
	Events     []db.AppEvent     `json:"events"`
	Pagination output.Pagination `json:"pagination"`
}

RespUserEvents 用户相关事件的出参

type RuntimeStats

type RuntimeStats struct {
	IP       string `json:"ip"`
	Hostname string `json:"hostname"`
	Time     string `json:"time"` // 每次展示数据的时间
	Err      string `json:"err"`
}

type SelectData

type SelectData struct {
	Title string `json:"name"`
	Value string `json:"value"`
}

type ServerNode

type ServerNode struct {
	Name     string              `json:"name" toml:"name"`
	Scheme   string              `json:"scheme" toml:"scheme"` // http | grpc
	Address  string              `json:"address" toml:"address"`
	Labels   map[string]string   `json:"labels" toml:"labels"` // 标签: group, weight, enable 等
	Services map[string]*Service `json:"services" toml:"services"`
}

type Service

type Service struct {
	Namespace string            `json:"namespace" toml:"namespace"`
	Name      string            `json:"name" toml:"name"`
	Labels    map[string]string `json:"labels" toml:"labels"`
	Methods   []string          `json:"methods" toml:"methods"`
}

type SettingConfigDep added in v0.2.0

type SettingConfigDep struct {
	Interval uint `json:"interval"` // 配置依赖解析的
}

type SettingFieldConfig added in v0.2.0

type SettingFieldConfig struct {
	Default  string                   // 默认值
	Validate func(value string) error // 参数检查函数
}

设置项配置

func GetSettingFieldConfig added in v0.2.0

func GetSettingFieldConfig(name string) (SettingFieldConfig, bool)

type SettingGateway added in v0.2.0

type SettingGateway []SettingGatewayItem

type SettingGatewayItem added in v0.2.0

type SettingGatewayItem struct {
	Name    string `json:"name"`    // 设置项名称
	Domain  string `json:"domain"`  // 访问地址,Juno根据这个域名进行代理
	Host    string `json:"host"`    // 被代理的服务真实地址
	Scheme  string `json:"scheme"`  // 被代理的服务的协议
	Timeout uint   `json:"timeout"` // 超时(秒)
	Headers []struct {
		Name  string `json:"name"`
		Value string `json:"value"`
	} `json:"headers"` // header头
}

type SettingGrafana added in v0.2.0

type SettingGrafana struct {
	Host       string `json:"host"`
	Scheme     string `json:"scheme"`
	HeaderName string `json:"header_name"`
}

type SettingGrafanaDashboard added in v0.3.0

type SettingGrafanaDashboard struct {
	Name  string `json:"name"`  // Dashboard 名称
	Value string `json:"value"` // Dashboard 路由
}

type SettingK8SCluster added in v0.4.0

type SettingK8SCluster struct {
	List []struct {
		Name     string   `json:"name" validate:"required"`
		Env      []string `json:"env" validate:"required"`
		ZoneCode string   `json:"zone_code" validate:"required"`
		ZoneName string   `json:"zone_name" validate:"required"`
		Token    string   `json:"token" validate:"required"`
		Domain   string   `json:"domain" validate:"required"`
	} `json:"list"`
}

type SettingName added in v0.2.0

type SettingName string

设置名称

type SettingTestPlatform added in v0.4.0

type SettingTestPlatform struct {
	Enable bool
}

type TabVisit added in v0.4.3

type TabVisit struct {
	Tab      string `json:"tab"`
	TabName  string `json:"tab_name"`
	VisitSum int    `json:"visit_sum"`
}

type TaskPlatformJob added in v0.4.0

type TaskPlatformJob struct {
	ID            string     `json:"id"`
	Name          string     `json:"name"`
	Group         string     `json:"group"`
	Command       string     `json:"cmd"`
	User          string     `json:"user"`
	Rules         []*JobRule `json:"rules"`
	Pause         bool       `json:"pause"`          // A manually controlled state
	Timeout       int64      `json:"timeout"`        // Task execution time timeout setting, valid when greater than 0
	Parallels     int64      `json:"parallels"`      // Sets how many tasks can be allowed on a single node at once
	Retry         int        `json:"retry"`          // Number of failed retries. Default is 0, no retry
	Interval      int        `json:"interval"`       // Failed task retry interval, Unit second
	Kind          int        `json:"kind"`           // Task type. 0: ordinary task, 1: single machine task
	AvgTime       int64      `json:"avg_time"`       // Average execution time, per ms
	FailNotify    bool       `json:"fail_notify"`    // Failed to send notification
	To            []string   `json:"to"`             // Send notification address
	LogExpiration int        `json:"log_expiration"` // Specify log cleanup times for tasks separately

	Count *int64 `json:"-"` // Control the number of simultaneous tasks
	// contains filtered or unexported fields
}

task platform struct 需要执行的 cron cmd 命令 注册到 /cronsun/cmd/groupName/<id>

type TestPipeline added in v0.4.0

type TestPipeline struct {
	ID                 uint                     `json:"id"`
	Name               string                   `json:"name" validate:"required,min=4,max=32"`
	Env                string                   `json:"env" validate:"required,min=1,max=32"`
	ZoneCode           string                   `json:"zone_code" validate:"required"`
	AppName            string                   `json:"app_name" validate:"required"`
	Branch             string                   `json:"branch" validate:"required,min=1,max=32"`
	CodeCheck          bool                     `json:"code_check"`
	UnitTest           bool                     `json:"unit_test"`
	HttpTestCollection *int                     `json:"http_test_collection"` // http 测试集合
	GrpcTestAddr       string                   `json:"grpc_test_addr"`
	GrpcTestCases      db.PipelineGrpcTestCases `json:"grpc_test_cases"` // GRPC 测试用例列表
}

type TestPipelineUV added in v0.4.0

type TestPipelineUV struct {
	ID                 uint                     `json:"id"`
	Name               string                   `json:"name" validate:"required,min=4,max=32"`
	Env                string                   `json:"env" validate:"required,min=1,max=32"`
	ZoneCode           string                   `json:"zone_code" validate:"required"`
	AppName            string                   `json:"app_name" validate:"required"`
	Branch             string                   `json:"branch" validate:"required,min=1,max=32"`
	CodeCheck          bool                     `json:"code_check"`
	UnitTest           bool                     `json:"unit_test"`
	HttpTestCollection *int                     `json:"http_test_collection"` // http 测试集合
	GrpcTestAddr       string                   `json:"grpc_test_addr"`
	GrpcTestCases      db.PipelineGrpcTestCases `json:"grpc_test_cases"` // GRPC 测试用例列表
	Desc               db.TestPipelineDesc      `json:"desc"`
	Status             db.TestTaskStatus        `json:"status"`
	RunCount           int                      `json:"run_count"`
}

type TestTask added in v0.4.0

type TestTask struct {
	TaskID    uint                `json:"task_id" validate:"required"`
	Name      string              `json:"name" validate:"required"`
	AppName   string              `json:"app_name" validate:"required"`
	Env       string              `json:"env" validate:"required"`
	ZoneCode  string              `json:"zone_code" validate:"required"`
	Branch    string              `json:"branch" validate:"required"`
	Desc      db.TestPipelineDesc `json:"desc" validate:"required"`
	GitUrl    string              `json:"git_url"`
	Status    db.TestTaskStatus   `json:"status"`
	CreatedAt time.Time           `json:"created_at"`
}

type TestTaskEvent added in v0.4.0

type TestTaskEvent struct {
	Type   TestTaskEventType `json:"type"`
	TaskID uint              `json:"task_id"`

	Data json.RawMessage `json:"data"`
}

type TestTaskEventType added in v0.4.0

type TestTaskEventType string
var (
	TaskUpdateEvent     TestTaskEventType = "task_update"
	TaskStepUpdateEvent TestTaskEventType = "step_update"
)

type TestTaskStepStatus added in v0.4.0

type TestTaskStepStatus struct {
	ID       uint   `json:"id"`
	TaskID   uint   `json:"task_id"`
	StepName string `json:"step_name"`
	Status   string `json:"status"`
	Logs     string `json:"logs"`
}

type TestTaskStepUpdatePayload added in v0.4.0

type TestTaskStepUpdatePayload struct {
	StepName   string            `json:"step_name"`
	Status     db.TestStepStatus `json:"status"`
	LogsAppend string            `json:"logs_append"` // 考虑到部分任务的日志量较大,这里使用增量日志
}

type TestTaskUpdateEventPayload added in v0.4.0

type TestTaskUpdateEventPayload struct {
	Status     db.TestTaskStatus `json:"status"`
	LogsAppend string            `json:"logs"`
}

type UniqZone added in v0.2.0

type UniqZone struct {
	Env  string
	Zone string
}

func (UniqZone) String added in v0.2.0

func (u UniqZone) String() string

type UpdateHttpTestCase added in v0.3.0

type UpdateHttpTestCase struct {
	ID          uint             `json:"id"`
	Name        string           `json:"name" valid:"required"`
	URL         string           `json:"url"`
	Method      string           `json:"method"`
	Query       db.HttpTestParam `json:"query"`
	Headers     db.HttpTestParam `json:"headers"`
	ContentType string           `json:"content_type"`
	Body        string           `json:"body"`
}

type UsedStatusResp added in v0.2.0

type UsedStatusResp struct {
	IsUsed int `json:"is_used"`
}

UsedStatusResp ..

type User added in v0.4.0

type User struct {
	Uid      int    `json:"uid"`
	Username string `json:"username"`
	Nickname string `json:"nickname"`
	Email    string `json:"email"`
	Avatar   string `json:"avatar"`
}

type UserTabVisit added in v0.4.3

type UserTabVisit struct {
	Uid      uint32           `json:"uid"`
	UserName string           `json:"user_name"`
	AppSum   int              `json:"app_sum"`
	VisitSum int              `json:"visit_sum"`
	AppMap   map[int]struct{} `json:"-"`
}

type VisitStat added in v0.4.3

type VisitStat struct {
	AppVisit  []AppTabVisit  `json:"app_visit"`
	UserVisit []UserTabVisit `json:"user_visit"`
	PageVisit []TabVisit     `json:"page_visit"`
	AppList   []db.AppInfo   `json:"app_list"`
	AppSum    int            `json:"app_sum"`
	AppConf   int            `json:"app_conf"`
}

type WorkerHeartbeat added in v0.4.0

type WorkerHeartbeat struct {
	IP         string `json:"ip"`
	Port       int    `json:"port"`
	HostName   string `json:"host_name"`
	RegionCode string `json:"region_code"`
	RegionName string `json:"region_name"`
	ZoneCode   string `json:"zone_code"`
	ZoneName   string `json:"zone_name"`
	Env        string `json:"env"`
}

type WorkerZone added in v0.4.0

type WorkerZone struct {
	ZoneName  string `json:"zone_name"`
	ZoneCode  string `json:"zone_code"`
	NodeCount int    `json:"node_count"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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