models

package
v0.0.0-...-44e9b83 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DeploymentStatus = [...]string{
	"UNKOWN",
	"SUCCESS",
	"FAIL",
}
View Source
var Mgr *manager

Functions

func ProjectAdd

func ProjectAdd(project *Project) error

func ProjectUpdate

func ProjectUpdate(project *Project) error

func ProjectUpdateBase

func ProjectUpdateBase(project *Project) error

func ProjectUpdateServerList

func ProjectUpdateServerList(project *Project) error

Types

type Deployment

type Deployment struct {
	Id             int64
	ProjectId      string
	Tag            string
	Description    string
	Status         int
	ReleasePath    string
	DeploymentPath string
	Output         string
	CreatedAt      Time
}

func (*Deployment) Add

func (d *Deployment) Add() error

func (*Deployment) Detail

func (d *Deployment) Detail() error

func (*Deployment) Fail

func (d *Deployment) Fail() error

func (*Deployment) PreDeploy

func (d *Deployment) PreDeploy() error

func (*Deployment) Success

func (d *Deployment) Success() error

type DeploymentStatusCode

type DeploymentStatusCode int
const (
	UNKOWN DeploymentStatusCode = iota
	SUCCESS
	FAIL
)

type Project

type Project struct {
	Id                     int64  `json:"id" form:"id"`
	Name                   string `json:"name" form:"name"`
	Code                   string `json:"code" form:"code"`
	OwnerId                int64  `json:"ownerId" form:"ownerId"`
	RunType                int    `json:"runType" form:"runType"`
	ServerList             string `json:"serverList" form:"serverList"`
	DeployedAt             Time   `json:"deployedAt" form:"deployedAt"`
	DeploymentPath         string `json:"deploymentPath" form:"deploymentPath"`
	SourcePath             string `json:"sourcePath" form:"sourcePath"`
	StartScript            string `json:"startScript" form:"startScript"`
	StopScript             string `json:"stopScript" form:"stopScript"`
	RestartScript          string `json:"restartScript" form:"restartScript"`
	PackageScript          string `json:"packageScript" form:"packageScript"`
	BeforeDeploymentScript string `json:"beforeDeploymentScript" form:"beforeDeploymentScript"`
	DeploymentScript       string `json:"deploymentScript" form:"deploymentScript"`
	AfterDeploymentScript  string `json:"afterDeploymentScript" form:"afterDeploymentScript"`
}

func ListProject

func ListProject(userId int64) []Project

type ProjectDetail

type ProjectDetail struct {
	Id                     int64    `json:"id" form:"id"`
	Name                   string   `json:"name" form:"name"`
	Code                   string   `json:"code" form:"code"`
	OwnerId                int64    `json:"ownerId" form:"ownerId"`
	RunType                int      `json:"runType" form:"runType"`
	ServerList             []string `json:"serverList" form:"serverList"`
	DeployedAt             Time     `json:"deployedAt" form:"deployedAt"`
	SourcePath             string   `json:"sourcePath" form:"sourcePath"`
	ReleasePath            string   `json:"releasePath" form:"releasePath"`
	DeploymentPath         string   `json:"deploymentPath" form:"deploymentPath"`
	StartScript            string   `json:"startScript" form:"startScript"`
	StopScript             string   `json:"stopScript" form:"stopScript"`
	RestartScript          string   `json:"restartScript" form:"restartScript"`
	PackageScript          string   `json:"packageScript" form:"packageScript"`
	BeforeDeploymentScript string   `json:"beforeDeploymentScript" form:"beforeDeploymentScript"`
	DeploymentScript       string   `json:"deploymentScript" form:"deploymentScript"`
	AfterDeploymentScript  string   `json:"afterDeploymentScript" form:"afterDeploymentScript"`
}

func DetailProject

func DetailProject(id *string) ProjectDetail

type Server

type Server struct {
	Id         int64  `json:"id"`
	Ip         string `json:"ip"`
	CoreNum    string `json:"coreNum" form:"coreNum"`
	MemorySize string `json:"memorySize" form:"memorySize"`
	CreateAt   Time
	UpdateAt   Time
}

func ListServer

func ListServer() []Server

type ServerDetail

type ServerDetail struct {
	Server
	Port       int
	Username   string
	Password   string
	PrivateKey string
}

func GetServerDetail

func GetServerDetail(ip string) ServerDetail

type Time

type Time time.Time

func (Time) MarshalJSON

func (t Time) MarshalJSON() ([]byte, error)

func (Time) String

func (t Time) String() string

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(data []byte) (err error)

type UserInfo

type UserInfo struct {
	Id        int64
	Username  string
	Email     string
	Ticket    string
	Role      string
	Enable    string
	CreatedAt Time
	UpdatedAt Time
}

func DetailByEmail

func DetailByEmail(email string) (UserInfo, error)

Jump to

Keyboard shortcuts

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