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 ¶
- type Api
- func (a *Api) CloneCalendar(repoUrl, password string) error
- func (a *Api) CreateCalendar(name, password string) error
- func (a *Api) CreateEvent(eventJson string) (string, error)
- func (a *Api) GetEvent(id string) (string, error)
- func (a *Api) GetEvents(from, to string) (string, error)
- func (a *Api) ListCalendars() (string, error)
- func (a *Api) LoadCalendars() error
- func (a *Api) PullAll() error
- func (a *Api) PushAll() error
- func (a *Api) RemoveCalendar(name string) error
- func (a *Api) RemoveEvent(eventJson string) error
- func (a *Api) RemoveRepeatingEvent(eventJson string, strategy int) error
- func (a *Api) SetCorsProxy(proxyUrl string) error
- func (a *Api) UpdateEvent(eventJson string) (string, error)
- func (a *Api) UpdateRepeatingEvent(oldEventJson, newEventJson string, strategy int) (string, error)
- type Event
- type Repetition
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 (*Api) CloneCalendar ¶
func (*Api) CreateCalendar ¶
func (a *Api) AddRemote(name, remoteUrl string) error { return a.inner.AddRemote(name, remoteUrl) }
func (*Api) ListCalendars ¶
func (*Api) LoadCalendars ¶
func (*Api) RemoveCalendar ¶
func (*Api) RemoveEvent ¶
func (*Api) RemoveRepeatingEvent ¶
func (*Api) SetCorsProxy ¶
type Event ¶
type Event struct {
Id string `json:"id"`
Title string `json:"title"`
Location string `json:"location"`
Description string `json:"description"`
From string `json:"from"` // RFC3339 format e.g., 2009-11-10T23:00:00Z (the default format of json.Marshal() for time.Time)
To string `json:"to"` // RFC3339 format e.g., 2009-11-10T23:00:00Z (the default format of json.Marshal() for time.Time)
Calendar string `json:"calendar"`
Tag string `json:"tag"`
ParentId string `json:"parentId"`
Repeat *Repetition `json:"repeat"`
}
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.