summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 15011d4)
raw | patch | inline | side by side (parent: 15011d4)
author | Sebastian Harl <sh@tokkee.org> | |
Sat, 20 Sep 2014 01:54:12 +0000 (18:54 -0700) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sat, 20 Sep 2014 01:54:12 +0000 (18:54 -0700) |
sysdb/core.go | patch | blob | history | |
sysdb/store.go | patch | blob | history |
diff --git a/sysdb/core.go b/sysdb/core.go
index bde270373a013a867104b47814da807ab9c96670..edf032c3e3654a826a5800f01a48846e337dd516 100644 (file)
--- a/sysdb/core.go
+++ b/sysdb/core.go
// The LogPriority describes the priority of a log message.
type LogPriority int
+// Log priorities supported by SysDB.
const (
- // Log priorities supported by SysDB.
LogEmerg = LogPriority(0)
LogErr = LogPriority(3)
LogWarning = LogPriority(4)
diff --git a/sysdb/store.go b/sysdb/store.go
index 6f082f32ba9050d3bfc610d79028bf55f643347d..ffe55d586ba01736e45d0265871184fef8c99832 100644 (file)
--- a/sysdb/store.go
+++ b/sysdb/store.go
// sequence of decimal numbers with a unit suffix).
type Duration time.Duration
+// Common durations. All values greater than or equal to a day are not exact
+// values but subject to daylight savings time changes, leap years, etc. They
+// are available mostly for providing human readable display formats.
const (
Second = Duration(1000000000)
Minute = 60 * Second
Year = Duration(3652425 * 24 * 60 * 60 * 100000)
)
-// MarshalJSON implements the json.Marshaler interface. The time is a quoted
-// string in the SysDB JSON format.
+// MarshalJSON implements the json.Marshaler interface. The duration is a
+// quoted string in the SysDB JSON format.
func (d Duration) MarshalJSON() ([]byte, error) {
if d == 0 {
return []byte(`"0s"`), nil
// (YYYY-MM-DD hh:mm:ss +-zzzz).
type Time time.Time
+// MarshalJSON implements the json.Marshaler interface. The time is a quoted
+// string in the SysDB JSON format.
func (t Time) MarshalJSON() ([]byte, error) {
return []byte(time.Time(t).Format(jsonTime)), nil
}