Documentation ¶
Index ¶
- Constants
- Variables
- func CommandContext(timeout int, binPath string, args []string) (string, error)
- func Exec(bin string, args []string)
- func ExecCommand(bin string, args []string) (string, error)
- func FromDeployPolicy(policy DeployPolicy) string
- func GetDeployStage() string
- func Init()
- func Install(tmpPath, binPath string) error
- func IsLinux() bool
- func IsMac() bool
- func IsStageDev() bool
- func IsStageTest() bool
- func IsWin() bool
- func SendReloadSignal() error
- type Bar
- type BuildInfo
- type DeployPolicy
Examples ¶
Constants ¶
View Source
const ( CloudPlatformAWS = "aws" CloudPlatformAliyun = "aliyun" // The name from github, XD. CloudPlatformTencent = "tencentyun" )
View Source
const ( DeployStageDev = "dev" DeployStageTest = "test" DeployStagePre = "pre" DeployStageRelease = "release" )
Variables ¶
View Source
var ( Env string Repo string Version string Swagger string Build string BuildTime string Uptime string CreatedAt time.Time )
View Source
var DeployPolicyMap = map[DeployPolicy]string{ DeployPolicyBlue: "blue", DeployPolicyGreen: "green", DeployPolicyRed: "red", DeployPolicyBlack: "black", }
Functions ¶
func CommandContext ¶
func FromDeployPolicy ¶
func FromDeployPolicy(policy DeployPolicy) string
func GetDeployStage ¶
func GetDeployStage() string
func IsStageDev ¶
func IsStageDev() bool
func IsStageTest ¶
func IsStageTest() bool
func SendReloadSignal ¶
func SendReloadSignal() error
Types ¶
type Bar ¶
type Bar struct {
// contains filtered or unexported fields
}
func (*Bar) NewOption ¶
Example ¶
package main import ( "time" "github.com/airdb/toolbox/oskit" ) func main() { var bar oskit.Bar bar.NewOption(0, 100) for i := 0; i <= 100; i++ { time.Sleep(time.Millisecond) bar.Play(int64(i)) } bar.Finish() }
Output:
func (*Bar) NewOptionWithGraph ¶
type BuildInfo ¶
type BuildInfo struct { GoVersion string Env string Repo string Version string Swagger string `json:"swagger,omitempty"` Build string BuildTime string Uptime string CreatedAt time.Time }
Build version info.
func GetBuildInfo ¶
func GetBuildInfo() *BuildInfo
type DeployPolicy ¶
type DeployPolicy uint
const ( DeployPolicyBlue DeployPolicy = iota + 1 DeployPolicyGreen DeployPolicyRed DeployPolicyBlack )
func ToEnv ¶
func ToEnv(sPolicy string) DeployPolicy
Click to show internal directories.
Click to hide internal directories.