timestamp

package
v2026.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NegativeInfinityTS = time.Date(math.MinInt32, time.January, 1, 0, 0, 0, 0, time.UTC)
	PositiveInfinityTS = time.Date(math.MaxInt32, time.December, 31, 23, 59, 59, 1e9-1, time.UTC)
)
View Source
var File_resources_timestamp_timestamp_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Timestamp

type Timestamp struct {
	Timestamp *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// contains filtered or unexported fields
}

Timestamp for storage messages. We've defined a new local type wrapper of google.protobuf.Timestamp so we can implement sql.Scanner and sql.Valuer interfaces. See: https://golang.org/pkg/database/sql/#Scanner https://golang.org/pkg/database/sql/driver/#Valuer

func New

func New(t time.Time) *Timestamp

New constructs a new Timestamp from the provided time.Time.

func Now

func Now() *Timestamp

Now constructs a new Timestamp from the current time.

func (*Timestamp) AsTime

func (x *Timestamp) AsTime() time.Time

AsTime converts x to a time.Time.

func (*Timestamp) ClearTimestamp

func (x *Timestamp) ClearTimestamp()

func (*Timestamp) GetTimestamp

func (x *Timestamp) GetTimestamp() *timestamppb.Timestamp

func (*Timestamp) HasTimestamp

func (x *Timestamp) HasTimestamp() bool

func (*Timestamp) ProtoMessage

func (*Timestamp) ProtoMessage()

func (*Timestamp) ProtoReflect

func (x *Timestamp) ProtoReflect() protoreflect.Message

func (*Timestamp) Reset

func (x *Timestamp) Reset()

func (*Timestamp) Sanitize

func (m *Timestamp) Sanitize() error

Sanitize sanitizes the message's fields, in case of complex types it calls their Sanitize() method recursively.

func (*Timestamp) Scan

func (ts *Timestamp) Scan(value any) error

Scan implements sql.Scanner for protobuf Timestamp.

func (*Timestamp) SetTimestamp

func (x *Timestamp) SetTimestamp(v *timestamppb.Timestamp)

func (*Timestamp) String

func (x *Timestamp) String() string

func (*Timestamp) Value

func (ts *Timestamp) Value() (driver.Value, error)

Value marshals the value into driver.Valuer.

type Timestamp_builder

type Timestamp_builder struct {
	Timestamp *timestamppb.Timestamp
	// contains filtered or unexported fields
}

func (Timestamp_builder) Build

func (b0 Timestamp_builder) Build() *Timestamp

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL