1
0
Fork 0

Godoc comments

master
Philip O'Toole 2 years ago
parent 3cfdc8b689
commit 0b47dff0b0

@ -120,6 +120,7 @@ type DBResults struct {
QueryRows []*command.QueryRows QueryRows []*command.QueryRows
} }
// Responser is the interface response objects must implement.
type Responser interface { type Responser interface {
SetTime() SetTime()
} }
@ -158,12 +159,8 @@ func NewResponse() *Response {
} }
} }
func NewQueueResponse() *QueueResponse { // QueueResponse represents a response from the HTTP service when performing a
return &QueueResponse{ // queued write.
start: time.Now(),
}
}
type QueueResponse struct { type QueueResponse struct {
SequenceNum int64 `json:"sequence_number,omitempty"` SequenceNum int64 `json:"sequence_number,omitempty"`
Error string `json:"error,omitempty"` Error string `json:"error,omitempty"`
@ -179,6 +176,13 @@ func (q *QueueResponse) SetTime() {
q.Time = q.end.Sub(q.start).Seconds() q.Time = q.end.Sub(q.start).Seconds()
} }
// NewQueueResponse returns a new instance of QueuedResponse.
func NewQueueResponse() *QueueResponse {
return &QueueResponse{
start: time.Now(),
}
}
// stats captures stats for the HTTP service. // stats captures stats for the HTTP service.
var stats *expvar.Map var stats *expvar.Map

Loading…
Cancel
Save