Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultScopes = []string{
"ZohoMail.messages.ALL",
"ZohoMail.folders.ALL",
"ZohoMail.tags.ALL",
"ZohoMail.accounts.ALL",
"ZohoMail.organization.accounts.ALL",
"ZohoMail.organization.domains.ALL",
"ZohoMail.organization.groups.ALL",
"ZohoMail.organization.spam.ALL",
"ZohoMail.organization.policy.ALL",
"ZohoMail.organization.audit.READ",
}
DefaultScopes defines the OAuth2 scopes required for v1 functionality. Zoho uses comma-separated scopes (not space-separated like standard OAuth2). Scope reference: https://www.zoho.com/mail/help/api/
Functions ¶
func InteractiveLogin ¶
InteractiveLogin performs an OAuth2 login flow using the browser. Opens the authorization URL in the default browser and starts a local callback server.
func ManualLogin ¶
ManualLogin performs an OAuth2 login flow by printing the auth URL and accepting a pasted redirect. This is useful for environments where the browser can't be opened automatically (SSH, headless, etc).
func ScopeString ¶
func ScopeString() string
ScopeString returns scopes as a comma-separated string. Zoho requires comma separator, not the space separator used by standard OAuth2.
Types ¶
type TokenCache ¶
type TokenCache struct {
// contains filtered or unexported fields
}
TokenCache implements oauth2.TokenSource with file-based caching and file locking. It prevents concurrent refresh stampede and auto-refreshes tokens proactively.
func NewTokenCache ¶
NewTokenCache creates a new token cache for the given configuration.
func (*TokenCache) ClearTokens ¶
func (tc *TokenCache) ClearTokens() error
ClearTokens removes all stored tokens (used by logout).
func (*TokenCache) SaveInitialTokens ¶
func (tc *TokenCache) SaveInitialTokens(token *oauth2.Token) error
SaveInitialTokens stores the tokens from a successful login. This should be called after InteractiveLogin or ManualLogin completes.