Documentation ¶
Index ¶
- Constants
- Variables
- func GetCurrentHostName() string
- func HandlerFunc(service *healthCheckService) http.HandlerFunc
- func New() *healthCheckService
- func StartHttpServer(service HealthCheckService, httpPort int)
- type Configuration
- type HealthCheck
- type HealthCheckResult
- type HealthCheckService
- type Result
- type Severity
- type Status
- type TestCheck
- type TestResult
- type TestResults
Constants ¶
View Source
const (
SE4TimeFormat = "2006-01-02T15:04:05Z"
)
Variables ¶
View Source
var Debugf = glog.V(2).Infof
View Source
var DefaultTestCheckConfig = Configuration{ Severity: SeverityWarn, InitialDelay: time.Second * 0, RunDelay: time.Second, Description: "Example config", }
View Source
var DefaultTestCheckResult = HealthCheckResult{ Duration: time.Second * 5, Result: CheckPassed, Message: "It works!", LastCheck: time.Unix(1415030870, 0), }
View Source
var ( // GoodToGoFailureLevel = SeverityWarn )
View Source
var Infof = glog.Infof
Logging wrappers
View Source
var ServiceStatus = Status{}
Empty status, should be replaced by compile
View Source
var Warningf = glog.Warningf
Functions ¶
func GetCurrentHostName ¶
func GetCurrentHostName() string
func HandlerFunc ¶
func HandlerFunc(service *healthCheckService) http.HandlerFunc
func StartHttpServer ¶
func StartHttpServer(service HealthCheckService, httpPort int)
Types ¶
type Configuration ¶
type Configuration struct { Severity Severity InitialDelay time.Duration RunDelay time.Duration Description string }
func NewConfiguration ¶
func NewConfiguration(description string, severity Severity, initialDelay, period int) Configuration
initialDelay and period are integer representin seconds
type HealthCheck ¶
type HealthCheck interface { Run() HealthCheckResult Configuration() Configuration }
type HealthCheckResult ¶
type HealthCheckResult struct { Duration time.Duration Result Result Message string LastCheck time.Time }
func (HealthCheckResult) DurationMillis ¶
func (r HealthCheckResult) DurationMillis() int64
func (HealthCheckResult) String ¶
func (r HealthCheckResult) String() string
type HealthCheckService ¶
type HealthCheckService interface { GetResults() map[HealthCheck]HealthCheckResult Register(h HealthCheck) }
type Status ¶
type Status struct { ArtifactId string `json:"artifact_id"` BuildNumber string `json:"build_number"` BuildMachine string `json:"build_machine"` BuildBy string `json:"build_by"` BuildWhen string `json:"build_when"` //ISO 8601 Representation CompilerVersion string `json:"compiler_version"` CurrentTime string `json:"current_time"` //ISO 8601 Representation GitSha string `json:"git_sha"` MachineName string `json:"machine_name"` OsArch string `json:"os_arch"` OsName string `json:"os_name"` OsVersion string `json:"os_version"` RunbookUri string `json:"runbook_uri"` UpDuration string `json:"up_duration"` UpSince string `json:"up_since"` //ISO 8601 Representation Version string `json:"version"` OsLoad *string `json:"os_avgload,omitempty"` OsNumberProcessors *int `json:"os_numprocessors,omitempty"` }
func (*Status) SetBuildWhen ¶
func (*Status) SetCurrentTime ¶
type TestCheck ¶
type TestCheck struct { TestCheckResult HealthCheckResult TestCheckConfig Configuration }
Simple check to use for tests around gose4 code
func NewTestCheck ¶
func NewTestCheck() TestCheck
func (TestCheck) Configuration ¶
func (t TestCheck) Configuration() Configuration
func (TestCheck) Run ¶
func (t TestCheck) Run() HealthCheckResult
type TestResult ¶
type TestResults ¶
type TestResults struct { ReportAsOf string `json:"report_as_of"` //ISO 8601 Representation ReportDuration string `json:"report_duration"` // Tests []TestResult `json:"tests"` }
Directories ¶
Path | Synopsis |
---|---|
Godeps
|
|
_workspace/src/github.com/cloudfoundry/gosigar/psnotify
Go interface to the Linux netlink process connector.
|
Go interface to the Linux netlink process connector. |
_workspace/src/github.com/emicklei/go-restful
Package restful, a lean package for creating REST-style WebServices without magic.
|
Package restful, a lean package for creating REST-style WebServices without magic. |
_workspace/src/github.com/emicklei/go-restful/swagger
Package swagger implements the structures of the Swagger https://github.com/wordnik/swagger-spec/blob/master/versions/1.2.md
|
Package swagger implements the structures of the Swagger https://github.com/wordnik/swagger-spec/blob/master/versions/1.2.md |
_workspace/src/github.com/gocql/gocql
Package gocql implements a fast and robust Cassandra driver for the Go programming language.
|
Package gocql implements a fast and robust Cassandra driver for the Go programming language. |
_workspace/src/github.com/golang/glog
Package glog implements logging analogous to the Google-internal C++ INFO/ERROR/V setup.
|
Package glog implements logging analogous to the Google-internal C++ INFO/ERROR/V setup. |
_workspace/src/github.com/golang/groupcache/lru
Package lru implements an LRU cache.
|
Package lru implements an LRU cache. |
_workspace/src/github.com/golang/snappy
Package snappy implements the snappy block-based compression format.
|
Package snappy implements the snappy block-based compression format. |
_workspace/src/github.com/stretchr/testify/assert
Package assert provides a set of comprehensive testing tools for use with the normal Go testing system.
|
Package assert provides a set of comprehensive testing tools for use with the normal Go testing system. |
_workspace/src/github.com/ugorji/go/codec
High Performance, Feature-Rich Idiomatic Go codec/encoding library for binc, msgpack, cbor, json.
|
High Performance, Feature-Rich Idiomatic Go codec/encoding library for binc, msgpack, cbor, json. |
_workspace/src/github.com/ugorji/go/codec/codecgen
codecgen generates codec.Selfer implementations for a set of types.
|
codecgen generates codec.Selfer implementations for a set of types. |
_workspace/src/gopkg.in/inf.v0
Package inf (type inf.Dec) implements "infinite-precision" decimal arithmetic.
|
Package inf (type inf.Dec) implements "infinite-precision" decimal arithmetic. |
Click to show internal directories.
Click to hide internal directories.