Skip to content

Commit

Permalink
added comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
cubicdaiya committed Aug 23, 2015
1 parent 6a66ba3 commit 1278090
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"time"
)

// Stats represents activity status of Go.
type Stats struct {
Time int64 `json:"time"`
// runtime
Expand Down Expand Up @@ -135,22 +136,27 @@ func GetStats() *Stats {
var newLineTerm bool = false
var prettyPrint bool = false

// NewLineTermEnabled enable termination with newline for response body.
func NewLineTermEnabled() {
newLineTerm = true
}

// NewLineTermDisabled disable termination with newline for response body.
func NewLineTermDisabled() {
newLineTerm = false
}

// PrettyPrintEnabled enable pretty-print for response body.
func PrettyPrintEnabled() {
prettyPrint = true
}

// PrettyPrintDisabled disable pritty-print for response body.
func PrettyPrintDisabled() {
prettyPrint = false
}

// Handler returns activity status of Go.
func Handler(w http.ResponseWriter, r *http.Request) {
var mem runtime.MemStats
runtime.ReadMemStats(&mem)
Expand Down

0 comments on commit 1278090

Please sign in to comment.