storage

package
v0.0.0-...-cde1c88 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CalDAVStorage

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

func NewCalDAVStorage

func NewCalDAVStorage(serverURL, username, password, calendarPath string) (*CalDAVStorage, error)

NewCalDAVStorage creates a new CalDAVStorage with the given server URL

func NewCalDAVStorageFromConfig

func NewCalDAVStorageFromConfig(config WebdavConfig) (*CalDAVStorage, error)

func NewCalDAVStorageFromURL

func NewCalDAVStorageFromURL(fullURL string) (*CalDAVStorage, error)

func (*CalDAVStorage) DeleteEvent

func (s *CalDAVStorage) DeleteEvent(uid string) error

DeleteEvent deletes a calendar event from CalDAV by its UID

func (*CalDAVStorage) GetEvent

func (s *CalDAVStorage) GetEvent(uid string) (*icalParser.Event, error)

GetEvent retrieves a calendar event from CalDAV by its UID

func (*CalDAVStorage) ListEvents

func (s *CalDAVStorage) ListEvents() ([]*icalParser.Event, error)

ListEvents lists all events from the CalDAV calendar

func (*CalDAVStorage) StoreEvent

func (s *CalDAVStorage) StoreEvent(event *icalParser.Event) error

StoreEvent stores a calendar event via CalDAV

type MemoryStorage

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

func NewMemoryStorage

func NewMemoryStorage() *MemoryStorage

func (*MemoryStorage) DeleteEvent

func (m *MemoryStorage) DeleteEvent(uid string) error

func (*MemoryStorage) GetEvent

func (m *MemoryStorage) GetEvent(uid string) (*ical.Event, error)

func (*MemoryStorage) GetEventCount

func (m *MemoryStorage) GetEventCount() int

func (*MemoryStorage) ListEvents

func (m *MemoryStorage) ListEvents() ([]*ical.Event, error)

func (*MemoryStorage) StoreEvent

func (m *MemoryStorage) StoreEvent(event *ical.Event) error

type Storage

type Storage interface {
	// StoreEvent stores a calendar event in the storage
	StoreEvent(event *ical.Event) error

	// GetEvent retrieves a calendar event from the storage by its UID
	GetEvent(id string) (*ical.Event, error)

	// ListEvents lists all events in the storage
	ListEvents() ([]*ical.Event, error)

	// DeleteEvent deletes a calendar event from the storage by its UID
	DeleteEvent(id string) error
}

Storage defines the interface for storing calendar events

type WebdavConfig

type WebdavConfig struct {
	URL      string `yaml:"url"`
	User     string `yaml:"user"`
	Pass     string `yaml:"pass"`
	Calendar string `yaml:"calendar"`
}

Jump to

Keyboard shortcuts

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