mirror of
https://github.com/rjNemo/rentease.git
synced 2026-06-11 13:16:50 +00:00
18 lines
362 B
Go
18 lines
362 B
Go
package calendar
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
type Option func(*Service) error
|
|
|
|
func WithCalendar(key string, calendarId string) Option {
|
|
return func(s *Service) error {
|
|
_, err := s.CalendarList.Get(calendarId).Do()
|
|
if err != nil {
|
|
return fmt.Errorf("cannot find calendar entry with id %q: %w", calendarId, err)
|
|
}
|
|
s.calIds[key] = calendarId
|
|
return nil
|
|
}
|
|
}
|