parse

package
v0.0.0-...-d1adec4 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExactMonthDateBiasNextYear

func ExactMonthDateBiasNextYear(s rules.Strategy) rules.Rule

func ParseCheckbox

func ParseCheckbox(candidate string) (*notionapi.CheckboxProperty, error)

func ParseEmail

func ParseEmail(candidate string) (*notionapi.EmailProperty, error)

func ParseMultiSelect

func ParseMultiSelect(candidate string, options []notionapi.Option) (*notionapi.MultiSelectProperty, error)

func ParseNumber

func ParseNumber(candidate string) (*notionapi.NumberProperty, error)

func ParsePhoneNumber

func ParsePhoneNumber(candidate string) (*notionapi.PhoneNumberProperty, error)

func ParseRichText

func ParseRichText(candidate string) (*notionapi.RichTextProperty, error)

func ParseSelect

func ParseSelect(candidate string, options []notionapi.Option) (*notionapi.SelectProperty, error)

func ParseTitle

func ParseTitle(candidate string) (*notionapi.TitleProperty, error)

func ParseURL

func ParseURL(candidate string) (*notionapi.URLProperty, error)

func Property

func Property(propName string, propConfig notionapi.PropertyConfig, propValue string) (notionapi.Property, error)

Types

type DateObject

type DateObject struct {
	Start *TimelessDate `json:"start"`
	End   *TimelessDate `json:"end"`
}

type DateProperty

type DateProperty struct {
	ID   notionapi.ObjectID     `json:"id,omitempty"`
	Type notionapi.PropertyType `json:"type,omitempty"`
	Date DateObject             `json:"date"`
}

this cursed block here replicates the API of notion while allowing us to serialize datetimes without the time part so that we can schedule tasks without assigning times of days

func ParseDate

func ParseDate(candidate string, now time.Time) (*DateProperty, error)

func (*DateProperty) GetType

func (dp *DateProperty) GetType() notionapi.PropertyType

type TimelessDate

type TimelessDate time.Time

func (*TimelessDate) MarshalJSON

func (td *TimelessDate) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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