timestampmatcher

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Operator

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

Operator is en enum over types of TimestampMatcher

func (Operator) MarshalJSON

func (o Operator) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler interface

func (Operator) String

func (o Operator) String() string

String implements fmt.Stringer

func (*Operator) UnmarshalJSON

func (o *Operator) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler interface

type Time

type Time struct {
	time.Time
}

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(b []byte) error

type TimestampMatcher

type TimestampMatcher struct {
	Operator Operator       `json:"operator"`
	Value    timestampValue `json:"value"`
}

TimestampMatcher matches a *timestamppb.Timestamp based on an operator and a value

func After

func After(value *Time) *TimestampMatcher

After constructs a new TimestampMatcher that matches using the After operator

func Before

func Before(value *Time) *TimestampMatcher

Before constructs a new TimestampMatcher that matches using the Before operator

func Between

func Between(before *Time, after *Time) *TimestampMatcher

Between constructs a new TimestampMatcher that matches using the Between operator

func Day

func Day(value *Time) *TimestampMatcher

Day constructs a new TimestampMatcher that matches using the Day operator

func Format

func Format(value *Time, format string) *TimestampMatcher

Format constructs a new TimestampMatcher that matches using the Format operator

func Hour

func Hour(value *Time) *TimestampMatcher

Hour constructs a new TimestampMatcher that matches using the Hour operator

func Minute

func Minute(value *Time) *TimestampMatcher

Minute constructs a new TimestampMatcher that matches using the Minute operator

func Second

func Second(value *Time) *TimestampMatcher

Second constructs a new TimestampMatcher that matches using the Second operator

func (TimestampMatcher) MarshalJSON

func (m TimestampMatcher) MarshalJSON() ([]byte, error)

Marshal implements json.Marshaler

func (*TimestampMatcher) Match

func (m *TimestampMatcher) Match(value *timestamppb.Timestamp) error

Match attempts to match a *timestamppb.Timestamp based on the TimestampMatcher

func (*TimestampMatcher) UnmarshalJSON

func (m *TimestampMatcher) UnmarshalJSON(b []byte) error

Unmarshal implements json.Unmarshaler

Jump to

Keyboard shortcuts

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