common

package
v0.0.0-...-8019898 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: MulanPSL-2.0 Imports: 0 Imported by: 0

Documentation

Overview

提供公共数据结构定义

Index

Constants

View Source
const (
	ServiceActiveStatusRunning  = "running"
	ServiceActiveStatusExited   = "exited"
	ServiceActiveStatusWaiting  = "waiting"
	ServiceActiveStatusInactive = "inactive"
	ServiceActiveStatusUnknown  = "unknown"

	ServiceLoadedStatusEnabled  = "enabled"
	ServiceLoadedStatusDisabled = "disabled"
	ServiceLoadedStatusStatic   = "static"
	ServiceLoadedStatusMask     = "mask"
	ServiceLoadedStatusUnknown  = "unknown"
)
View Source
const (
	ServiceUnit   = "service"
	SocketUnit    = "socket"
	TargetUnit    = "target"
	MountUnit     = "mount"
	AutomountUnit = "automount"
	PathUnit      = "path"
	TimeUnit      = "time"
)
View Source
const (
	// 插件正在运行
	StatusRunning = "running"
	// 插件已加载,但未运行
	StatusLoaded = "loaded"
	// 插件离线,无法访问
	StatusOffline = "offline"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Batch

type Batch struct {
	BatchUUID     string   `json:"batch_id"`
	DepartmentIDs []string `json:"department_ids"`
	MachineUUIDs  []string `json:"machine_uuids"`
}

type MachineNode

type MachineNode struct {
	UUID       string `json:"uuid"`
	Department string `json:"department"`
	IP         string `json:"ip"`
	CPUArch    string `json:"cpu_arch"`
	OS         string `json:"os"`
	State      int    `json:"state"`
}

type Result

type Result struct {
	Code    int              `json:"code"`
	Mseeage string           `json:"msg"`
	Data    []*ServiceResult `json:"data"`
}

type ServiceInfo

type ServiceInfo struct {
	ServiceName            string
	UnitName               string
	UnitType               string
	ServicePath            string //配置文件放置的目录
	ServiceAfter           string //在什么服务启动后启动
	ServiceBefore          string //在什么服务启动前启动
	ServiceRequires        string //需要的daemon
	ServiceWants           string //与requires相反
	ServiceEnvironmentFile string //启动脚本的环境配置文件
	ServiceExectStart      string //实际执行daemon的指令或脚本程序
}

type ServiceResult

type ServiceResult struct {
	MachineUUID         string
	MachineIP           string
	ServiceActiveStatus string
	ServiceLoadedStatus string
	ServiceSample       ServiceInfo
}

type ServiceStruct

type ServiceStruct struct {
	Batch       *Batch `json:"batch"`
	ServiceName string `json:"service"`
}

Jump to

Keyboard shortcuts

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