config

package
v0.0.0-...-e9ca3b0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Assignee

type Assignee struct {
	FirstName   string `toml:"first_name"`
	LastName    string `toml:"last_name"`
	Email       string `toml:"email"`
	Description string `toml:"description"`
}

Assignee describes a config `people` item entry

func (*Assignee) FullName

func (a *Assignee) FullName() string

type Config

type Config struct {
	Templates []Template
}

Config struct describes the app config

type RecMode

type RecMode string
const (
	RecModeSingle    RecMode = "single"
	RecModeRecurrent RecMode = "recurrent"
)

func (RecMode) IsRecurrent

func (r RecMode) IsRecurrent() bool

func (RecMode) IsSingle

func (r RecMode) IsSingle() bool

type Recurrence

type Recurrence struct {
	Mode      RecMode       `toml:"mode"`
	Count     int32         `toml:"count"`
	Frequency time.Duration `toml:"frequency"`
	Interval  uint32        `toml:"interval"`
}

func (*Recurrence) RFC5545

func (r *Recurrence) RFC5545() ([]string, error)

type Template

type Template struct {
	CalID                 string        `toml:"cal_id"`
	Name                  string        `toml:"name"`
	EventTitle            string        `toml:"event_title"`
	Timezone              string        `toml:"timezone"`
	Transparency          string        `toml:"transparency"`
	Visibility            string        `toml:"visibility"`
	Participants          []*Assignee   `toml:"participants"`
	EventHost             Assignee      `toml:"host"`
	Duration              time.Duration `toml:"duration"`
	Recurrence            Recurrence    `toml:"recurrence"`
	Description           string        `toml:"description"`
	TitleWithParticipants bool          `toml:"title_with_participants"`
}

Template holds calendar event basic configuration data

func LoadTemplate

func LoadTemplate(file string) (*Template, error)

func (*Template) GenerateEventTitle

func (t *Template) GenerateEventTitle(participants ...*Assignee) string

Jump to

Keyboard shortcuts

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