-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
372 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package timestamppb | ||
|
||
import "time" | ||
|
||
// Now constructs a new Timestamp from the current time. | ||
func Now() *Timestamp { | ||
return New(time.Now()) | ||
} | ||
|
||
// New constructs a new Timestamp from the provided time.Time. | ||
func New(t time.Time) *Timestamp { | ||
return &Timestamp{Seconds: int64(t.Unix()), Nanos: int32(t.Nanosecond())} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Protocol Buffers - Google's data interchange format | ||
// Copyright 2008 Google Inc. All rights reserved. | ||
// Copyright 2022 Teppei Fukuda. All rights reserved. | ||
// https://developers.google.com/protocol-buffers/ | ||
|
||
syntax = "proto3"; | ||
|
||
package timestamppb; | ||
|
||
option go_package = "github.com/knqyf263/go-plugin/types/known/timestamppb"; | ||
|
||
message Timestamp { | ||
// Represents seconds of UTC time since Unix epoch | ||
// 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to | ||
// 9999-12-31T23:59:59Z inclusive. | ||
int64 seconds = 1; | ||
|
||
// Non-negative fractions of a second at nanosecond resolution. Negative | ||
// second values with fractions must still have non-negative nanos values | ||
// that count forward in time. Must be from 0 to 999,999,999 | ||
// inclusive. | ||
int32 nanos = 2; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.