webdav

package
v1.0.0-caldav Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Calendar

type Calendar struct {
	UID         string
	OwnerID     string
	DisplayName string
	Description string
	Color       string
	IsPublic    bool
	PublicHash  string
	Timezone    string
}

Calendar represents a calendar collection

type Config

type Config struct {
	Host       string
	Port       string
	JWTSecret  string
	EnableAuth bool
	Production bool
}

Config holds WebDAV configuration

type Event

type Event struct {
	UID         string
	CalendarUID string
	DTStart     time.Time
	DTEnd       time.Time
	Summary     string
	Description string
	Location    string
	AllDay      bool
}

Event represents a calendar event

type FileSystem

type FileSystem interface {
	MkCalendar(ctx context.Context, userID, calendarUID string, props map[string]string) error
	GetCalendar(ctx context.Context, userID, calendarUID string) (*Calendar, error)
	ListCalendars(ctx context.Context, userID string) ([]*Calendar, error)
	GetEvents(ctx context.Context, userID, calendarUID string, startTime, endTime *TimeRange) ([]*Event, error)
	GetEvent(ctx context.Context, userID, calendarUID, eventUID string) (*Event, error)
	CreateEvent(ctx context.Context, userID, calendarUID string, event *Event) error
	UpdateEvent(ctx context.Context, userID, calendarUID, eventUID string, event *Event) error
	DeleteEvent(ctx context.Context, userID, calendarUID, eventUID string) error
	GetPublicCalendar(ctx context.Context, hash string) (*Calendar, error)
	GetPublicEvents(ctx context.Context, hash string, startTime, endTime *TimeRange) ([]*Event, error)
}

FileSystem is the interface for calendar filesystem operations

type Handler

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

Handler wraps the standard WebDAV handler with CalDAV support

func NewHandler

func NewHandler(fs FileSystem, cfg *Config) *Handler

NewHandler creates a new WebDAV handler with CalDAV support

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP handles all WebDAV/CalDAV requests

type TimeRange

type TimeRange struct {
	Start time.Time
	End   time.Time
}

TimeRange represents a date/time range for queries

Jump to

Keyboard shortcuts

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