gmail

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

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

type GmailTokenManager interface {
	GetToken() ([]byte, error)
}

GmailTokenManager defines an interface for obtaining OAuth2 tokens.

Jump to

Keyboard shortcuts

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