calendar

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2019 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Calendar

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

Calendar repesents Google Calendar API client.

func New

func New(conf config.Config) (*Calendar, error)

New returns initialized *Calendar.

func (*Calendar) Errorf

func (c *Calendar) Errorf(format string, vv ...interface{})

Errorf logging error information.

func (*Calendar) EventList

func (c *Calendar) EventList(calendarID string, max ...int64) (*EventList, error)

EventList gets calendarID's events after current time.

func (*Calendar) EventListWithOption added in v0.7.2

func (c *Calendar) EventListWithOption(calendarID string, opt EventListOption) (*EventList, error)

EventListWithOption gets calendarID's events with option.

func (*Calendar) SetLogger

func (c *Calendar) SetLogger(logger log.Logger)

SetLogger sets internal API logger.

type Event

type Event struct {
	ID          string
	Status      string
	Summary     string
	Description string
	Location    string
	HTMLLink    string
	HangoutLink string
	ICalUID     string

	StartTime     time.Time
	EndTime       time.Time
	IsAllDayEvent bool

	Attendees []User
	Creator   User
	Organizer User

	Transparent bool
	Visibility  string
	Locked      bool
	PrivateCopy bool
	Sequence    int64
	Kind        string

	Source    EventSource
	Reminders EventReminders

	Created time.Time
	Updated time.Time
}

Event contains event information on Google Calendar.

func NewEvent

func NewEvent(e *SDK.Event) Event

func NewEvents

func NewEvents(list []*SDK.Event) []Event

func (Event) IsStatusConfirmed added in v0.7.1

func (e Event) IsStatusConfirmed() bool

type EventList

type EventList struct {
	List []Event
}

EventList contains multiple calendar events.

type EventListOption

type EventListOption struct {
	MaxResults            int64
	OrderBy               OrderBy
	PageToken             string
	ShowDeleted           bool
	ShowHiddenInvitations bool
	SingleEvents          bool
	TimeMax               time.Time
	TimeMin               time.Time
}

EventListOption contains option for event.list operation.

func (EventListOption) GetTimeMax

func (o EventListOption) GetTimeMax() string

func (EventListOption) GetTimeMin

func (o EventListOption) GetTimeMin() string

type EventListResponse

type EventListResponse struct {
	*SDK.Events
}

type EventReminder

type EventReminder struct {
	Method  string
	Minutes int64
}

type EventReminders

type EventReminders struct {
	Overrides  []EventReminder
	UseDefault bool
}

type EventSource

type EventSource struct {
	Title string
	URL   string
}

type OrderBy

type OrderBy string
const (
	OrderByStartTime OrderBy = "startTime" // used only SingleEvent=true
	OrderByUpdated   OrderBy = "updated"
)

OrderBy list

func (OrderBy) String

func (f OrderBy) String() string

type User

type User struct {
	ID             string
	Email          string
	DisplayName    string
	ResponseStatus string
	Self           bool
	Organizer      bool
}

Jump to

Keyboard shortcuts

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