google

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_google_duration_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Duration

type Duration struct {
	Seconds int64 `protobuf:"varint,1,opt,name=seconds,proto3" json:"seconds,omitempty"`
	Nanos   int32 `protobuf:"varint,2,opt,name=nanos,proto3" json:"nanos,omitempty"`
	// contains filtered or unexported fields
}

func New

func New(d time.Duration) *Duration

New constructs a new Duration from the provided time.Duration.

func (*Duration) AsDuration

func (x *Duration) AsDuration() time.Duration

AsDuration converts x to a time.Duration, returning the closest duration value in the event of overflow.

func (*Duration) CheckValid

func (x *Duration) CheckValid() error

CheckValid returns an error if the duration is invalid. In particular, it checks whether the value is within the range of -10000 years to +10000 years inclusive. An error is reported for a nil Duration.

func (*Duration) Descriptor deprecated

func (*Duration) Descriptor() ([]byte, []int)

Deprecated: Use Duration.ProtoReflect.Descriptor instead.

func (*Duration) GetNanos

func (x *Duration) GetNanos() int32

func (*Duration) GetSeconds

func (x *Duration) GetSeconds() int64

func (*Duration) IsValid

func (x *Duration) IsValid() bool

IsValid reports whether the duration is valid. It is equivalent to CheckValid == nil.

func (*Duration) ProtoMessage

func (*Duration) ProtoMessage()

func (*Duration) ProtoReflect

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

func (*Duration) Reset

func (x *Duration) Reset()

func (*Duration) String

func (x *Duration) String() string

Jump to

Keyboard shortcuts

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