calendarrepo

package
v0.10.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddMytokenToCalendar

func AddMytokenToCalendar(rlog log.Ext1FieldLogger, tx *sqlx.Tx, mtID mtid.MTID, calendarID string) error

AddMytokenToCalendar associates a mytoken with a calendar in the database; you still have to update the ics

func Delete

func Delete(rlog log.Ext1FieldLogger, tx *sqlx.Tx, myid mtid.MTID, name string) error

Delete deletes a calendar for the given user (given by the mytoken) from the database

func GetMTsInCalendar

func GetMTsInCalendar(rlog log.Ext1FieldLogger, tx *sqlx.Tx, calendarID string) (mtids []string, err error)

GetMTsInCalendar returns a list of mytoken ids that are in a certain calendar

func Insert

func Insert(rlog log.Ext1FieldLogger, tx *sqlx.Tx, mtID mtid.MTID, info CalendarInfo) error

Insert inserts a calendar for the given user (given by the mytoken) into the database

func List

func List(rlog log.Ext1FieldLogger, tx *sqlx.Tx, mtID mtid.MTID) (cals []api.CalendarInfo, err error)

List returns a list of all calendar entries for a user

func ListCalendarsForMT

func ListCalendarsForMT(rlog log.Ext1FieldLogger, tx *sqlx.Tx, mtID any) (cals []api.CalendarInfo, err error)

ListCalendarsForMT returns a list of calendars where the passed token is used in

func Update

func Update(rlog log.Ext1FieldLogger, tx *sqlx.Tx, mtID mtid.MTID, info CalendarInfo) error

Update updates a calendar entry in the database

func UpdateInternal

func UpdateInternal(rlog log.Ext1FieldLogger, tx *sqlx.Tx, info CalendarInfo) error

UpdateInternal updates a calendar entry in the database and does not require a mtid.MTID

Types

type CalendarInfo

type CalendarInfo struct {
	ID      string `db:"id" json:"id"`
	Name    string `db:"name" json:"name"`
	ICSPath string `db:"ics_path" json:"ics_path"`
	ICS     string `db:"ics" json:"-"`
}

CalendarInfo is a type holding the information stored in the database related to a calendar

func Get

func Get(rlog log.Ext1FieldLogger, tx *sqlx.Tx, mtID any, name string) (info CalendarInfo, err error)

Get returns a calendar entry for a user and name

func GetByID

func GetByID(rlog log.Ext1FieldLogger, tx *sqlx.Tx, id string) (info CalendarInfo, err error)

GetByID returns a calendar entry for a certain calendar id

func (CalendarInfo) ToCalendarInfoResponse

func (i CalendarInfo) ToCalendarInfoResponse(rlog log.Ext1FieldLogger, tx *sqlx.Tx) (
	*pkg.CalendarInfoResponse, error,
)

ToCalendarInfoResponse transforms a CalendarInfo into an pkg.CalendarInfoResponse

Jump to

Keyboard shortcuts

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