Documentation ¶
Overview ¶
Package tai64n is a generated protocol buffer package.
It is generated from these files:
tai64n.proto
It has these top-level messages:
TAI64N
Index ¶
- Constants
- Variables
- func LeapSecondsInvolved(t time.Time) uint64
- type LeapMoment
- type LeapSecond
- type TAI64N
- func (tai *TAI64N) Add(dur time.Duration) *TAI64N
- func (tai *TAI64N) After(other *TAI64N) bool
- func (tai *TAI64N) Before(other *TAI64N) bool
- func (t *TAI64N) Clock() (hour, min, sec int)
- func (tai *TAI64N) Compare(other *TAI64N) TimeComparison
- func (t *TAI64N) Date() (year int, month time.Month, day int)
- func (*TAI64N) Descriptor() ([]byte, []int)
- func (this *TAI64N) Equal(that interface{}) bool
- func (this *TAI64N) GoString() string
- func (tai *TAI64N) Label() string
- func (m *TAI64N) Marshal() (data []byte, err error)
- func (tai TAI64N) MarshalJSON() ([]byte, error)
- func (m *TAI64N) MarshalTo(data []byte) (int, error)
- func (*TAI64N) ProtoMessage()
- func (tai *TAI64N) ReadStorage(buf []byte)
- func (m *TAI64N) Reset()
- func (m *TAI64N) Size() (n int)
- func (t *TAI64N) String() string
- func (tai *TAI64N) Sub(other *TAI64N) time.Duration
- func (tai *TAI64N) Time() time.Time
- func (m *TAI64N) Unmarshal(data []byte) error
- func (tai *TAI64N) UnmarshalJSON(data []byte) (err error)
- func (tai *TAI64N) WriteStorage(buf []byte)
- type TimeComparison
Constants ¶
const TAI64OriginalBase = uint64(4611686018427387904)
The number of seconds to offset the UNIX epoch to find the current TAI time.
Variables ¶
var ( ErrInvalidLengthTai64N = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTai64N = fmt.Errorf("proto: integer overflow") )
var AllLeapMoments []*LeapMoment
var AllLeapSeconds = []*LeapSecond{ &LeapSecond{time.Date(1972, time.January, 1, 0, 0, 0, 0, time.UTC), 10}, &LeapSecond{time.Date(1972, time.July, 1, 0, 0, 0, 0, time.UTC), 11}, &LeapSecond{time.Date(1973, time.January, 1, 0, 0, 0, 0, time.UTC), 12}, &LeapSecond{time.Date(1974, time.January, 1, 0, 0, 0, 0, time.UTC), 13}, &LeapSecond{time.Date(1975, time.January, 1, 0, 0, 0, 0, time.UTC), 14}, &LeapSecond{time.Date(1976, time.January, 1, 0, 0, 0, 0, time.UTC), 15}, &LeapSecond{time.Date(1977, time.January, 1, 0, 0, 0, 0, time.UTC), 16}, &LeapSecond{time.Date(1978, time.January, 1, 0, 0, 0, 0, time.UTC), 17}, &LeapSecond{time.Date(1979, time.January, 1, 0, 0, 0, 0, time.UTC), 18}, &LeapSecond{time.Date(1980, time.January, 1, 0, 0, 0, 0, time.UTC), 19}, &LeapSecond{time.Date(1981, time.July, 1, 0, 0, 0, 0, time.UTC), 20}, &LeapSecond{time.Date(1982, time.July, 1, 0, 0, 0, 0, time.UTC), 21}, &LeapSecond{time.Date(1983, time.July, 1, 0, 0, 0, 0, time.UTC), 22}, &LeapSecond{time.Date(1985, time.July, 1, 0, 0, 0, 0, time.UTC), 23}, &LeapSecond{time.Date(1988, time.January, 1, 0, 0, 0, 0, time.UTC), 24}, &LeapSecond{time.Date(1990, time.January, 1, 0, 0, 0, 0, time.UTC), 25}, &LeapSecond{time.Date(1991, time.January, 1, 0, 0, 0, 0, time.UTC), 26}, &LeapSecond{time.Date(1992, time.July, 1, 0, 0, 0, 0, time.UTC), 27}, &LeapSecond{time.Date(1993, time.July, 1, 0, 0, 0, 0, time.UTC), 28}, &LeapSecond{time.Date(1994, time.July, 1, 0, 0, 0, 0, time.UTC), 29}, &LeapSecond{time.Date(1996, time.January, 1, 0, 0, 0, 0, time.UTC), 30}, &LeapSecond{time.Date(1997, time.July, 1, 0, 0, 0, 0, time.UTC), 31}, &LeapSecond{time.Date(1999, time.January, 1, 0, 0, 0, 0, time.UTC), 32}, &LeapSecond{time.Date(2006, time.January, 1, 0, 0, 0, 0, time.UTC), 33}, &LeapSecond{time.Date(2009, time.January, 1, 0, 0, 0, 0, time.UTC), 34}, &LeapSecond{time.Date(2012, time.July, 1, 0, 0, 0, 0, time.UTC), 35}, &LeapSecond{time.Date(2015, time.July, 1, 0, 0, 0, 0, time.UTC), 36}, &LeapSecond{time.Date(2017, time.January, 1, 0, 0, 0, 0, time.UTC), 37}, }
Functions ¶
func LeapSecondsInvolved ¶
Return the number of leap seconds that occur previous to the given time.
Types ¶
type LeapMoment ¶
type LeapMoment struct { LeapSecond *LeapSecond Moment *TAI64N }
type LeapSecond ¶
Represents the first moment after a leap second occurs.
type TAI64N ¶
type TAI64N struct { Seconds uint64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"` Nanoseconds uint32 `protobuf:"varint,2,opt,name=nanoseconds,proto3" json:"nanoseconds,omitempty"` }
func ParseTAI64NLabel ¶
Parse the canonical ascii format
func (*TAI64N) Clock ¶
Calculate the hour, minute, and second of this moment. If the moment falls on a leap second, the displayed value will be that of the leap second as the 60th second of the day.
func (*TAI64N) Compare ¶
func (tai *TAI64N) Compare(other *TAI64N) TimeComparison
Indicate how the 2 moments compare to eachother
func (*TAI64N) Date ¶
Calculate the year, month, and day of this moment. If the moment falls on a leap second, the displayed value will be that of the leap second as the 60th second of the day.
func (*TAI64N) Descriptor ¶
func (TAI64N) MarshalJSON ¶
func (*TAI64N) ProtoMessage ¶
func (*TAI64N) ProtoMessage()
func (*TAI64N) ReadStorage ¶
Update the value from it's canonical binary format
func (*TAI64N) UnmarshalJSON ¶
func (*TAI64N) WriteStorage ¶
Return the value in it's canonical binary format
type TimeComparison ¶
type TimeComparison int
Indicates via Before, After, or Equal how to moments compare to eachother.
const ( Before TimeComparison = -1 Equal TimeComparison = 0 After TimeComparison = 1 )