google

package
v0.0.0-...-59b4249 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MAX_RESULTS = 50
)

Variables

This section is empty.

Functions

func GetUserID

func GetUserID(
	ctx context.Context,
	token *oauth2.Token,
	oauthConfig *oauth2.Config,
) (string, error)

Types

type CalendarClient

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

func InitCalendarClient

func InitCalendarClient(
	ctx context.Context,
	token *oauth2.Token,
	oauthConfig *oauth2.Config,
	userID string,
) (*CalendarClient, error)

func (*CalendarClient) BuildEvent

func (c *CalendarClient) BuildEvent(eventCfg *models.EventConfig) (*calendar.Event, error)

func (*CalendarClient) GetCalendarList

func (c *CalendarClient) GetCalendarList(ctx context.Context) (*calendar.CalendarList, error)

func (*CalendarClient) GetEventsBySyncToken

func (c *CalendarClient) GetEventsBySyncToken(
	ctx context.Context,
	calendarID string,
	syncToken string,
) (*calendar.Events, error)

func (*CalendarClient) GetEventsByTimeRange

func (c *CalendarClient) GetEventsByTimeRange(
	ctx context.Context,
	calendarID string,
	timeMin time.Time,
	timeMax time.Time,
) (*calendar.Events, error)

func (*CalendarClient) GetSyncToken

func (c *CalendarClient) GetSyncToken(ctx context.Context, calendarID string) (string, error)

type GmailClient

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

func InitGmailClient

func InitGmailClient(
	ctx context.Context,
	token *oauth2.Token,
	oauthConfig *oauth2.Config,
) (*GmailClient, error)

func (*GmailClient) GetHistoryID

func (c *GmailClient) GetHistoryID(ctx context.Context) (*uint64, error)

func (*GmailClient) GetHistoryWithID

func (c *GmailClient) GetHistoryWithID(
	ctx context.Context,
	historyID uint64,
	historyType string,
) (*gmail.ListHistoryResponse, error)

func (*GmailClient) GetUserEmail

func (c *GmailClient) GetUserEmail(
	ctx context.Context,
) (string, error)

func (*GmailClient) SendRawEmail

func (c *GmailClient) SendRawEmail(
	ctx context.Context,
	encodedMIME string,
) error

type GmailToken

type GmailToken struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
	Expiry       string `json:"expiry"`
}

Jump to

Keyboard shortcuts

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