datepart

package
v1.0.0-alpha.13 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package datepart is the one reading of ATTR_DATE_PART's params and field, shared by the operator factory (internal/processing) and predict (internal/descriptor) so both refuse the same request with the same code and message. It decides what a request MEANS and never extracts a value: the calendar arithmetic lives in internal/temporal.

Leaf: stdlib, the public errors / encoding / types packages and the accepted-types table (internal/fieldaccept, itself a leaf).

Index

Constants

View Source
const PartHour = "hour"

PartHour is the sub-day part: the local wall-clock hour (0..23).

Variables

This section is empty.

Functions

func CheckField

func CheckField(part, field string, f *encoding.Field) error

CheckField judges the schema field f (nil: absent from the schema) that part reads from field. A `date` or `datetime` is accepted, except that `hour` needs a `datetime` (a calendar date carries no time of day, so every row would read hour 0). Any other type is the accepted-types table's PULSE_FIELD_TYPE_UNSUPPORTED (as is a date under `hour`); an absent field is PROCESSING_CONFIG.

func Parse

func Parse(raw json.RawMessage) (string, error)

Parse validates raw ATTR_DATE_PART params and returns the part. Refusals, in order, are all PROCESSING_CONFIG: absent params, malformed JSON, a missing part and an unknown part.

Types

This section is empty.

Jump to

Keyboard shortcuts

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