Documentation ¶
Index ¶
- Constants
- func AppNameDuplicateChecker(ctx iris.Context)
- func ApplyVersion(ctx iris.Context)
- func CPUCheck(c iris.Context)
- func ConfigDeployment(version_config model.VersionConfig) *appsv1b1.Deployment
- func ConfigService(version_config model.VersionConfig) *apiv1.Service
- func ConfirmUser(ctx iris.Context)
- func CreateApp(ctx iris.Context)
- func CreateNS(ctx iris.Context)
- func CreateService(ctx iris.Context)
- func CreateUser(ctx iris.Context)
- func CreateVersion(ctx iris.Context)
- func DeleteApp(ctx iris.Context)
- func DeleteDeploymentAndServiceInCluster(version_config model.VersionConfig) error
- func DeleteNS(ctx iris.Context)
- func DeleteService(ctx iris.Context)
- func DeleteUser(ctx iris.Context)
- func DeleteVersion(ctx iris.Context)
- func DiskCheck(c iris.Context)
- func GetApp(ctx iris.Context)
- func GetAppList(ctx iris.Context)
- func GetCommandOutput(ns, pod_name, container_name string, cmd []string) (string, error)
- func GetLog(ctx iris.Context)
- func GetPod(ctx iris.Context)
- func GetService(ctx iris.Context)
- func GetServiceList(ctx iris.Context)
- func GetUser(ctx iris.Context)
- func GetUserList(ctx iris.Context)
- func GetVersion(ctx iris.Context)
- func GetVersionList(ctx iris.Context)
- func Handle404(ctx iris.Context)
- func HealthCheck(c iris.Context)
- func ListNS(ctx iris.Context)
- func RAMCheck(c iris.Context)
- func ResendMail(ctx iris.Context)
- func Scale(ctx iris.Context)
- func SendResponse(c iris.Context, err error, data interface{})
- func ServiceNameDuplicateChecker(ctx iris.Context)
- func SignToken(ctx iris.Context)
- func Terminal(ctx iris.Context)
- func UnapplyVersion(ctx iris.Context)
- func UpdateApp(ctx iris.Context)
- func UpdateService(ctx iris.Context)
- func UpdateUser(ctx iris.Context)
- func UpdateVersion(ctx iris.Context)
- func UserInfoDuplicateChecker(ctx iris.Context)
- type Nsmsg
- type PodMessage
Constants ¶
const ( B = 1 KB = 1024 * B MB = 1024 * KB GB = 1024 * MB )
Variables ¶
This section is empty.
Functions ¶
func AppNameDuplicateChecker ¶
check whether a app name exist in db
func ApplyVersion ¶
the ApplyVersion handler to apply a version config that created before. this handler will replace a version with the specified one, that is to remove the resources of the previous version config and then create the resources about the specified version config
func CPUCheck ¶
@Summary Checks the cpu usage @Description Checks the cpu usage @Tags sd @Accept json @Produce json @Success 200 {string} plain "CRITICAL - Load average: 1.78, 1.99, 2.02 | Cores: 2" @Router /sd/cpu [get]
func ConfigDeployment ¶
func ConfigDeployment(version_config model.VersionConfig) *appsv1b1.Deployment
config the Deployment with version_config struct and return the pointer of the deployment object
func ConfigService ¶
func ConfigService(version_config model.VersionConfig) *apiv1.Service
config the service with the version_config struct and return the pointer of the service object
func ConfirmUser ¶
func CreateUser ¶
func CreateVersion ¶
the CreateVersion handler just to create a version config and store it to database and it doesn't create any resources in the cluster, you can create resources by applying one version config that created before. That is to send a request to the ApplyVersion handler
func DeleteApp ¶
delete an app, dangerous action. it will delete all the resources which belongs to this app. such as services,versions and the deployment,service in the cluster
func DeleteDeploymentAndServiceInCluster ¶
func DeleteDeploymentAndServiceInCluster(version_config model.VersionConfig) error
func DeleteService ¶
delete a service by id, dangerous action. If the service has active version, then we will delete the active version's deployment and service in the cluster, and all the version records of the service including the service record itself. If the service not have a active version,that is to say there is no deployment and service of the service that asked to delete in the cluster, so we will just to delete all the version records of the service including the service record itself.
func DeleteUser ¶
func DeleteVersion ¶
the DeleteVersion handler will delete the version config information first, if the version config that requested to be deleted is being used at that time, then the resources about the version config will be removed in the cluster too.
func DiskCheck ¶
@Summary Checks the disk usage @Description Checks the disk usage @Tags sd @Accept json @Produce json @Success 200 {string} plain "OK - Free space: 17233MB (16GB) / 51200MB (50GB) | Used: 33%" @Router /sd/disk [get]
func GetCommandOutput ¶
func GetServiceList ¶
get all services or services that belongs to an app
func GetUserList ¶
func GetVersion ¶
the GetVersion handler is to get detail information of a version
func GetVersionList ¶
the GetVersionList handler can get all the Version config information in the database or just to get the version config that belongs to one service.
func HealthCheck ¶
@Summary Shows OK as the ping-pong result @Description Shows OK as the ping-pong result @Tags sd @Accept json @Produce json @Success 200 {string} plain "OK" @Router /sd/health [get]
func RAMCheck ¶
@Summary Checks the ram usage @Description Checks the ram usage @Tags sd @Accept json @Produce json @Success 200 {string} plain "OK - Free space: 402MB (0GB) / 8192MB (8GB) | Used: 4%" @Router /sd/ram [get]
func SendResponse ¶
func ServiceNameDuplicateChecker ¶
check whether a service name exist in db
func UnapplyVersion ¶
the UnapplyVersion handler just to STOP a being used Version config, that is to delete the resources of the version config in the cluster, but the version config information is still exist in the database, so you can apply it to create the resources again.
func UpdateService ¶
update app_id or/and svc_name or/and svc_desc
func UpdateUser ¶
Types ¶
type Nsmsg ¶
type Nsmsg struct { Name string `json:"name"` Status v1.NamespacePhase `json:"status"` CreateTime string `json:"create_time"` }
type PodMessage ¶
type PodMessage struct { PodName string `json:"pod_name"` Containers []string `json:"containers"` PodStatus v1.PodPhase `json:"pod_status"` PodLabels map[string]string `json:"pod_labels"` }
直接返回pods *v1.PodList会返回太多无用信息,所以这里做了一层过滤,只选择其中有用的信息 以减少带宽和响应时间。如需增加其他信息,修改PodMessage结构和SelectMessage函数即可