api

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

A JSON API wrapper around the core.Core for multiplatform support. It's not possible to expose any "complex" data types (structs*, arrays, channels, maps, etc.), because they do not have bindings to other languages. Let's use JSON everywhere as a REST API would...

(*) You can return a *Event (pointer to struct), but you cannot receive it as argument.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Api

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

The exposed/exported JSON-only API interface.

func NewApi

func NewApi() *Api

A "constructor" for the JSON API.

func (*Api) CloneCalendar

func (a *Api) CloneCalendar(repoUrl, password string) error

func (*Api) CreateCalendar

func (a *Api) CreateCalendar(name, password string) error

func (*Api) CreateEvent

func (a *Api) CreateEvent(eventJson string) (string, error)

func (*Api) ExportZip added in v0.1.2

func (a *Api) ExportZip(calendar string) ([]byte, error)

func (*Api) GetEvent

func (a *Api) GetEvent(id string) (string, error)

func (*Api) GetEvents

func (a *Api) GetEvents(from, to string) (string, error)

func (*Api) ListCalendars

func (a *Api) ListCalendars() (string, error)

func (*Api) LoadCalendars

func (a *Api) LoadCalendars() error

func (*Api) RemoveCalendar

func (a *Api) RemoveCalendar(name string) error

func (*Api) RemoveEvent

func (a *Api) RemoveEvent(eventJson string) error

func (*Api) RemoveRepeatingEvent

func (a *Api) RemoveRepeatingEvent(eventJson string, strategy int) error

func (*Api) RenameCalendar added in v0.1.3

func (a *Api) RenameCalendar(oldName, newName string) error

func (*Api) SetCorsProxy

func (a *Api) SetCorsProxy(proxyUrl string) error

func (*Api) SyncAll added in v0.1.4

func (a *Api) SyncAll() error

func (*Api) UpdateEvent

func (a *Api) UpdateEvent(eventJson string) (string, error)

func (*Api) UpdateRemote added in v0.1.4

func (a *Api) UpdateRemote(calendar string, remoteUrl string) error

func (*Api) UpdateRepeatingEvent

func (a *Api) UpdateRepeatingEvent(oldEventJson, newEventJson string, strategy int) (string, error)

type Event

type Event struct {
	Id          string
	Title       string
	Location    string
	Description string
	From        string // RFC3339 format e.g., 2009-11-10T23:00:00Z (the default format of json.Marshal() for time.Time)
	To          string // RFC3339 format e.g., 2009-11-10T23:00:00Z (the default format of json.Marshal() for time.Time)
	Calendar    string
	Tag         string
	ParentId    string
	Repeat      *Repetition
}

A DTO (we love Java) for Kotlin/Swift to use as the event structure.

This event isn't used in Go itself, but serves as a "shape definition" for `gomobile` to bind it into Kotlin/Swift.

type Repetition

type Repetition struct {
	Frequency  int
	Interval   int
	Until      string
	Count      int
	Exceptions []string
}

Jump to

Keyboard shortcuts

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