Documentation ¶
Index ¶
- func NewGmailEmailSenderAPIKey(ctx context.Context, apiKey, user string) (*gmailMessageSenderWrapper, error)
- func NewGmailEmailSenderJWT(ctx context.Context, configJson []byte, user string) (*gmailMessageSenderWrapper, error)
- func NewGmailEmailSenderJWTAccess(ctx context.Context, jsonCredentials []byte, user string) (*gmailMessageSenderWrapper, error)
- func NewGmailEmailSenderOauth2(ctx context.Context, configJson []byte, tokenManager GmailTokenManager, ...) (*gmailMessageSenderWrapper, error)
- func NewGmailEmailSenderServiceAccount(ctx context.Context, jsonCredentials []byte, user string) (*gmailMessageSenderWrapper, error)
- type GmailTokenManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGmailEmailSenderAPIKey ¶
func NewGmailEmailSenderAPIKey(ctx context.Context, apiKey, user string) (*gmailMessageSenderWrapper, error)
NewGmailEmailSenderAPIKey initializes a new gmailEmailSenderAPIKey instance using an API key.
Parameters:
- ctx: The context for the API requests.
- apiKey: The API key to be used for authentication.
- user: The user for whom the email is being sent (usually "me").
Returns:
- *gmailMessageSenderWrapper: A pointer to the initialized gmailMessageSenderWrapper.
- error: An error if the initialization fails.
func NewGmailEmailSenderJWT ¶
func NewGmailEmailSenderJWT(ctx context.Context, configJson []byte, user string) (*gmailMessageSenderWrapper, error)
NewGmailEmailSenderJWT initializes a new gmailEmailSenderJWT instance using JWT configuration.
Parameters:
- ctx: The context for the API requests.
- configJson: A byte slice containing the JWT client credentials JSON.
- user: The user for whom the email is being sent (usually "me").
Returns:
- *gmailMessageSenderWrapper: A pointer to the initialized gmailMessageSenderWrapper.
- error: An error if the initialization fails.
func NewGmailEmailSenderJWTAccess ¶
func NewGmailEmailSenderJWTAccess(ctx context.Context, jsonCredentials []byte, user string) (*gmailMessageSenderWrapper, error)
NewGmailEmailSenderJWTAccess initializes a new gmailEmailSenderJWTAccess instance using a JWT access token.
Parameters:
- ctx: The context for the API requests.
- jsonCredentials: A byte slice containing the JSON service account credentials.
- user: The user for whom the email is being sent.
Returns:
- *gmailMessageSenderWrapper: A pointer to the initialized gmailMessageSenderWrapper.
- error: An error if the initialization fails.
func NewGmailEmailSenderOauth2 ¶
func NewGmailEmailSenderOauth2(ctx context.Context, configJson []byte, tokenManager GmailTokenManager, user string) (*gmailMessageSenderWrapper, error)
NewGmailEmailSenderOauth2 initializes a new gmailEmailSenderOauth2 instance using OAuth2 credentials and token management.
Parameters:
- ctx: The context for the API requests.
- configJson: A byte slice containing the OAuth2 client credentials JSON.
- tokenManager: An implementation of the GmailTokenManager interface.
- user: The user for whom the email is being sent (usually "me").
Returns:
- *gmailMessageSenderWrapper: A pointer to the initialized gmailMessageSenderWrapper.
- error: An error if the initialization fails.
func NewGmailEmailSenderServiceAccount ¶
func NewGmailEmailSenderServiceAccount(ctx context.Context, jsonCredentials []byte, user string) (*gmailMessageSenderWrapper, error)
NewGmailEmailSenderServiceAccount initializes a new gmailEmailSenderServiceAccount instance using service account JSON credentials.
Parameters:
- ctx: The context for the API requests.
- jsonCredentials: A byte slice containing the JSON service account credentials.
- user: The user for whom the email is being sent.
Returns:
- *gmailMessageSenderWrapper: A pointer to the initialized gmailMessageSenderWrapper.
- error: An error if the initialization fails.
Types ¶
type GmailTokenManager ¶
GmailTokenManager defines an interface for obtaining OAuth2 tokens.