Documentation
¶
Index ¶
- func FromPattern[T any](pat string, inp []T) (res []T, err error)
- func Parse(pat string) (unixT, off int64)
- func ParsePattern(pat string, max int) (from, to int, err error)
- func ParseTimeSlice(pat string) (from, to int64, err error)
- func ShiftLeft[T any](arg string, arr []T) (res []T, err error)
- func ShiftRight[T any](arg string, arr []T) (res []T, err error)
- func Slice[T any](from, to, l int, inp []T) (res []T)
- func SplitWithAll(str string, match ...string) (res []string)
- type Act
- type Expression
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromPattern ¶
func ParsePattern ¶ added in v0.0.10
func ParseTimeSlice ¶ added in v0.0.10
can be provided {from date}:{to date} also accepts y{value} m{value} d{value} to specify just year, month, day, or some combination of them. if a [y|m|d] expression has "-" precedengin it, it is instead deducted from the current time. t[-y1:] would mean "in the last year until now" t[-2m:-1m] would mean "during the time between 60 and 30 days ago"
func ShiftRight ¶
func SplitWithAll ¶
Types ¶
type Expression ¶
type Expression[T any] struct { Syntax map[string]Act[T] // contains filtered or unexported fields }
func NewExpression ¶
func NewExpression[T any]() *Expression[T]
func (*Expression[T]) Eval ¶
func (e *Expression[T]) Eval(arr []T) (res []T, err error)
func (*Expression[T]) Parse ¶
func (e *Expression[T]) Parse(pat string)
Click to show internal directories.
Click to hide internal directories.