rainbond: github.com/goodrain/rainbond/worker/discover/model Index | Files

package model

import "github.com/goodrain/rainbond/worker/discover/model"

Index

Package Files

model.go

func StrategyIsValid Uses

func StrategyIsValid(strategy []string, serviceDeployType string) bool

StrategyIsValid 验证策略是否有效 策略包括以下值: prestart 先启动后关闭 prestop 先关闭后启动 rollingupdate 滚动形式 grayupdate 灰度形式 bluegreenupdate 蓝绿形式

type ApplyPluginConfigTaskBody Uses

type ApplyPluginConfigTaskBody struct {
    ServiceID string `json:"service_id"`
    PluginID  string `json:"plugin_id"`
    EventID   string `json:"event_id"`
    //Action put delete
    Action string `json:"action"`
}

ApplyPluginConfigTaskBody apply plugin dynamic discover config

type ApplyRuleTaskBody Uses

type ApplyRuleTaskBody struct {
    ServiceID     string `json:"service_id"`
    DeployVersion string `json:"deploy_version"`
    EventID       string `json:"event_id"`
    ServiceKind   string `json:"service_kind"`
    Action        string `json:"action"`
    Port          int    `json:"port"`
    IsInner       bool   `json:"is_inner"`
}

ApplyRuleTaskBody contains information for ApplyRuleTask

type DefaultTaskBody Uses

type DefaultTaskBody map[string]interface{}

DefaultTaskBody 默认操作任务主体

type DeleteTenantTaskBody Uses

type DeleteTenantTaskBody struct {
    TenantID string `json:"tenant_id"`
}

DeleteTenantTaskBody -

type Dependence Uses

type Dependence struct {
    CurrentServiceID string `json:"current_service_id"`
    DependServiceID  string `json:"depend_service_id"`
}

Dependence 依赖关系

type GroupStartTaskBody Uses

type GroupStartTaskBody struct {
    Services    []StartTaskBody `json:"services"`
    Dependences []Dependence    `json:"dependences"`
    //组启动策略
    //顺序启动,无序并发启动
    Strategy []string `json:"strategy"`
}

GroupStartTaskBody 组应用启动操作任务主体

type GroupStopTaskBody Uses

type GroupStopTaskBody struct {
    Services    []StartTaskBody `json:"services"`
    Dependences []Dependence    `json:"dependences"`
    //组关闭策略
    //顺序关系,无序并发关闭
    Strategy []string `json:"strategy"`
}

GroupStopTaskBody 组应用停止操作任务主体

type HorizontalScalingTaskBody Uses

type HorizontalScalingTaskBody struct {
    TenantID  string `json:"tenant_id"`
    ServiceID string `json:"service_id"`
    Replicas  int32  `json:"replicas"`
    EventID   string `json:"event_id"`
    Username  string `json:"username"`
}

HorizontalScalingTaskBody 水平伸缩操作任务主体

type RefreshHPATaskBody Uses

type RefreshHPATaskBody struct {
    ServiceID string `json:"service_id"`
    RuleID    string `json:"rule_id"`
    EventID   string `json:"eventID"`
}

RefreshHPATaskBody -

type RestartTaskBody Uses

type RestartTaskBody struct {
    TenantID      string `json:"tenant_id"`
    ServiceID     string `json:"service_id"`
    DeployVersion string `json:"deploy_version"`
    EventID       string `json:"event_id"`
    //重启策略,此策略不保证生效
    //例如应用如果为有状态服务,此策略如配置为先启动后关闭,此策略不生效
    //无状态服务默认使用先启动后关闭,保证服务不受影响
    Strategy []string          `json:"strategy"`
    Configs  map[string]string `json:"configs"`
}

RestartTaskBody 重启操作任务主体

type RollBackTaskBody Uses

type RollBackTaskBody struct {
    TenantID  string `json:"tenant_id"`
    ServiceID string `json:"service_id"`
    //当前版本
    CurrentDeployVersion string `json:"current_deploy_version"`
    //回滚目标版本
    OldDeployVersion string `json:"old_deploy_version"`
    EventID          string `json:"event_id"`
    //重启策略,此策略不保证生效
    //例如应用如果为有状态服务,此策略如配置为先启动后关闭,此策略不生效
    //无状态服务默认使用先启动后关闭,保证服务不受影响
    //如需使用滚动升级等策略,使用多策略方式
    Strategy []string `json:"strategy"`
}

RollBackTaskBody 回滚操作任务主体

type RollingUpgradeTaskBody Uses

type RollingUpgradeTaskBody struct {
    TenantID         string            `json:"tenant_id"`
    ServiceID        string            `json:"service_id"`
    NewDeployVersion string            `json:"deploy_version"`
    EventID          string            `json:"event_id"`
    Strategy         []string          `json:"strategy"`
    Configs          map[string]string `json:"configs"`
}

RollingUpgradeTaskBody 升级操作任务主体

type StartTaskBody Uses

type StartTaskBody struct {
    TenantID      string            `json:"tenant_id"`
    ServiceID     string            `json:"service_id"`
    DeployVersion string            `json:"deploy_version"`
    EventID       string            `json:"event_id"`
    Configs       map[string]string `json:"configs"`
}

StartTaskBody 启动操作任务主体

type StopTaskBody Uses

type StopTaskBody struct {
    TenantID      string            `json:"tenant_id"`
    ServiceID     string            `json:"service_id"`
    DeployVersion string            `json:"deploy_version"`
    EventID       string            `json:"event_id"`
    Configs       map[string]string `json:"configs"`
}

StopTaskBody 停止操作任务主体

type Task Uses

type Task struct {
    Type       TaskType  `json:"type"`
    Body       TaskBody  `json:"body"`
    CreateTime time.Time `json:"time,omitempty"`
    User       string    `json:"user"`
}

Task 任务

func NewTask Uses

func NewTask(data []byte) (*Task, error)

NewTask 从json bytes data create task

func TransTask Uses

func TransTask(task *pb.TaskMessage) (*Task, error)

TransTask transtask

type TaskBody Uses

type TaskBody interface{}

TaskBody task body

func CreateTaskBody Uses

func CreateTaskBody(taskType string) TaskBody

CreateTaskBody 通过类型串创建实体

func NewTaskBody Uses

func NewTaskBody(taskType string, body []byte) TaskBody

NewTaskBody new task body

type TaskType Uses

type TaskType string

TaskType 任务类型

type VerticalScalingTaskBody Uses

type VerticalScalingTaskBody struct {
    TenantID        string `json:"tenant_id"`
    ServiceID       string `json:"service_id"`
    ContainerCPU    int    `json:"container_cpu"`
    ContainerMemory int    `json:"container_memory"`
    EventID         string `json:"event_id"`
}

VerticalScalingTaskBody 垂直伸缩操作任务主体

Package model imports 5 packages (graph) and is imported by 7 packages. Updated 2019-11-22. Refresh now. Tools for package owners.