date_v1

package
v0.0.0-...-1e276a6 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_gommerce_types_v1_date_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Date

type Date struct {

	// Year of date. Must be from 1 to 9999, or 0 if specifying a date without a year.
	Year int32 `protobuf:"varint,1,opt,name=year,proto3" json:"year,omitempty"`
	// Month of year. Must be from 1 to 12, or 0 if specifying a year without a month and day.
	Month int32 `protobuf:"varint,2,opt,name=month,proto3" json:"month,omitempty"`
	// Day of month. Must be from 1 to 31 and valid for the year and month, or 0 if specifying a year by itself or a year
	// and month where the day is not significant.
	Day int32 `protobuf:"varint,3,opt,name=day,proto3" json:"day,omitempty"`
	// contains filtered or unexported fields
}

Date represents a year, month, and day in the Gregorian calendar. https://github.com/googleapis/googleapis/blob/master/google/type/date.proto

func New

func New(t time.Time) *Date

func Now

func Now() *Date

func (*Date) AsTime

func (t *Date) AsTime() time.Time

func (*Date) Descriptor deprecated

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

Deprecated: Use Date.ProtoReflect.Descriptor instead.

func (*Date) GetDay

func (x *Date) GetDay() int32

func (*Date) GetMonth

func (x *Date) GetMonth() int32

func (*Date) GetYear

func (x *Date) GetYear() int32

func (*Date) ProtoMessage

func (*Date) ProtoMessage()

func (*Date) ProtoReflect

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

func (*Date) Reset

func (x *Date) Reset()

func (*Date) String

func (x *Date) String() string

func (*Date) Validate

func (m *Date) Validate() error

Validate checks the field values on Date with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Date) ValidateAll

func (m *Date) ValidateAll() error

ValidateAll checks the field values on Date with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in DateMultiError, or nil if none found.

type DateMultiError

type DateMultiError []error

DateMultiError is an error wrapping multiple validation errors returned by Date.ValidateAll() if the designated constraints aren't met.

func (DateMultiError) AllErrors

func (m DateMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (DateMultiError) Error

func (m DateMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type DateValidationError

type DateValidationError struct {
	// contains filtered or unexported fields
}

DateValidationError is the validation error returned by Date.Validate if the designated constraints aren't met.

func (DateValidationError) Cause

func (e DateValidationError) Cause() error

Cause function returns cause value.

func (DateValidationError) Error

func (e DateValidationError) Error() string

Error satisfies the builtin error interface

func (DateValidationError) ErrorName

func (e DateValidationError) ErrorName() string

ErrorName returns error name.

func (DateValidationError) Field

func (e DateValidationError) Field() string

Field function returns field value.

func (DateValidationError) Key

func (e DateValidationError) Key() bool

Key function returns key value.

func (DateValidationError) Reason

func (e DateValidationError) Reason() string

Reason function returns reason value.

Jump to

Keyboard shortcuts

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