Documentation
¶
Index ¶
- Constants
- Variables
- func Alarm(message string)
- func AlarmCheckDown(service string, message string)
- func AlarmCheckUp(service string, message string)
- func ConfInit(configName string, config interface{}) interface{}
- func ConvertBytes(bytes uint64) string
- func Init()
- func LogError(err string)
- func LogInit()
- func PrettyPrint(name string, lessOrMore string, value float64, hasPercentage bool, ...)
- func RedmineClose(service string, message string)
- func RedmineCreate(service string, subject string, message string)
- func RedmineShow(service string)
- func RedmineUpdate(service string, message string)
- func SplitSection(section string)
- type Common
- type Issue
- type RedmineIssue
- type ResponseData
Constants ¶
View Source
const ( Reset = "\033[0m" Blue = "\033[94m" Green = "\033[92m" Fail = "\033[91m" )
Variables ¶
View Source
var RedmineCloseCmd = &cobra.Command{ Use: "close", Short: "Close an existing issue in Redmine", Run: func(cmd *cobra.Command, args []string) { Init() service, _ := cmd.Flags().GetString("service") message, _ := cmd.Flags().GetString("message") RedmineClose(service, message) }, }
View Source
var RedmineCmd = &cobra.Command{
Use: "redmine",
Short: "Redmine-related utilities",
}
View Source
var RedmineCreateCmd = &cobra.Command{ Use: "create", Short: "Create a new issue in Redmine", Run: func(cmd *cobra.Command, args []string) { Init() service, _ := cmd.Flags().GetString("service") subject, _ := cmd.Flags().GetString("subject") message, _ := cmd.Flags().GetString("message") RedmineCreate(service, subject, message) }, }
View Source
var RedmineShowCmd = &cobra.Command{ Use: "show", Short: "Get the issue ID of the issue if it is opened", Run: func(cmd *cobra.Command, args []string) { Init() service, _ := cmd.Flags().GetString("service") RedmineShow(service) }, }
View Source
var RedmineUpdateCmd = &cobra.Command{ Use: "update", Short: "Update an existing issue in Redmine", Run: func(cmd *cobra.Command, args []string) { Init() service, _ := cmd.Flags().GetString("service") message, _ := cmd.Flags().GetString("message") RedmineUpdate(service, message) }, }
View Source
var ScriptName string
View Source
var TmpDir = "/tmp/mono/"
View Source
var TmpPath string
Functions ¶
func AlarmCheckDown ¶
func AlarmCheckUp ¶
func ConvertBytes ¶
func PrettyPrint ¶
func RedmineClose ¶ added in v0.2.0
func RedmineCreate ¶
func RedmineShow ¶ added in v0.3.0
func RedmineShow(service string)
func RedmineUpdate ¶
func SplitSection ¶
func SplitSection(section string)
Types ¶
type Common ¶
type Common struct {
Identifier string
Alarm struct {
Enabled bool
Interval float64
Webhook_urls []string
}
Redmine struct {
Enabled bool
Project_id string
Tracker_id int
Status_id int
Priority_id int
Api_key string
Url string
}
}
var Config Common
type Issue ¶
type Issue struct {
Id int `json:"id,omitempty"`
Notes string `json:"notes,omitempty"`
ProjectId string `json:"project_id,omitempty"`
TrackerId int `json:"tracker_id,omitempty"`
Description string `json:"description,omitempty"`
Subject string `json:"subject,omitempty"`
PriorityId int `json:"priority_id,omitempty"`
StatusId int `json:"status_id,omitempty"`
StatusIdString string `json:"status_id,omitempty"`
}
type RedmineIssue ¶
type RedmineIssue struct {
Issue Issue `json:"issue"`
}
type ResponseData ¶
Click to show internal directories.
Click to hide internal directories.