models

package
v0.0.0-...-ea2d26f Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BitNone  = pgtype.Text{String: "0", Valid: true}
	BitIsSet = pgtype.Text{String: "1", Valid: true}
)

Functions

This section is empty.

Types

type Alarm

type Alarm struct {
	Action      pgtype.Text      `json:"action"`
	Trigger     pgtype.Timestamp `json:"trigger"`
	TimeOffset  *int64           `json:"time_offset"`
	Summary     pgtype.Text      `json:"summary"`
	Description pgtype.Text      `json:"description"`
	Duration    pgtype.Uint32    `json:"duration"`
	Repeat      pgtype.Uint32    `json:"repeat"`
}

func ScanAlarm

func ScanAlarm(alarm *ical.Component) *Alarm

func (*Alarm) ToDomain

func (a *Alarm) ToDomain() *ical.Component

type Calendar

type Calendar struct {
	Version string      `json:"version"`
	Product string      `json:"product"`
	Scale   pgtype.Text `json:"scale,omitempty"`
	Method  pgtype.Text `json:"method,omitempty"`
	Events  []*Event    `json:"events"`
}

func (*Calendar) ToDomain

func (c *Calendar) ToDomain(uid string) *ical.Calendar

type Event

type Event struct {
	ID                  int64                             `json:"id"`
	CompTypeBit         pgtype.Text                       `json:"compTypeBit,omitempty"`
	Transparent         pgtype.Text                       `json:"transparent,omitempty"`
	AllDay              pgtype.Text                       `json:"allDay,omitempty"`
	Summary             pgtype.Text                       `json:"summary,omitempty"`
	Description         pgtype.Text                       `json:"description,omitempty"`
	Url                 pgtype.Text                       `json:"url,omitempty"`
	Organizer           pgtype.Text                       `json:"organizer,omitempty"`
	Class               pgtype.Text                       `json:"class,omitempty"`
	Loc                 pgtype.Text                       `json:"loc,omitempty"`
	Status              pgtype.Text                       `json:"status,omitempty"`
	Categories          pgtype.Text                       `json:"categories,omitempty"`
	Timestamp           pgtype.Timestamp                  `json:"timestamp,omitempty"`
	Created             pgtype.Timestamp                  `json:"created,omitempty"`
	LastModified        pgtype.Timestamp                  `json:"lastModified,omitempty"`
	Start               pgtype.Timestamp                  `json:"start,omitempty"`
	End                 pgtype.Timestamp                  `json:"end,omitempty"`
	Duration            pgtype.Uint32                     `json:"duration,omitempty"`
	Priority            pgtype.Uint32                     `json:"priority,omitempty"`
	Sequence            pgtype.Uint32                     `json:"sequence,omitempty"`
	Completed           pgtype.Uint32                     `json:"completed,omitempty"`
	PerCompleted        pgtype.Uint32                     `json:"perCompleted,omitempty"`
	RecurrenceSet       *RecurrenceSet                    `json:"recurrenceSet,omitempty"`
	Properties          map[string]map[ical.ValueType]any `json:"props,omitempty"`
	NotDeletedException string                            `json:"notDeletedException,omitempty"`
	Alarms              []*Alarm                          `json:"alarms,omitempty"`
}

func ScanEvent

func ScanEvent(event *ical.Component) *Event

func (*Event) ToDomain

func (c *Event) ToDomain(uid string) *ical.Component

type RecurrenceException

type RecurrenceException struct {
	Value     pgtype.Timestamp `json:"value"`
	IsDeleted pgtype.Text      `json:"isDeleted"`
}

func ScanRecurrenceException

func ScanRecurrenceException(event *ical.Component) *RecurrenceException

func (*RecurrenceException) ToDomain

func (r *RecurrenceException) ToDomain() string

type RecurrenceSet

type RecurrenceSet struct {
	Interval      pgtype.Uint32          `json:"interval,omitempty"`
	Cnt           pgtype.Uint32          `json:"cnt,omitempty"`
	Until         pgtype.Date            `json:"until,omitempty"`
	Wkst          pgtype.Uint32          `json:"wkst,omitempty"`
	BySetPos      pgtype.Array[int]      `json:"bySetPos,omitempty"`
	Weekdays      pgtype.Uint32          `json:"weekdays,omitempty"`
	Monthdays     pgtype.Uint32          `json:"monthdays,omitempty"`
	Months        pgtype.Uint32          `json:"months,omitempty"`
	PeriodDay     *int                   `json:"periodDay,omitempty"`
	ThisAndFuture pgtype.Text            `json:"thisAndFuture,omitempty"`
	Exceptions    []*RecurrenceException `json:"exceptions,omitempty"`
}

func ScanRecurrence

func ScanRecurrence(event *ical.Component) *RecurrenceSet

func (*RecurrenceSet) ToDomain

func (rs *RecurrenceSet) ToDomain() (*rrule.ROption, string)

Jump to

Keyboard shortcuts

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