Documentation ¶
Index ¶
- Constants
- func FormatEvent(event *calendar.Event, calendarSummary string, timezone *time.Location, ...) (string, error)
- func FormatTimeRange(startDateTime, endDateTime *calendar.EventDateTime, timezone *time.Location, ...) (timeRange string, err error)
- func GetCalendarService(account *Account, config *oauth2.Config) (srv *calendar.Service, err error)
- func GetConvHelpText(channel chat1.ChatChannel, isKeybaseMessage bool) string
- func GetDurationFromMinutes(minutes int) time.Duration
- func GetMinutesFromDuration(duration time.Duration) int
- func GetUserFormat24HourTime(srv *calendar.Service) (format24HourTime bool, err error)
- func GetUserTimezone(srv *calendar.Service) (timezone *time.Location, err error)
- func MinutesBeforeString(minutesBefore int) string
- func ParseTime(startDateTime, endDateTime *calendar.EventDateTime) (start, end time.Time, isAllDay bool, err error)
- type Account
- type AccountHelpPage
- type Channel
- type ChannelAndAccount
- type ConfigPage
- type DB
- func (d *DB) CompleteState(state string) error
- func (d *DB) CountSubscriptionsByAccountAndCalender(account *Account, calendarID string) (count int, err error)
- func (d *DB) DeleteAccount(keybaseUsername, accountNickname string) error
- func (d *DB) DeleteChannelByChannelID(channelID string) error
- func (d *DB) DeleteSubscription(account *Account, subscription Subscription) error
- func (d *DB) ExistsAccount(keybaseUsername string, accountNickname string) (exists bool, err error)
- func (d *DB) ExistsChannelByAccountAndCalendar(account *Account, calendarID string) (exists bool, err error)
- func (d *DB) ExistsInvite(account *Account, calendarID, eventID string) (exists bool, err error)
- func (d *DB) ExistsSubscription(account *Account, subscription Subscription) (exists bool, err error)
- func (d *DB) GetAccount(keybaseUsername, accountNickname string) (account *Account, err error)
- func (d *DB) GetAccountListForUsername(keybaseUsername string) (accounts []*Account, err error)
- func (d *DB) GetChannel(account *Account, calendarID string) (channel *Channel, err error)
- func (d *DB) GetChannelAndAccountByID(channelID string) (channel *Channel, account *Account, err error)
- func (d *DB) GetChannelListByAccount(account *Account) (channels []*Channel, err error)
- func (d *DB) GetExpiringChannelAndAccountList() (pairs []*ChannelAndAccount, err error)
- func (d *DB) GetInviteAndAccountByUserMessage(keybaseUsername string, messageID chat1.MessageID) (invite *Invite, account *Account, err error)
- func (d *DB) GetReminderSubscriptionAndAccountPairs() (pairs []*SubscriptionAndAccount, err error)
- func (d *DB) GetReminderSubscriptionsByAccountAndCalendar(account *Account, calendarID string, subscriptionType SubscriptionType) (subscriptions []*Subscription, err error)
- func (d *DB) GetState(state string) (*OAuthRequest, error)
- func (d *DB) GetSubscriptions(account *Account, calendarID string, keybaseConvID chat1.ConvIDStr) (subscriptions []*Subscription, err error)
- func (d *DB) InsertAccount(account Account) error
- func (d *DB) InsertChannel(account *Account, channel Channel) error
- func (d *DB) InsertInvite(account *Account, invite Invite) error
- func (d *DB) InsertSubscription(account *Account, subscription Subscription) error
- func (d *DB) PutState(state string, oauthState OAuthRequest) error
- func (d *DB) UpdateChannel(oldChannelID, newChannelID string, expiry time.Time) error
- func (d *DB) UpdateChannelNextSyncToken(channelID, nextSyncToken string) error
- type ErrorPage
- type EventStatus
- type HTTPSrv
- type Handler
- type Invite
- type InviteReaction
- type LoginPage
- type OAuthRequest
- type ReminderScheduler
- type ReminderType
- type RenewChannelScheduler
- type ResponseStatus
- type Subscription
- type SubscriptionAndAccount
- type SubscriptionType
Constants ¶
View Source
const AllDayDateFormat = "2006-01-02"
Variables ¶
This section is empty.
Functions ¶
func FormatEvent ¶
func FormatTimeRange ¶
func GetCalendarService ¶
func GetConvHelpText ¶
func GetConvHelpText(channel chat1.ChatChannel, isKeybaseMessage bool) string
func GetDurationFromMinutes ¶
func GetMinutesFromDuration ¶
func GetUserFormat24HourTime ¶
func GetUserTimezone ¶
func MinutesBeforeString ¶
Types ¶
type AccountHelpPage ¶
type AccountHelpPage struct {
Title string
}
type ChannelAndAccount ¶
type ConfigPage ¶
type DB ¶
type DB struct {
*base.GoogleOAuthDB
}
func (*DB) CompleteState ¶
func (*DB) CountSubscriptionsByAccountAndCalender ¶
func (*DB) DeleteAccount ¶
func (*DB) DeleteChannelByChannelID ¶
func (*DB) DeleteSubscription ¶
func (d *DB) DeleteSubscription(account *Account, subscription Subscription) error
func (*DB) ExistsAccount ¶
func (*DB) ExistsChannelByAccountAndCalendar ¶
func (*DB) ExistsInvite ¶
func (*DB) ExistsSubscription ¶
func (d *DB) ExistsSubscription(account *Account, subscription Subscription) (exists bool, err error)
func (*DB) GetAccount ¶
func (*DB) GetAccountListForUsername ¶
func (*DB) GetChannel ¶
func (*DB) GetChannelAndAccountByID ¶
func (*DB) GetChannelListByAccount ¶
func (*DB) GetExpiringChannelAndAccountList ¶
func (d *DB) GetExpiringChannelAndAccountList() (pairs []*ChannelAndAccount, err error)
func (*DB) GetInviteAndAccountByUserMessage ¶
func (*DB) GetReminderSubscriptionAndAccountPairs ¶
func (d *DB) GetReminderSubscriptionAndAccountPairs() (pairs []*SubscriptionAndAccount, err error)
func (*DB) GetReminderSubscriptionsByAccountAndCalendar ¶
func (d *DB) GetReminderSubscriptionsByAccountAndCalendar( account *Account, calendarID string, subscriptionType SubscriptionType, ) (subscriptions []*Subscription, err error)
func (*DB) GetSubscriptions ¶
func (*DB) InsertChannel ¶
Channel
func (*DB) InsertSubscription ¶
func (d *DB) InsertSubscription(account *Account, subscription Subscription) error
Subscription
func (*DB) UpdateChannel ¶
func (*DB) UpdateChannelNextSyncToken ¶
type EventStatus ¶
type EventStatus string
const ( EventStatusConfirmed EventStatus = "confirmed" EventStatusTentative EventStatus = "tentative" EventStatusCancelled EventStatus = "cancelled" )
type HTTPSrv ¶
func NewHTTPSrv ¶
func NewHTTPSrv( stats *base.StatsRegistry, kbc *kbchat.API, debugConfig *base.ChatDebugOutputConfig, db *DB, oauthConfig *oauth2.Config, reminderScheduler ReminderScheduler, handler *Handler, ) *HTTPSrv
type Handler ¶
type Handler struct { *base.DebugOutput // contains filtered or unexported fields }
func NewHandler ¶
func NewHandler( stats *base.StatsRegistry, kbc *kbchat.API, debugConfig *base.ChatDebugOutputConfig, db *DB, oauth *oauth2.Config, reminderScheduler ReminderScheduler, tokenSecret string, httpPrefix string, ) *Handler
func (*Handler) HandleCommand ¶
func (h *Handler) HandleCommand(msg chat1.MsgSummary) error
func (*Handler) HandleNewConv ¶
func (h *Handler) HandleNewConv(conv chat1.ConvSummary) error
func (*Handler) LoginToken ¶
type InviteReaction ¶
type InviteReaction string
const ( InviteReactionYes InviteReaction = "Yes 👍" InviteReactionNo InviteReaction = "No 👎" InviteReactionMaybe InviteReaction = "Maybe 🤷" )
type OAuthRequest ¶
type ReminderScheduler ¶
type ReminderScheduler interface { UpdateOrCreateReminderEvent( account *Account, subscription *Subscription, event *calendar.Event, ) error AddSubscription(account *Account, subscription Subscription) RemoveSubscription(account *Account, subscription Subscription) }
type ReminderType ¶
type RenewChannelScheduler ¶
type RenewChannelScheduler struct { *base.DebugOutput sync.Mutex // contains filtered or unexported fields }
func NewRenewChannelScheduler ¶
func NewRenewChannelScheduler( stats *base.StatsRegistry, debugConfig *base.ChatDebugOutputConfig, db *DB, config *oauth2.Config, httpPrefix string, ) *RenewChannelScheduler
func (*RenewChannelScheduler) Run ¶
func (r *RenewChannelScheduler) Run() error
func (*RenewChannelScheduler) Shutdown ¶
func (r *RenewChannelScheduler) Shutdown() error
type ResponseStatus ¶
type ResponseStatus string
const ( ResponseStatusNeedsAction ResponseStatus = "needsAction" ResponseStatusDeclined ResponseStatus = "declined" ResponseStatusTentative ResponseStatus = "tentative" ResponseStatusAccepted ResponseStatus = "accepted" )
type Subscription ¶
type SubscriptionAndAccount ¶
type SubscriptionAndAccount struct { Subscription Subscription Account Account }
type SubscriptionType ¶
type SubscriptionType string
const ( SubscriptionTypeInvite SubscriptionType = "invite" SubscriptionTypeReminder SubscriptionType = "reminder" )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.