model

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ImmediatelyFailedMachineInMerlin Paas immediately returns failed, when you create some new machines.
	ImmediatelyFailedMachineInMerlin = -200
	// InitializedFailedMachineInMerlin Scheduled detected that paas failed to execute Initialized task.
	InitializedFailedMachineInMerlin = -201
	// PodScheduledFailedMachineInMerlin Scheduled detected that paas failed to execute PodScheduled task.
	PodScheduledFailedMachineInMerlin = -202
	// ReadyFailedMachineInMerlin Scheduled detected that paas failed to execute Ready task.
	ReadyFailedMachineInMerlin = -203
	// ReadyFailedMachineInMerlin Scheduled detected that paas failed to sync the node of tree service.
	SynTreeFailedMachineInMerlin = -204
	// CreateTagFailedMachineInMerlin detected that merlin failed to create tag.
	CreateTagFailedMachineInMerlin = -205

	// RemovedMachineInMerlin the user removed the machine.
	RemovedMachineInMerlin = -100

	// CreatingMachineInMerlin Paas is creating the machine now.
	CreatingMachineInMerlin = 0
	// InitializeMachineInMerlin Paas is executing Initialize task.
	InitializeMachineInMerlin = 1
	// InitializeMachineInMerlin Paas is executing PodScheduled task.
	PodScheduledMachineInMerlin = 2
	// InitializeMachineInMerlin Paas is executing Ready task.
	ReadyMachineInMerlin = 3
	// InitializeMachineInMerlin Paas is syncing the node of tree service.
	SynTreeMachineInMerlin = 4

	// BootMachineInMerlin The machine is turned on.
	BootMachineInMerlin = 100

	// ShutdownMachineInMerlin The machine is off state.
	ShutdownMachineInMerlin = 200
)

merlin machine status.

View Source
const (
	// CreateFailedMachineInPaas Paas created the machine failed
	CreateFailedMachineInPaas = 0
	// CreatingMachineInPass Paas is creating the machine now
	CreatingMachineInPass = 1

	// SuccessDeletePaasMachines success deleted paas machine
	SuccessDeletePaasMachines = 1
)

paas return response status.

View Source
const (
	DefaultPageSize = 5
	DefaultPageNum  = 1
)

pagination.

View Source
const (
	SnapshotInit    = "快照初始化"
	SnapshotDoing   = "快照进行中"
	SnapshotSuccess = "快照已完成"
	SnapShotFailed  = "快照失败"
)

snapshot status

View Source
const (
	GenForMachineLog      = "创建"
	DeleteForMachineLog   = "删除"
	TransferForMachineLog = "转移"

	OperationSuccessForMachineLog = "成功"
	OperationFailedForMachineLog  = "失败"

	MBStartLog    = "移动设备启动"
	MBShutDownLog = "移动设备关闭"
	MBBindLog     = "移动设备绑定"
	MBReleaseLog  = "移动设备释放"
	MBLendOutLog  = "移动设备借出"
	MBReturnLog   = "移动设备归还"
)

machine log.

View Source
const (
	MBInUse     = 1
	MBFree      = 2
	MBNoConnect = 3
)

mobile machine usage.

View Source
const (
	MBOnline  = 1  //在线
	MBOffline = -1 //离线
	MBHostDel = -2 //删除
)

mobile machine usage.

View Source
const (
	MBSimulator = 1 //虚拟机
	MBReal      = 0 //真机
)

is Simulator or RealMachine.

View Source
const (
	MBOnSite  = 0 //归还
	MBLendOut = 1 //借出
)

is real machine on site or not.

View Source
const (
	DelayMachineEndTime       = "手动延期"
	CancelDelayMachineEndTime = "取消延期"
	AuditDelayMachineEndTime  = "审批延期"
)

delay log.

View Source
const (
	DelayStatusInit    = 0 //延期状态初始化
	DelayStatusAuto    = 1 //可自动延期
	DelayStatusApply   = 2 //可申请延期
	DelayStatusDisable = 3 //不可申请延期
)

delay status.

View Source
const (
	ApplyDelayInit    = "申请延期中"
	ApplyDelayCancel  = "申请延期取消"
	ApplyDelayApprove = "申请延期通过"
	ApplyDelayDecline = "申请延期驳回"
)

apply status.

View Source
const (
	TaskInit    = 0  //未开始
	TaskDone    = 1  //已执行成功
	TaskFailed  = 2  //已执行失败
	TaskDeleted = -1 //任务删除
)

task status.

View Source
const (
	MailTypeMachineWillExpired      = 1  //机器将要过期
	MailTypeMachineDeleted          = 2  //机器已被删除
	MailTypeMachineTransfer         = 5  //机器转移
	MailTypeTaskDeleteMachineFailed = 11 //删除机器任务失败

	MailTypeApplyDelayMachineEndTime = 3 //申请延长机器过期时间
	MailTypeAuditDelayMachineEndTime = 4 //审核延长机器过期时间

)

machine expired status.

View Source
const (
	ImageNoSnapshot    = 0
	ImagePullAndPush   = 1
	ImagePull          = 2
	ImageTag           = 3
	ImagePush          = 4
	ImageMachine2Image = 5
)

image operate type.

View Source
const (
	ImageSuccess  = 0
	ImageInit     = -1
	ImagePullErr  = -2
	ImageReTagErr = -3
	ImagePushErr  = -4
)

image operate err

View Source
const (
	False = "False"
	True  = "True"
)

bool str.

View Source
const (
	AliveImageStatus   = 1
	DeletedImageStatus = 2
)

image status.

View Source
const (
	CPURatio    = 1000
	MemoryRatio = 1024
)

machine ratio

View Source
const (
	DeleteMachine = "DeleteMachine" // 删除机器
)

task.

View Source
const (
	MachinePodNameSuffix = "-0"
)

machine suffix.

View Source
const (
	Success = "success"
)

other

View Source
const (
	TimeFormat = "2006-01-02 15:04:05"
)

time format.

View Source
const (
	TreeRoleAdmin = 1
)

tree role admin.

Variables

This section is empty.

Functions

This section is empty.

Types

type AboundMachineLog

type AboundMachineLog struct {
	MachineLog
	Name string `json:"machine_name"`
}

AboundMachineLog Abound Machine Log.

type AboundMobileMachineLog

type AboundMobileMachineLog struct {
	MobileMachineLog
	Serial string `json:"serial"`
}

AboundMobileMachineLog Abound mobile Machine Log.

type ApplicationRecord

type ApplicationRecord struct {
	ID           int64     `json:"id" gorm:"column:id"`
	Applicant    string    `json:"applicant" gorm:"column:applicant"`
	MachineID    int64     `json:"machine_id" gorm:"column:machine_id"`
	ApplyEndTime time.Time `json:"apply_end_time" gorm:"column:apply_end_time"`
	Status       string    `json:"status" gorm:"column:status"`
	Auditor      string    `json:"auditor" gorm:"column:auditor"`
	CTime        time.Time `json:"ctime" gorm:"column:ctime;default:current_timestamp"`
	UTime        time.Time `json:"utime" gorm:"column:mtime;default:current_timestamp on update current_timestamp"`
}

ApplicationRecord ApplicationRecord.

type ApplyEndTimeRequest

type ApplyEndTimeRequest struct {
	MachineID    int64  `json:"machine_id"`
	ApplyEndTime string `json:"apply_end_time"`
	Auditor      string `json:"auditor"`
}

ApplyEndTimeRequest Apply End Time Request.

type AuditEndTimeRequest

type AuditEndTimeRequest struct {
	AuditID     int64  `json:"audit_id"`
	AuditResult bool   `json:"audit_result"`
	Comment     string `json:"comment"`
}

AuditEndTimeRequest Audit End Time Request.

type BeforeDelMachineFunc

type BeforeDelMachineFunc func(c context.Context, id int64, username string) error

BeforeDelMachineFunc Before DelMachine Func.

type Cluster

type Cluster struct {
	ID                int64     `json:"id"`
	Name              string    `json:"name"`
	IsSupportSnapShot bool      `json:"is_support_snapshot"`
	Desc              string    `json:"desc"`
	IDc               string    `json:"idc"`
	Networks          []Network `json:"networks"`
	Resources         Resource  `json:"resources"`
}

Cluster cluster.

func (*Cluster) Verify

func (c *Cluster) Verify() error

Verify verify cluster

type Clusters

type Clusters struct {
	Items []*Cluster `json:"items"`
}

Clusters clusters.

type CreateInstance

type CreateInstance struct {
	Instance
	InstanceCreateStatus int `json:"instance_create_status"`
}

CreateInstance create instance.

func (*CreateInstance) ToMachine

func (i *CreateInstance) ToMachine(u string, gmr *GenMachinesRequest) (m *Machine)

ToMachine convert CreateInstance to Machine.

type DetailCondition

type DetailCondition struct {
	Initialized  string `json:"Initialized"`
	PodScheduled string `json:"PodScheduled"`
	Ready        string `json:"Ready"`
}

DetailCondition detail condition.

type Device

type Device struct {
	Serial      string `json:"serial"`
	Name        string `json:"name"`
	State       string `json:"state"`
	Mode        string `json:"mode"`
	Version     string `json:"version"`
	CPU         string `json:"cpu"`
	IsSimulator bool   `json:"isSimulator"`
}

Device Device.

type DeviceBootData

type DeviceBootData struct {
	WSRUL     string `json:"wsurl"`
	UploadURL string `json:"uploadURL"`
}

DeviceBootData Device Boot Data.

type DeviceBootRequest

type DeviceBootRequest struct {
	Serial string `json:"serial"`
}

DeviceBootRequest Device Boot Request.

type DeviceBootResponse

type DeviceBootResponse struct {
	Status *DeviceResponseStatus `json:"status"`
	Data   *DeviceBootData       `json:"data"`
}

DeviceBootResponse Device Boot Response.

type DeviceListData

type DeviceListData struct {
	Devices []*Device `json:"devices"`
}

DeviceListData Device List Data.

type DeviceListDetailData

type DeviceListDetailData struct {
	Devices *Device `json:"device"`
}

DeviceListDetailData Device List Detail Data.

type DeviceListDetailResponse

type DeviceListDetailResponse struct {
	Status *DeviceResponseStatus `json:"status"`
	Data   *DeviceListDetailData `json:"data"`
}

DeviceListDetailResponse Device List Detail Response.

type DeviceListResponse

type DeviceListResponse struct {
	Status *DeviceResponseStatus `json:"status"`
	Data   *DeviceListData       `json:"data"`
}

DeviceListResponse Device List Response.

type DeviceResponseStatus

type DeviceResponseStatus struct {
	Code   int    `json:"code"`
	Status string `json:"status"`
}

DeviceResponseStatus Device Response Status.

type DeviceShutDownResponse

type DeviceShutDownResponse struct {
	Status *DeviceResponseStatus `json:"status"`
}

DeviceShutDownResponse Device Shut Down Response.

type Env

type Env struct {
	ClusterID int64 `json:"cluster_id"`
	NetworkID int64 `json:"network_id"`
}

Env Env.

type EnvVariable

type EnvVariable struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

EnvVariable EnvVariable.

type ExcludeDataResponse

type ExcludeDataResponse struct {
	Status  int    `json:"status"`
	Message string `json:"message"`
}

ExcludeDataResponse no data field response.

func (*ExcludeDataResponse) CheckStatus

func (e *ExcludeDataResponse) CheckStatus() (err error)

CheckStatus check status.

type GenMachine

type GenMachine struct {
	Machine
	IP          string `json:"ip"`
	ClusterName string `json:"cluster_name"`
	NetworkName string `json:"network_name"`
}

GenMachine GenMachine.

type GenMachinesRequest

type GenMachinesRequest struct {
	Env
	PaasMachine
	PaasMachineSystem
	Nodes   []*Node `json:"nodes"`
	Comment string  `json:"comment"`
	Amount  int     `json:"amount"`
}

GenMachinesRequest Gen Machines Request.

func (*GenMachinesRequest) Mutator

func (g *GenMachinesRequest) Mutator(m *Machine)

Mutator Mutator.

func (*GenMachinesRequest) ToMachineNode

func (g *GenMachinesRequest) ToMachineNode(mID int64) (treeNodes []*MachineNode)

ToMachineNode to machine node.

func (GenMachinesRequest) ToPaasGenMachineRequest

func (g GenMachinesRequest) ToPaasGenMachineRequest(machineLimitRatio float32) *PaasGenMachineRequest

ToPaasGenMachineRequest to Paas GenMachine Request.

func (*GenMachinesRequest) Verify

func (g *GenMachinesRequest) Verify() error

Verify verify GenMachinesRequest.

type GetHubProjectDetailResponse

type GetHubProjectDetailResponse struct {
	ProjectID   int    `json:"project_id"`
	ProjectName string `json:"name"`
	RepoCount   int    `json:"repo_count"`
}

GetHubProjectDetailResponse GetHubProjectDetailResponse.

type Host

type Host struct {
	IP        string   `json:"ip"`
	Hostnames []string `json:"hostnames"`
}

Host Host.

type HubImageConf

type HubImageConf struct {
	ID        int64     `json:"id" gorm:"column:id"`
	ImageName string    `json:"image_name" gorm:"column:image_name"`
	UpdateBy  string    `json:"update_by" gorm:"column:update_by"`
	Command   string    `json:"command" gorm:"column:command"`
	Envs      string    `json:"environments" gorm:"column:environments"`
	Hosts     string    `json:"hosts" gorm:"column:hosts"`
	CTime     time.Time `json:"create_time" gorm:"column:ctime;default:current_timestamp"`
	UTime     time.Time `json:"update_time" gorm:"column:mtime;default:current_timestamp on update current_timestamp"`
}

HubImageConf Hub Image Conf

type HubImageLog

type HubImageLog struct {
	ID          int64     `json:"id" gorm:"column:id"`
	MachineID   int64     `json:"machine_id" gorm:"column:machine_id"`
	UserName    string    `json:"username" gorm:"column:username"`
	ImageSrc    string    `json:"image_src" gorm:"column:imagesrc"`
	ImageTag    string    `json:"image_tag" gorm:"column:imagetag"`
	Status      int       `json:"status" gorm:"column:status"`
	OperateType int       `json:"operate_type" gorm:"column:operate_type"`
	CTime       time.Time `json:"create_time" gorm:"column:ctime;default:current_timestamp"`
	UTime       time.Time `json:"update_time" gorm:"column:mtime;default:current_timestamp on update current_timestamp"`
}

HubImageLog Hub Image Log

func (*HubImageLog) AfterCreate

func (h *HubImageLog) AfterCreate(db *gorm.DB) (err error)

AfterCreate After Create.

type HubProject

type HubProject struct {
	ProjectID int    `json:"project_id"`
	Name      string `json:"name"`
	RepoCount int    `json:"repo_count"`
}

HubProject HubProject.

type HubRepo

type HubRepo struct {
	ProjectID      int    `json:"project_id"`
	ProjectName    string `json:"project_name"`
	ProjectPublic  bool   `json:"project_public"`
	RepositoryName string `json:"repository_name"`
	TagsCount      int    `json:"tags_count"`
}

HubRepo HubRepo.

type Image

type Image struct {
	ID          int64     `json:"id" gorm:"auto_increment;primary_key;column:id"`
	Name        string    `json:"name" gorm:"varchar(100);column:name"`
	Status      int       `json:"status" gorm:"not null;column:status"`
	OS          string    `json:"os" gorm:"not null;column:os"`
	Version     string    `json:"version" gorm:"not null;column:version"`
	Description string    `json:"description" gorm:"column:description"`
	CreatedBy   string    `json:"created_by" gorm:"column:created_by"`
	UpdatedBy   string    `json:"updated_by" gorm:"column:updated_by"`
	Ctime       time.Time `json:"ctime" gorm:"column:ctime;default:current_timestamp"`
	Utime       time.Time `json:"utime" gorm:"column:mtime;default:current_timestamp on update current_timestamp"`
}

Image Image.

type ImageConfiguration

type ImageConfiguration struct {
	ImageFullName string `json:"image_full_name"`
	PaasMachineSystem
}

ImageConfiguration Image Configuration.

type Instance

type Instance struct {
	InstanceName string `json:"instance_name"`
}

Instance instance.

type Machine

type Machine struct {
	ID           int64     `json:"id" gorm:"column:id"`
	Name         string    `json:"name" gorm:"column:name"`
	PodName      string    `json:"pod_name,omitempty" gorm:"column:pod_name"`
	Status       int       `json:"status" gorm:"column:status"`
	Username     string    `json:"username" gorm:"column:username"`
	BusinessUnit string    `json:"business_unit,omitempty" gorm:"column:business_unit"`
	Project      string    `json:"project,omitempty" gorm:"column:project"`
	App          string    `json:"app,omitempty" gorm:"column:app"`
	ClusterID    int64     `json:"cluster_id,omitempty" gorm:"column:cluster_id"`
	NetworkID    int64     `json:"network_id,omitempty" gorm:"column:network_id"`
	Ctime        time.Time `json:"ctime" gorm:"column:ctime;default:current_timestamp"`
	Utime        time.Time `json:"utime" gorm:"column:mtime;default:current_timestamp on update current_timestamp"`
	UpdateBy     string    `json:"update_by" gorm:"column:update_by"`
	EndTime      time.Time `json:"end_time" gorm:"column:end_time"`
	Comment      string    `json:"comment" gorm:"column:comment"`
	DelayStatus  int       `json:"delay_status" gorm:"column:delay_status"`
}

Machine Machine.

func (*Machine) AfterCreate

func (m *Machine) AfterCreate(db *gorm.DB) (err error)

AfterCreate After Create.

func (*Machine) IsBoot

func (m *Machine) IsBoot() bool

IsBoot Is Boot.

func (*Machine) IsCreating

func (m *Machine) IsCreating() bool

IsCreating Is Creating.

func (*Machine) IsDeleted

func (m *Machine) IsDeleted() bool

IsDeleted Is Deleted.

func (*Machine) IsFailed

func (m *Machine) IsFailed() bool

IsFailed Is Failed.

func (*Machine) IsShutdown

func (m *Machine) IsShutdown() bool

IsShutdown Is Shutdown.

func (*Machine) ToMachineLog

func (m *Machine) ToMachineLog() (ml *MachineLog)

ToMachineLog generate a machine log struct.

func (*Machine) ToPaasQueryAndDelMachineRequest

func (m *Machine) ToPaasQueryAndDelMachineRequest() (pqadmr *PaasQueryAndDelMachineRequest)

ToPaasQueryAndDelMachineRequest To Paas Query And Del Machine Request.

func (*Machine) ToTreeNode

func (m *Machine) ToTreeNode() *TreeNode

ToTreeNode return Tree node.

type MachineCountGroupByBusiness

type MachineCountGroupByBusiness struct {
	BusinessUnit string
	Count        int
}

MachineCountGroupByBusiness Machine Count Group By App.

type MachineCountGroupItem

type MachineCountGroupItem struct {
	Type string `json:"type"`
	Data []int  `json:"data"`
}

MachineCountGroupItem Machine Count Group Item.

type MachineCountGroupResponse

type MachineCountGroupResponse struct {
	BusinessUnits []string                 `json:"departmentList"`
	Items         []*MachineCountGroupItem `json:"items"`
}

MachineCountGroupResponse Machine Count Group Response.

type MachineCreatedAndEndTime

type MachineCreatedAndEndTime struct {
	ID          int64  `json:"id"`
	MachineName string `json:"machine_name"`
	App         string `json:"app"`
	Username    string `json:"username"`
	CreateTime  string `json:"created_time"`
	EndTime     string `json:"end_time"`
}

MachineCreatedAndEndTime Machine Created And End Time.

type MachineDetail

type MachineDetail struct {
	Machine
	PaasMachineDetail
	Nodes       []*MachineNode `json:"nodes"`
	NetworkName string         `json:"network_name"`
	Name        string         `json:"name"`
	IsSnapShot  bool           `json:"is_support_snapshot"`
}

MachineDetail Machine Detail.

type MachineEvent

type MachineEvent struct {
	MachinesItems []*MachinesItem `json:"Items"`
}

MachineEvent MachineEvent.

type MachineLendOutRecord

type MachineLendOutRecord struct {
	MachineID    int64     `json:"machine_id"`
	Lender       string    `json:"lender"`
	Status       int       `json:"status"`
	LendTime     time.Time `json:"lend_time"`
	EnableReturn bool      `json:"enable_return"`
}

MachineLendOutRecord Machine Lend Out Record.

type MachineLifeCycle

type MachineLifeCycle struct {
	Duration string `json:"duration_day"`
	Count    int    `json:"count"`
}

MachineLifeCycle Machine Life Cycle.

type MachineLog

type MachineLog struct {
	ID            int64     `json:"-" gorm:"column:id"`
	Username      string    `json:"username" gorm:"column:username"`
	MachineID     int64     `json:"machine_id" gorm:"column:machine_id"`
	OperateType   string    `json:"operate_type" gorm:"column:operation_type"`
	OperateResult string    `json:"operate_result" gorm:"column:operation_result"`
	OperateTime   time.Time `json:"operate_time" gorm:"column:ctime;default:current_timestamp"`
	UTime         time.Time `json:"-" gorm:"column:mtime;default:current_timestamp on update current_timestamp"`
}

MachineLog Machine Log.

type MachineNode

type MachineNode struct {
	ID           int64     `json:"id" gorm:"column:id"`
	MachineID    int64     `json:"machine_id" gorm:"column:machine_id"`
	BusinessUnit string    `json:"business_unit" gorm:"column:business_unit"`
	Project      string    `json:"project" gorm:"column:project"`
	App          string    `json:"app" gorm:"column:app"`
	TreeID       int64     `json:"tree_id,omitempty" gorm:"column:tree_id"`
	CTime        time.Time `json:"create_time" gorm:"column:ctime;default:current_timestamp"`
}

MachineNode the node is associated with machine.

type MachinePackage

type MachinePackage struct {
	ID              int64     `json:"id" gorm:"column:id"`
	Name            string    `json:"name" gorm:"column:name"`
	CPUCore         int       `json:"cpu_request" gorm:"column:cpu_core"`
	Memory          int       `json:"memory_request" gorm:"column:memory"`
	StorageCapacity int       `json:"disk_request" gorm:"column:storage_capacity"`
	CTime           time.Time `json:"ctime" gorm:"column:ctime;default:current_timestamp"`
	UTime           time.Time `json:"utime" gorm:"column:mtime;default:current_timestamp on update current_timestamp"`
}

MachinePackage MachinePackage.

type MachineStatus

type MachineStatus struct {
	Condition       string          `json:"condition"`
	Message         string          `json:"message"`
	DetailCondition DetailCondition `json:"detail_conditions"`
	InstanceIP      string          `json:"instance_ip"`
	RestartCount    int             `json:"restart_count"`
	Log             string          `json:"log"`
	MachineEvent    MachineEvent    `json:"events"`
}

MachineStatus machine status.

func (*MachineStatus) ToMachineStatusResponse

func (ms *MachineStatus) ToMachineStatusResponse() (msr *MachineStatusResponse)

ToMachineStatusResponse convert MachineStatus to MachineStatusResponse.

type MachineStatusResponse

type MachineStatusResponse struct {
	Initialized  string   `json:"initialized"`
	PodScheduled string   `json:"pod_scheduled"`
	Ready        string   `json:"ready"`
	SynTree      string   `json:"syn_tree"`
	RetryCount   int      `json:"retry_count"`
	Log          string   `json:"log"`
	MachineEvent []string `json:"events"`
}

MachineStatusResponse Machine Status Response.

func InstanceMachineStatusResponse

func InstanceMachineStatusResponse(machineStatus int) *MachineStatusResponse

InstanceMachineStatusResponse Instance Machine Status Response.

func (*MachineStatusResponse) CreatingMachineStatus

func (msr *MachineStatusResponse) CreatingMachineStatus() int

CreatingMachineStatus Creating Machine Status.

func (*MachineStatusResponse) FailedMachineStatus

func (msr *MachineStatusResponse) FailedMachineStatus() int

FailedMachineStatus Failed Machine Status.

type MachineUsage

type MachineUsage struct {
	ID            int64  `json:"id"`
	MachineName   string `json:"machine_name"`
	App           string `json:"app"`
	Username      string `json:"username"`
	CPURequest    int    `json:"cpu_request"`
	MemoryRequest int    `json:"memory_request"`
}

MachineUsage Machine Usage.

type MachinesItem

type MachinesItem struct {
	Kind      string `json:"Kind"`
	Name      string `json:"Name"`
	Namespace string `json:"Namespace"`
	Reason    string `json:"Reason"`
	Message   string `json:"Message"`
	Count     int    `json:"Count"`
	LastTime  string `json:"LastTime"`
}

MachinesItem MachinesItem.

type MailLog

type MailLog struct {
	ID           int64     `gorm:"column:id"`
	ReceiverName string    `gorm:"column:receiver_name"`
	MailType     int       `gorm:"column:mail_type"`
	SendHead     string    `gorm:"column:send_head"`
	SendContext  string    `gorm:"column:send_context"`
	SendTime     time.Time `gorm:"column:ctime;default:current_timestamp"`
	UTime        time.Time `gorm:"column:mtime;default:current_timestamp on update current_timestamp"`
}

MailLog MailLog.

type MobileCategory

type MobileCategory struct {
	CPUs     []string `json:"cpus"`
	Versions []string `json:"versions"`
	Modes    []string `json:"modes"`
	States   []string `json:"states"`
	Types    []int    `json:"types"`
	Usages   []int    `json:"usages"`
}

MobileCategory MobileCategory.

type MobileDeviceCategoryResponse

type MobileDeviceCategoryResponse struct {
	Name   string        `json:"name"`
	Label  string        `json:"label"`
	Values []interface{} `json:"values"`
}

MobileDeviceCategoryResponse MobileDeviceCategory Response.

type MobileImage

type MobileImage struct {
	ID       int64     `json:"id" gorm:"column:id"`
	Mode     string    `json:"mode" gorm:"column:mode"`
	CTime    time.Time `json:"ctime" gorm:"column:ctime;default:current_timestamp"`
	MTime    time.Time `json:"mtime" gorm:"column:mtime;default:current_timestamp"`
	ImageSrc string    `json:"image_src" gorm:"column:image_src"`
}

MobileImage Mobile Image.

type MobileMachine

type MobileMachine struct {
	ID           int64     `json:"id" gorm:"column:id"`
	Serial       string    `json:"serial" gorm:"column:serial"`
	Name         string    `json:"name" gorm:"column:name"`
	CPU          string    `json:"cpu" gorm:"column:cpu"`
	Version      string    `json:"version" gorm:"column:version"`
	Mode         string    `json:"mode" gorm:"column:mode"`
	State        string    `json:"state" gorm:"column:state"`
	Host         string    `json:"host" gorm:"column:host"`
	CTime        time.Time `json:"create_time" gorm:"column:ctime;default:current_timestamp"`
	MTime        time.Time `json:"update_time" gorm:"column:mtime;default:current_timestamp"`
	LastBindTime time.Time `json:"last_bind_time" gorm:"column:last_bind_time;default:current_timestamp"`
	OwnerName    string    `json:"owner_name" gorm:"column:owner_name"`
	Username     string    `json:"username" gorm:"column:username"`
	Type         int       `json:"type" gorm:"column:type"`
	EndTime      time.Time `json:"end_time" gorm:"column:end_time"`
	Alias        string    `json:"alias" gorm:"column:alias"`
	Comment      string    `json:"comment" gorm:"column:comment"`
	WsURL        string    `json:"wsurl" gorm:"column:wsurl"`
	UploadURL    string    `json:"upload_url" gorm:"column:upload_url"`
	Action       int       `json:"action" gorm:"column:action"`
	IsLendOut    int       `json:"is_lendout" gorm:"column:is_lendout"`
	UUID         string    `json:"uuid" gorm:"column:uuid"`
}

MobileMachine the node is associated with MobileMachine.

type MobileMachineErrorLog

type MobileMachineErrorLog struct {
	ID           int64     `json:"id" gorm:"column:id"`
	MachineID    int64     `json:"machine_id" gorm:"column:machine_id"`
	SerialName   string    `json:"serial" gorm:"column:serial"`
	ErrorMessage string    `json:"error_message" gorm:"column:error_message"`
	ErrorCode    int       `json:"error_code" gorm:"column:error_code"`
	CTime        time.Time `json:"create_time" gorm:"column:ctime;default:current_timestamp"`
	UTime        time.Time `json:"-" gorm:"column:mtime;default:current_timestamp on update current_timestamp"`
}

MobileMachineErrorLog Mobile Machine Error Log.

type MobileMachineLog

type MobileMachineLog struct {
	ID            int64     `json:"-" gorm:"column:id"`
	Username      string    `json:"username" gorm:"column:username"`
	MachineID     int64     `json:"machine_id" gorm:"column:machine_id"`
	OperateType   string    `json:"operate_type" gorm:"column:operation_type"`
	OperateResult string    `json:"operate_result" gorm:"column:operation_result"`
	OperateTime   time.Time `json:"operate_time" gorm:"column:ctime;default:current_timestamp"`
	UTime         time.Time `json:"-" gorm:"column:mtime;default:current_timestamp on update current_timestamp"`
}

MobileMachineLog Mobile Machine Log.

type MobileMachineResponse

type MobileMachineResponse struct {
	*MobileMachine
	ImageSrc string `json:"image_src"`
}

MobileMachineResponse MobileMachine Response.

type MobileMachineTypeCount

type MobileMachineTypeCount struct {
	ModeName string `json:"mode_name"`
	Count    int    `json:"count"`
}

MobileMachineTypeCount Mobile Machine Type Count.

type MobileMachineUsageCount

type MobileMachineUsageCount struct {
	MobileMachineID   string `json:"mobile_machine_id"`
	MobileMachineName string `json:"mobile_machine_name"`
	Count             int    `json:"count"`
}

MobileMachineUsageCount Mobile Machine Usage Count.

type MobileMachineUsageTime

type MobileMachineUsageTime struct {
	//MobileMachineID   int64     `json:"mobile_machine_id"`
	//MobileMachineName string    `json:"mobile_machine_name"`
	//ModeName          string    `json:"mode_name"`
	Username  string    `json:"username"`
	StartTime time.Time `json:"start_time"`
	EndTime   time.Time `json:"end_time"`
	Duration  float64   `json:"duration_minutes"`
}

MobileMachineUsageTime Mobile Machine Usage Time.

type MobileMachineUsageTimeResponse

type MobileMachineUsageTimeResponse struct {
	MobileMachineID         int64                     `json:"mobile_machine_id"`
	MobileMachineName       string                    `json:"mobile_machine_name"`
	ModeName                string                    `json:"mode_name"`
	TotalDuration           float64                   `json:"total_duration_minutes"`
	MobileMachinesUsageTime []*MobileMachineUsageTime `json:"machine_usage_record"`
}

MobileMachineUsageTimeResponse Mobile Machine Usage Time Response.

type MobileMachineUserUsageCount

type MobileMachineUserUsageCount struct {
	Username string `json:"username"`
	Count    int    `json:"count"`
}

MobileMachineUserUsageCount Mobile Machine user Usage Count.

type MobileSyncLog

type MobileSyncLog struct {
	ID        int64     `json:"id" gorm:"column:id"`
	UUID      string    `json:"uuid" gorm:"column:uuid"`
	AddCnt    int       `json:"add_count" gorm:"column:add_count"`
	UpdateCnt int       `json:"update_count" gorm:"column:update_count"`
	DeleteCnt int       `json:"delete_count" gorm:"column:delete_count"`
	TotalCnt  int       `json:"total_count" gorm:"column:total_count"`
	Status    int       `json:"status" gorm:"column:status"`
	CTime     time.Time `json:"ctime" gorm:"column:ctime;default:current_timestamp"`
	MTime     time.Time `json:"mtime" gorm:"column:mtime;default:current_timestamp"`
}

MobileSyncLog MobileSyncLog.

type MsgSendReq

type MsgSendReq struct {
	Chatid  string         `json:"chatid" form:"chatid"`
	Msgtype string         `json:"msgtype" form:"msgtype"`
	Text    MsgSendReqText `json:"text" form:"test"`
	Safe    int            `json:"safe" form:"safe"`
}

MsgSendReq message send request of wechat

type MsgSendReqText

type MsgSendReqText struct {
	Content string `json:"content"`
}

MsgSendReqText MegSendReq test

type MsgSendRes

type MsgSendRes struct {
	Code    int                  `json:"code"`
	Message string               `json:"message"`
	TTL     int                  `json:"ttl"`
	Data    WechatMegSendResData `json:"data"`
}

MsgSendRes message send response

type Network

type Network struct {
	ID       int64   `json:"id"`
	Name     string  `json:"name"`
	Subnet   string  `json:"subnet"`
	Capacity float64 `json:"capacity"`
}

Network network.

type Node

type Node struct {
	BusinessUnit string `json:"business_unit"`
	Project      string `json:"project"`
	App          string `json:"app"`
	TreeID       int64  `json:"tree_id"`
}

Node Node.

type PaasAuthInfo

type PaasAuthInfo struct {
	Token      string `json:"token"`
	PlatformID string `json:"platform_id"`
	Username   string `json:"user_name"`
	Secret     string `json:"secret"`
	Expired    int64  `json:"expired"`
	Admin      bool   `json:"admin"`
}

PaasAuthInfo auth information.

type PaasAuthRequest

type PaasAuthRequest struct {
	APIToken   string `json:"api_token"`
	PlatformID string `json:"platform_id"`
}

PaasAuthRequest auth request.

type PaasAuthResponse

type PaasAuthResponse struct {
	ExcludeDataResponse
	Data PaasAuthInfo `json:"data"`
}

PaasAuthResponse auth response.

type PaasConf

type PaasConf struct {
	Host              string
	Token             string
	MachineTimeout    string
	MachineLimitRatio float32
}

PaasConf conf of paas.

type PaasDelMachineResponse

type PaasDelMachineResponse struct {
	ExcludeDataResponse
	Data ReleaseInstance `json:"data"`
}

PaasDelMachineResponse delete machine response in paas.

type PaasGenMachineRequest

type PaasGenMachineRequest struct {
	Env
	BusinessUnit string        `json:"business_unit"`
	Project      string        `json:"project"`
	App          string        `json:"app"`
	TreeIDs      []int64       `json:"tree_id"`
	Machines     []PaasMachine `json:"machines"`
}

PaasGenMachineRequest create machine request in paas.

type PaasGenMachineResponse

type PaasGenMachineResponse struct {
	ExcludeDataResponse
	Data []*CreateInstance `json:"data"`
}

PaasGenMachineResponse create machine response in paas.

type PaasMachine

type PaasMachine struct {
	PaasMachineSystem
	Name          string  `json:"name"`
	Image         string  `json:"image"`
	CPURequest    float32 `json:"cpu_request"`
	MemoryRequest float32 `json:"memory_request"`

	CPULimit    float32 `json:"cpu_limit"`
	MemoryLimit float32 `json:"memory_limit"`

	DiskRequest    int    `json:"disk_request"`
	VolumnMount    string `json:"volumn_mount"`
	Snapshot       bool   `json:"snapshot"`
	ForcePullImage bool   `json:"force_pull_image"`
}

PaasMachine machine in paas.

func (*PaasMachine) ToMachine

func (pm *PaasMachine) ToMachine(u string, gmr *GenMachinesRequest) (m *Machine)

ToMachine convert PaasMachine to Machine.

type PaasMachineDetail

type PaasMachineDetail struct {
	Condition string `json:"condition"`
	Name      string `json:"name"`
	Image     string `json:"image"`

	CPURequest    float32 `json:"cpu_request"`
	MemoryRequest float32 `json:"memory_request"`

	CPULimit    float32 `json:"cpu_limit"`
	MemoryLimit float32 `json:"memory_limit"`

	DiskRequest int    `json:"disk_request"`
	VolumnMount string `json:"volumn_mount"`
	ClusterName string `json:"cluster_name"`
	Env         string `json:"env"`
	IP          string `json:"ip"`
	PaasMachineSystem
}

PaasMachineDetail machine detail.

func (PaasMachineDetail) ConvertUnits

func (p PaasMachineDetail) ConvertUnits() PaasMachineDetail

ConvertUnits convert units of cpu and memory.

type PaasMachineSystem

type PaasMachineSystem struct {
	Command   string         `json:"command"`
	Envs      []*EnvVariable `json:"envs"`
	HostAlias []*Host        `json:"host_alias"`
}

PaasMachineSystem Paas Machine System.

type PaasQueryAndDelMachineRequest

type PaasQueryAndDelMachineRequest struct {
	BusinessUnit string `json:"business_unit"`
	Project      string `json:"project"`
	App          string `json:"app"`
	ClusterID    int64  `json:"cluster_id"`
	Name         string `json:"name"`
}

PaasQueryAndDelMachineRequest query and del machines request.

type PaasQueryClusterResponse

type PaasQueryClusterResponse struct {
	ExcludeDataResponse
	Data *Cluster `json:"data"`
}

PaasQueryClusterResponse query cluster response.

type PaasQueryClustersResponse

type PaasQueryClustersResponse struct {
	ExcludeDataResponse
	Data Clusters `json:"data"`
}

PaasQueryClustersResponse query cluster response.

type PaasQueryMachineResponse

type PaasQueryMachineResponse struct {
	ExcludeDataResponse
	Data PaasMachineDetail `json:"data"`
}

PaasQueryMachineResponse query machine response.

type PaasQueryMachineStatusResponse

type PaasQueryMachineStatusResponse struct {
	ExcludeDataResponse
	Data MachineStatus `json:"data"`
}

PaasQueryMachineStatusResponse query machine status response.

type PaasSnapshotMachineResponse

type PaasSnapshotMachineResponse struct {
	ExcludeDataResponse
	Data string `json:"data"`
}

PaasSnapshotMachineResponse Paas Snapshot Machine Response.

type PaasUpdateMachineNodeRequest

type PaasUpdateMachineNodeRequest struct {
	PaasQueryAndDelMachineRequest
	TreeID []int64 `json:"tree_id"`
}

PaasUpdateMachineNodeRequest update machine request.

func NewPaasUpdateMachineNodeRequest

func NewPaasUpdateMachineNodeRequest(p *PaasQueryAndDelMachineRequest, ns []*MachineNode) *PaasUpdateMachineNodeRequest

NewPaasUpdateMachineNodeRequest new PaasUpdateMachineNodeRequest

type PaasUpdateMachineNodeResponse

type PaasUpdateMachineNodeResponse struct {
	ExcludeDataResponse
	Data string `json:"data"`
}

PaasUpdateMachineNodeResponse update machine response.

type PaginateApplicationRecord

type PaginateApplicationRecord struct {
	Total              int64                `json:"total"`
	PageNum            int                  `json:"page_num"`
	PageSize           int                  `json:"page_size"`
	ApplicationRecords []*ApplicationRecord `json:"application_records"`
}

PaginateApplicationRecord Paginate Application Record.

type PaginateHubImageLog

type PaginateHubImageLog struct {
	Total        int64          `json:"total"`
	PageNum      int            `json:"page_num"`
	PageSize     int            `json:"page_size"`
	HubImageLogs []*HubImageLog `json:"hub_image_logs"`
}

PaginateHubImageLog Paginate Hub Image Log.

type PaginateMachine

type PaginateMachine struct {
	Total    int64        `json:"total"`
	PageNum  int          `json:"page_num"`
	PageSize int          `json:"page_size"`
	Machines []GenMachine `json:"machines"`
}

PaginateMachine Paginate Machine.

type PaginateMachineLog

type PaginateMachineLog struct {
	Total       int64               `json:"total"`
	PageNum     int                 `json:"page_num"`
	PageSize    int                 `json:"page_size"`
	MachineLogs []*AboundMachineLog `json:"machine_logs"`
}

PaginateMachineLog Paginate Machine Log.

type PaginateMobileMachineErrorLog

type PaginateMobileMachineErrorLog struct {
	Total       int64                    `json:"total"`
	PageNum     int                      `json:"page_num"`
	PageSize    int                      `json:"page_size"`
	MachineLogs []*MobileMachineErrorLog `json:"machine_logs"`
}

PaginateMobileMachineErrorLog Paginate Mobile Machine Error Log.

type PaginateMobileMachineLendOutLog

type PaginateMobileMachineLendOutLog struct {
	Total                 int64                   `json:"total"`
	PageNum               int                     `json:"page_num"`
	PageSize              int                     `json:"page_size"`
	MachineLendOutRecords []*MachineLendOutRecord `json:"machine_lendout_records"`
}

PaginateMobileMachineLendOutLog Paginate Mobile Machine Lend Out Log.

type PaginateMobileMachineLog

type PaginateMobileMachineLog struct {
	Total       int64                     `json:"total"`
	PageNum     int                       `json:"page_num"`
	PageSize    int                       `json:"page_size"`
	MachineLogs []*AboundMobileMachineLog `json:"machine_logs"`
}

PaginateMobileMachineLog Paginate Mobile Machine Log.

type PaginateMobileMachines

type PaginateMobileMachines struct {
	Total          int64                    `json:"total"`
	PageNum        int                      `json:"page_num"`
	PageSize       int                      `json:"page_size"`
	MobileMachines []*MobileMachineResponse `json:"mobile_devices"`
}

PaginateMobileMachines Paginate Device.

type PaginateProjectRepoRecord

type PaginateProjectRepoRecord struct {
	Total             int                  `json:"total"`
	PageNum           int                  `json:"page_num"`
	PageSize          int                  `json:"page_size"`
	ProjectRepository []*ProjectRepository `json:"project_repositories"`
}

PaginateProjectRepoRecord PaginateProjectRepoRecord.

type Pagination

type Pagination struct {
	PageSize int `form:"page_size" json:"page_size"`
	PageNum  int `form:"page_num" json:"page_num"`
}

Pagination Pagination.

func (*Pagination) Verify

func (p *Pagination) Verify() error

Verify verify the value of pageNum and pageSize.

type ProjectRepository

type ProjectRepository struct {
	RepositoryID   int    `json:"id"`
	RepositoryName string `json:"name"`
	TagCount       int    `json:"tags_count"`
	CreateTime     string `json:"creation_time"`
	UpdateTime     string `json:"update_time"`
}

ProjectRepository ProjectRepository.

type ProjectRepositoryRequest

type ProjectRepositoryRequest struct {
	ProjectRepository []*ProjectRepository
}

ProjectRepositoryRequest ProjectRepositoryRequest.

type QueryMachine2ImageLogRequest

type QueryMachine2ImageLogRequest struct {
	Pagination
	MachineID int64 `form:"machine_id"`
}

QueryMachine2ImageLogRequest Query Machine to Image Log Request.

type QueryMachineLogRequest

type QueryMachineLogRequest struct {
	Pagination
	MachineID   int64  `form:"machine_id"`
	MachineName string `form:"machine_name"`
	OperateUser string `form:"operate_user"`
	OperateType string `form:"operate_type"`
}

QueryMachineLogRequest Query Machine Log Request.

type QueryMachineRequest

type QueryMachineRequest struct {
	Pagination
	TreeNode
	MachineName string `form:"machine_name"`
	Username    string `form:"username"`
	Requester   string
}

QueryMachineRequest Query Machine Request.

type QueryMobileDeviceRequest

type QueryMobileDeviceRequest struct {
	Pagination
	MobileID  int64  `json:"mobile_id"`
	Serial    string `json:"serial"`
	Name      string `json:"name"`
	Username  string `json:"username"`
	OwnerName string `json:"owner_name"`
	CPU       string `json:"cpu"`
	Version   string `json:"version"`
	Mode      string `json:"mode"`
	Type      int    `json:"type"`
	State     string `json:"state"`
	Usage     int    `json:"usage"`
	Online    bool   `json:"online"`
}

QueryMobileDeviceRequest Query Device Farm Request.

type QueryMobileMachineErrorLogRequest

type QueryMobileMachineErrorLogRequest struct {
	Pagination
	MachineID int64 `form:"machine_id"`
}

QueryMobileMachineErrorLogRequest Query Mobile Machine Error Log Request.

type QueryMobileMachineLogRequest

type QueryMobileMachineLogRequest struct {
	Pagination
	MachineID   int64  `form:"machine_id"`
	Serial      string `form:"serial"`
	OperateUser string `form:"operate_user"`
	OperateType string `form:"operate_type"`
}

QueryMobileMachineLogRequest Query Mobile Machine Log Request.

type ReleaseInstance

type ReleaseInstance struct {
	Instance
	InstanceReleaseStatus int `json:"instance_release_status"`
}

ReleaseInstance release instance.

type RepositoryTag

type RepositoryTag struct {
	RepositoryTagResponse
	ImageFullName string `json:"image_full_name"`
}

RepositoryTag Repository Tag.

type RepositoryTagResponse

type RepositoryTagResponse struct {
	Digest  string `json:"digest"`
	Name    string `json:"name"`
	OS      string `json:"os"`
	Size    int64  `json:"size"`
	Created string `json:"created"`
}

RepositoryTagResponse Repository Tag Response.

type Resource

type Resource struct {
	CPUUsage    float64 `json:"cpu_usage"`    //集群总体CPU使用率
	MemUsage    float64 `json:"mem_usage"`    //集群总体内存使用率
	PodTotal    int     `json:"pod_total"`    //集群实例总数
	PodCapacity int     `json:"pod_capacity"` //集群实例容量
	NodesNum    int     `json:"nodes_num"`    //集群节点数量
}

Resource resource.

type SearchHubResponse

type SearchHubResponse struct {
	Repository []*HubRepo `json:"repository"`
}

SearchHubResponse Search Hub Response.

type Snapshot

type Snapshot struct {
	ID        int64     `gorm:"column:id"`
	Name      string    `gorm:"column:name"`
	MachineID int64     `gorm:"column:machine_id"`
	UserID    int64     `gorm:"column:user_id"`
	Ctime     time.Time `json:"ctime" gorm:"column:ctime;default:current_timestamp"`
	Utime     time.Time `json:"utime" gorm:"column:mtime;default:current_timestamp on update current_timestamp"`
	UpdateBy  int       `gorm:"column:update_by"`
	Comment   string    `gorm:"column:comment"`
}

Snapshot Snapshot.

type SnapshotLog

type SnapshotLog struct {
	ID            int64     `gorm:"column:id"`
	UserID        int64     `gorm:"column:user_id"`
	SnapshotID    int64     `gorm:"column:snapshot_id"`
	OperateType   string    `gorm:"column:operation_type"`
	OperateResult int       `gorm:"column:operation_result"`
	OperateTime   time.Time `gorm:"column:operation_time;default:current_timestamp"`
}

SnapshotLog Snapshot Log.

type SnapshotRecord

type SnapshotRecord struct {
	ID        int64     `json:"id" gorm:"column:id"`
	MachineID int64     `json:"machine_id" gorm:"column:machine_id"`
	Username  string    `json:"username" gorm:"column:username"`
	ImageName string    `json:"image_name" gorm:"column:image_name"`
	Status    string    `json:"status" gorm:"column:status"`
	Ctime     time.Time `json:"ctime" gorm:"column:ctime;default:current_timestamp"`
	MTime     time.Time `json:"mtime" gorm:"column:mtime;default:current_timestamp on update current_timestamp"`
}

SnapshotRecord Snapshot Record

type Task

type Task struct {
	ID          int64     `gorm:"column:id"`
	TYPE        string    `gorm:"column:type"`
	ExecuteTime time.Time `gorm:"column:execute_time"`
	MachineID   int64     `gorm:"column:machine_id"`
	Status      int       `gorm:"column:status"`
	Ctime       time.Time `gorm:"column:ctime;default:current_timestamp"`
	UTime       time.Time `gorm:"column:mtime;default:current_timestamp on update current_timestamp"`
}

Task Task.

type TreeAppInstance

type TreeAppInstance struct {
	HostName string `json:"hostname"`
}

TreeAppInstance Tree App Instance.

type TreeAppInstanceRequest

type TreeAppInstanceRequest struct {
	Paths []string `json:"paths"`
}

TreeAppInstanceRequest Tree App Instance Request.

type TreeAppInstanceResponse

type TreeAppInstanceResponse struct {
	Code int                           `json:"code"`
	Data map[string][]*TreeAppInstance `json:"data"`
}

TreeAppInstanceResponse Tree App Instance Response.

type TreeConf

type TreeConf struct {
	Host   string
	Key    string
	Secret string
}

TreeConf tree conf.

type TreeInstance

type TreeInstance struct {
	HostName     string `json:"hostname"`
	IP           string `json:"ip"`
	InstanceType string `json:"instance_type"`
	InternalIP   string `json:"internal_ip"`
	ServiceIP    string `json:"service_ip"`
	ExtendIP     string `json:"extend_ip"`
}

TreeInstance Tree Instance.

type TreeInstanceRequest

type TreeInstanceRequest struct {
	Path          string `query:"path"`
	PathFuzzy     string `query:"path_fuzzy"`
	Hostname      string `query:"hostname"`
	HostnameFuzzy string `query:"hostname_fuzzy"`
	HostnameRegex string `query:"hostname_regex"`
}

TreeInstanceRequest request for hostname.

func (TreeInstanceRequest) ToQueryURI

func (tir TreeInstanceRequest) ToQueryURI() string

ToQueryURI convert field to uri.

type TreeInstancesResponse

type TreeInstancesResponse struct {
	Code int                      `json:"code"`
	Data map[string]*TreeInstance `json:"data"`
}

TreeInstancesResponse Tree Instance Response.

type TreeMachinesResponse

type TreeMachinesResponse struct {
	Code int      `json:"code"`
	Data []string `json:"data"`
}

TreeMachinesResponse Tree Machines Response.

type TreeNode

type TreeNode struct {
	BusinessUnit string `form:"business_unit"`
	Project      string `form:"project"`
	App          string `form:"app"`
}

TreeNode tree node struct for merlin.

func (*TreeNode) TreePath

func (t *TreeNode) TreePath() string

TreePath join all fields.

func (*TreeNode) TreePathWithoutEmptyField

func (t *TreeNode) TreePathWithoutEmptyField() (treePath string)

TreePathWithoutEmptyField join all fields except empty.

func (TreeNode) VerifyFieldValue

func (t TreeNode) VerifyFieldValue() (err error)

VerifyFieldValue verify that all fields is not empty.

type TreePlatformTokenRequest

type TreePlatformTokenRequest struct {
	UserName   string `json:"user_name"`
	PlatformID string `json:"platform_id"`
}

TreePlatformTokenRequest Tree Platform Token Request.

type TreeResponse

type TreeResponse struct {
	Code int      `json:"code"`
	Data UserTree `json:"data"`
}

TreeResponse Tree Response.

type TreeRole

type TreeRole struct {
	UserName string `json:"user_name"`
	Role     int    `json:"role"`
	OldRole  int    `json:"old_role"`
	RdSre    bool   `json:"rd_sre"`
}

TreeRole Tree Role.

type TreeRoleResponse

type TreeRoleResponse struct {
	Code int         `json:"code"`
	Data []*TreeRole `json:"data"`
}

TreeRoleResponse Tree Role Response.

type TreeSonResponse

type TreeSonResponse struct {
	Code int                    `json:"code"`
	Data map[string]interface{} `json:"data"`
}

TreeSonResponse Tree Son Response.

type UpdateMachineNodeRequest

type UpdateMachineNodeRequest struct {
	MachineID int64          `json:"machine_id"`
	Nodes     []*MachineNode `json:"nodes"`
}

UpdateMachineNodeRequest request struct for updating machine node.

func (UpdateMachineNodeRequest) ToMachineNodes

func (u UpdateMachineNodeRequest) ToMachineNodes() []*MachineNode

ToMachineNodes convert to machine nodes with injecting machine id.

func (*UpdateMachineNodeRequest) VerifyNodes

func (u *UpdateMachineNodeRequest) VerifyNodes() error

VerifyNodes verify the Nodes field of UpdateMachineNodeRequest

type User

type User struct {
	ID    int64     `json:"id" gorm:"auto_increment;primary_key;column:id"`
	Name  string    `json:"username" gorm:"column:name"`
	EMail string    `json:"email" gorm:"column:email"`
	CTime time.Time `gorm:"column:ctime;default:current_timestamp"`
	UTime time.Time `gorm:"column:mtime;default:current_timestamp on update current_timestamp"`
}

User User.

type UserTree

type UserTree struct {
	Bilibili map[string]interface{} `json:"bilibili"`
}

UserTree User Tree.

type WechatMegSendResData

type WechatMegSendResData struct {
	Errcode int    `json:"errcode"`
	Errmsg  string `json:"errmsg"`
}

WechatMegSendResData message send response data of wechat

Jump to

Keyboard shortcuts

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