durationmatcher

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Duration

type Duration struct {
	time.Duration
}

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() ([]byte, error)

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) error

type DurationMatcher

type DurationMatcher struct {
	Operator Operator      `json:"operator"`
	Value    durationValue `json:"value"`
}

DurationMatcher matches a *durationpb.Duration based on an operator and a value

func Between

func Between(lower *Duration, upper *Duration) *DurationMatcher

Between constructs a new DurationMatcher that matches using the Between operator

func Full

func Full(value *Duration) *DurationMatcher

Full constructs a new DurationMatcher that matches using the Full operator

func Greater

func Greater(value *Duration) *DurationMatcher

Greater constructs a new DurationMatcher that matches using the Greater operator

func Less

func Less(value *Duration) *DurationMatcher

Less constructs a new DurationMatcher that matches using the Less operator

func (DurationMatcher) MarshalJSON

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

Marshal implements json.Marshaler

func (*DurationMatcher) Match

func (m *DurationMatcher) Match(value *durationpb.Duration) error

Match attempts to match a *durationpb.Duration based on the DurationMatcher

func (*DurationMatcher) UnmarshalJSON

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

Unmarshal implements json.Unmarshaler

type Operator

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

Operator is en enum over types of DurationMatcher

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

Jump to

Keyboard shortcuts

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