Documentation ¶
Index ¶
- Constants
- Variables
- func ACL(allowIPs []string) martini.Handler
- func BindManageParameter(c *cli.Context) (halib.ManageRequest, error)
- func ExecCommand(command string, option string) (int, string, string, error)
- func ExecCommandCombinedOutput(command string, option string) (int, string, error)
- func GetMartiniRequestStatus(fromWhen time.Time) halib.RequestStatusResponse
- func HappoAgentLogger() *logrus.Logger
- func HappoAgentLoggerEnableInfo() bool
- func MartiniCustomLogger() martini.Handler
- func MartiniRequestStatus() martini.Handler
- func RequestToAutoScalingAPI(endpoint string) (*http.Response, error)
- func RequestToAutoScalingInstanceAPI(endpoint, requestType string, postdata []byte) (*http.Response, error)
- func RequestToAutoScalingLeaveAPI(endpoint string, postdata []byte) (*http.Response, error)
- func RequestToAutoScalingResolveAPI(endpoint string, alias string) (*http.Response, error)
- func RequestToCheckAvailableAPI(endpoint string) (*http.Response, error)
- func RequestToManageAPI(endpoint string, path string, postdata []byte) (*http.Response, error)
- func RequestToMetricAppendAPI(endpoint string, postdata []byte) (*http.Response, error)
- func SetLogLevel(logLevel string)
- type HappoAgentFormatter
- type LogWriter
- type RequestStatusLog
- type RequestStatusManager
- type TimeoutError
Constants ¶
const ( // HappoAgentLogLevelDebug shows LogLevel debug HappoAgentLogLevelDebug = "debug" // HappoAgentLogLevelInfo shows LogLevel info HappoAgentLogLevelInfo = "info" // HappoAgentLogLevelWarn shows LogLevel warn HappoAgentLogLevelWarn = "warn" // HappoAgentLogLevelDefault shows default LogLevel HappoAgentLogLevelDefault = HappoAgentLogLevelWarn )
Variables ¶
var CommandTimeout time.Duration = -1
CommandTimeout is command execution timeout sec
var Production bool
Production is flag. when production use, set true
Functions ¶
func BindManageParameter ¶
func BindManageParameter(c *cli.Context) (halib.ManageRequest, error)
BindManageParameter build and return ManageRequest
func ExecCommand ¶
ExecCommand execute command with specified timeout behavior
func ExecCommandCombinedOutput ¶
ExecCommandCombinedOutput execute command with specified timeout behavior
func GetMartiniRequestStatus ¶
func GetMartiniRequestStatus(fromWhen time.Time) halib.RequestStatusResponse
GetMartiniRequestStatus implements recent request status
func HappoAgentLogger ¶
HappoAgentLogger returns custom logger
func HappoAgentLoggerEnableInfo ¶
func HappoAgentLoggerEnableInfo() bool
HappoAgentLoggerEnableInfo returns enable info
func MartiniCustomLogger ¶
MartiniCustomLogger implements custom logger
func MartiniRequestStatus ¶
MartiniRequestStatus implements recent request status
func RequestToAutoScalingAPI ¶
RequestToAutoScalingAPI send request to AutoScalingAPI
func RequestToAutoScalingInstanceAPI ¶
func RequestToAutoScalingInstanceAPI(endpoint, requestType string, postdata []byte) (*http.Response, error)
RequestToAutoScalingInstanceAPI send request to AutoScalingInstanceAPI
func RequestToAutoScalingLeaveAPI ¶
RequestToAutoScalingLeaveAPI send request to AutoScalingInstanceAPI
func RequestToAutoScalingResolveAPI ¶
RequestToAutoScalingResolveAPI send request to AutoScalingResolveAPI
func RequestToCheckAvailableAPI ¶
RequestToCheckAvailableAPI send request to AutoScalingHealthAPI
func RequestToManageAPI ¶
RequestToManageAPI send request to ManageAPI
func RequestToMetricAppendAPI ¶
RequestToMetricAppendAPI send request to MetricAppendPI
Types ¶
type HappoAgentFormatter ¶
type HappoAgentFormatter struct { }
HappoAgentFormatter log formatter for happo-agent
type LogWriter ¶
LogWriter is custom log writer
func NewLogWriter ¶
NewLogWriter returns new LogWriter pointer
type RequestStatusLog ¶
RequestStatusLog is data for chan
type RequestStatusManager ¶
type RequestStatusManager struct { RequestStatus []struct { When int64 URI string Counts map[int]uint64 } sync.Mutex }
RequestStatusManager manages RequestStatus
func (*RequestStatusManager) Append ¶
func (m *RequestStatusManager) Append(when time.Time, uri string, status int)
Append append log to manager
func (*RequestStatusManager) GarbageCollect ¶
func (m *RequestStatusManager) GarbageCollect(when time.Time, lifetimeMinutes int64)
GarbageCollect runs gabage collection
func (*RequestStatusManager) GetStatus ¶
func (m *RequestStatusManager) GetStatus(fromWhen time.Time) halib.RequestStatusResponse
GetStatus returns halib.RequestStatusResponse
type TimeoutError ¶
type TimeoutError struct {
Message string
}
TimeoutError is error struct show error is timeout
func (*TimeoutError) Error ¶
func (err *TimeoutError) Error() string