processors

package
v2.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package processors includes all calendar processors available in Icarus.

Icarus parses the incoming calendar data, hands it over to the processor to process data in it and formats the resulting data using an output type

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddAlarmProcessor

type AddAlarmProcessor struct {
	AlarmBefore int
	// contains filtered or unexported fields
}

The AddAlarmProcessor adds an alarm definition to all selected events

func (*AddAlarmProcessor) Process

func (a *AddAlarmProcessor) Process(input ical.Calendar, output *ical.Calendar) error

func (*AddAlarmProcessor) SetToolbox

func (a *AddAlarmProcessor) SetToolbox(toolbox Toolbox)

type AddDTStampProcessor

type AddDTStampProcessor struct {
	Timestamp time.Time
	Overwrite bool
	// contains filtered or unexported fields
}

The AddDTStampProcessor adds a DTSTAMP field to all selected events

func (*AddDTStampProcessor) Process

func (t *AddDTStampProcessor) Process(input ical.Calendar, output *ical.Calendar) error

func (*AddDTStampProcessor) SetToolbox

func (t *AddDTStampProcessor) SetToolbox(toolbox Toolbox)

type AddPropertyProcessor

type AddPropertyProcessor struct {
	PropertyName  string
	PropertyValue string
	Overwrite     bool
	// contains filtered or unexported fields
}

The AddPropertyProcessor adds an ICS property to each selected event

func (*AddPropertyProcessor) Process

func (a *AddPropertyProcessor) Process(input ical.Calendar, output *ical.Calendar) error

func (*AddPropertyProcessor) SetToolbox

func (a *AddPropertyProcessor) SetToolbox(toolbox Toolbox)

type BaseProcessor

type BaseProcessor interface {
	// SetToolbox sets the toolbox that can be used by the processor
	SetToolbox(toolbox Toolbox)
	// Process processes the incoming calendar and fills the output calendar
	Process(input ical.Calendar, output *ical.Calendar) error
}

The BaseProcessor is the interface for all Icarus processors

type ConvertAllDayProcessor

type ConvertAllDayProcessor struct {
	TargetAllDay bool
	StartTime    string
	EndTime      string
	Compress     bool
	Timezone     time.Location
	// contains filtered or unexported fields
}

The ConvertAllDayProcessor converts all-day events to timed events or vice versa

func (*ConvertAllDayProcessor) Process

func (c *ConvertAllDayProcessor) Process(input ical.Calendar, output *ical.Calendar) error

func (*ConvertAllDayProcessor) SetToolbox

func (c *ConvertAllDayProcessor) SetToolbox(toolbox Toolbox)

type DeletePropertyProcessor

type DeletePropertyProcessor struct {
	PropertyName string
	// contains filtered or unexported fields
}

The DeletePropertyProcessor deletes an ICS property from all selected events

func (*DeletePropertyProcessor) Process

func (d *DeletePropertyProcessor) Process(input ical.Calendar, output *ical.Calendar) error

func (*DeletePropertyProcessor) SetToolbox

func (d *DeletePropertyProcessor) SetToolbox(toolbox Toolbox)

type FilterProcessor

type FilterProcessor struct {
	Inverse bool
	// contains filtered or unexported fields
}

The FilterProcessor filters the calendar for selected events

func (*FilterProcessor) Process

func (f *FilterProcessor) Process(inputCalendar ical.Calendar, outputCalendar *ical.Calendar) error

func (*FilterProcessor) SetToolbox

func (f *FilterProcessor) SetToolbox(toolbox Toolbox)

type MergeOption added in v2.7.0

type MergeOption int
const (
	MergeOptionOverWrite MergeOption = iota
	MergeOptionSkip
)

type MergeProcessor added in v2.7.0

type MergeProcessor struct {
	MergeCalendar ical.Calendar
	MergeOption   MergeOption
	MergeProps    []string
	// contains filtered or unexported fields
}

The AddAlarmProcessor adds an alarm definition to all selected events

func NewMergeProcessor added in v2.7.0

func NewMergeProcessor(calendar ical.Calendar) MergeProcessor

func (*MergeProcessor) Process added in v2.7.0

func (a *MergeProcessor) Process(input ical.Calendar, output *ical.Calendar) error

func (*MergeProcessor) SetToolbox added in v2.7.0

func (a *MergeProcessor) SetToolbox(toolbox Toolbox)

type PrintProcessor

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

The PrintProcessor simply outputs the input calendar

func (*PrintProcessor) Process

func (f *PrintProcessor) Process(inputCalendar ical.Calendar, outputCalendar *ical.Calendar) error

func (*PrintProcessor) SetToolbox

func (f *PrintProcessor) SetToolbox(toolbox Toolbox)

type Toolbox

type Toolbox struct {
	// TextSelectorPattern is the user specified regexp pattern to select events by
	TextSelectorPattern *regexp.Regexp
	// TextSelectorProps is a list of property names that are checked for the selector
	TextSelectorProps []string
	// DateRangeSelectorStart is the start of a range of dates events have to match
	DateRangeSelectorStart time.Time
	// DateRangeSelectorEnd is the end of a range of dates events have to match
	DateRangeSelectorEnd time.Time
}

A Toolbox of common functions

func NewToolbox

func NewToolbox() Toolbox

NewToolbox returns a toolbox with default values

func (Toolbox) EventMatchesSelector

func (t Toolbox) EventMatchesSelector(event ical.Event) bool

EventMatchesSelector checks if the given event matches the configured filter

Jump to

Keyboard shortcuts

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