Skip to content

Commit

Permalink
feat: json struct tags for health.Info (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
loozhengyuan authored Feb 24, 2021
1 parent b2a7558 commit 67e9de6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file.
### Added

* Health checks now run asynchronously ([#22](https://github.com/loozhengyuan/grench/pull/22))
* JSON struct tags for health.Info ([#24](https://github.com/loozhengyuan/grench/pull/24))

<!-- END Unreleased -->

Expand Down
10 changes: 5 additions & 5 deletions pkg/health/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,19 @@ func (s Status) String() string {
// Info represents the outcome of a health check.
type Info struct {
// Name of the component, e.g. database, network, etc.
Component string
Component string `json:"component,omitempty"`

// Health status of the component.
Status Status
Status Status `json:"status,omitempty"`

// Information on the health status.
Message string
Message string `json:"message,omitempty"`

// Timestamp when component was checked.
CheckedAt time.Time
CheckedAt time.Time `json:"checked_at,omitempty"`

// Metadata information about the component check.
Metadata map[string]string
Metadata map[string]string `json:"metadata,omitempty"`
}

// CheckFunc is a functional expression of a check procedure.
Expand Down

0 comments on commit 67e9de6

Please sign in to comment.