Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { CalendarID string `toml:"calendar_id"` Credential string `toml:"credential_file"` }
Config contains user calendar config.
func LoadConfig ¶
LoadConfig returns user google calendar config.
type Event ¶
type Event struct { Title string `json:"title"` Detail string `json:"detail"` StartTime string `json:"start_time"` EndTime string `json:"end_time"` }
Event is google calendar event at Gocal
type Gocal ¶ added in v0.0.2
type Gocal interface { GetEventsList(string, string) (*calendar.Events, error) InsertEvent(Event) error InsertEvents([]Event) }
Gocal is interface for google calendar api
type GocalClient ¶
type GocalClient struct { Srv *calendar.Service Conf Config }
GocalClient is a google calenar api client
func NewCalendarClient ¶
func NewCalendarClient(c Config, scope string) (*GocalClient, error)
NewCalendarClient returns http client google calandar api scope is calendar.CalendarReadonlyScope or calendar.CalendarScope
func (GocalClient) GetEventsList ¶
func (gc GocalClient) GetEventsList(startTime string, endTime string) (*calendar.Events, error)
GetEventsList returns event list
func (GocalClient) InsertEvent ¶
func (gc GocalClient) InsertEvent(event Event) error
InsertEvent insert an event to the google calendar
func (GocalClient) InsertEvents ¶ added in v0.0.2
func (gc GocalClient) InsertEvents(events []Event)
InsertEvents insert multiple events
Click to show internal directories.
Click to hide internal directories.