Documentation ¶
Overview ¶
Package gmail is used for sending emails via gmail
Index ¶
- Variables
- func NewWithAPIKey(ctx context.Context, apiKey, user string) (newman.EmailSender, error)
- func NewWithJWTAccess(ctx context.Context, jsonCredentials []byte, user string) (newman.EmailSender, error)
- func NewWithJWTConfig(ctx context.Context, configJSON []byte, user string) (newman.EmailSender, error)
- func NewWithOauth2(ctx context.Context, configJSON []byte, tokenManager TokenManager, user string) (newman.EmailSender, error)
- func NewWithServiceAccount(ctx context.Context, jsonCredentials []byte, user string) (newman.EmailSender, error)
- type TokenManager
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrFailedToSendEmail is returned when an email fails to send ErrFailedToSendEmail = errors.New("failed to send email") // ErrNoUsersMessagesService is returned when no UsersMessagesService is initiated ErrNoUsersMessagesService = errors.New("no UsersMessagesService initiated") // ErrUnableToBuildMIMEMessage is returned when a MIME message fails to be built ErrUnableToBuildMIMEMessage = errors.New("unable to build MIME message") // ErrUnableToStartGmailService is returned when a Gmail service fails to start ErrUnableToStartGmailService = errors.New("unable to start Gmail service") // ErrUnableToParseServiceAccount is returned when a service account fails to be parsed ErrUnableToParseServiceAccount = errors.New("unable to parse service account") // ErrUnableToParseJWTCredentials is returned when JWT credentials fail to be parsed ErrUnableToParseJWTCredentials = errors.New("unable to parse JWT credentials") // ErrInvalidToken is returned when a token is invalid ErrInvalidToken = errors.New("invalid token") // ErrMockServiceError is returned when a mock service encounters an error ErrMockServiceError = errors.New("mock service error") )
Functions ¶
func NewWithAPIKey ¶ added in v0.1.1
NewWithAPIKey initializes a new gmailEmailSenderAPIKey instance using an API key
func NewWithJWTAccess ¶ added in v0.1.1
func NewWithJWTAccess(ctx context.Context, jsonCredentials []byte, user string) (newman.EmailSender, error)
NewWithJWTAccess initializes a new gmailEmailSenderJWTAccess instance using a JWT access token
func NewWithJWTConfig ¶ added in v0.1.1
func NewWithJWTConfig(ctx context.Context, configJSON []byte, user string) (newman.EmailSender, error)
NewWithJWTConfig initializes a new gmailEmailSenderJWT instance using JWT configuration
func NewWithOauth2 ¶ added in v0.1.1
func NewWithOauth2(ctx context.Context, configJSON []byte, tokenManager TokenManager, user string) (newman.EmailSender, error)
NewWithOauth2 initializes a new gmailEmailSenderOauth2 instance using OAuth2 credentials
func NewWithServiceAccount ¶ added in v0.1.1
func NewWithServiceAccount(ctx context.Context, jsonCredentials []byte, user string) (newman.EmailSender, error)
NewWithServiceAccount initializes a new gmailEmailSenderServiceAccount instance using service account JSON credentials
Types ¶
type TokenManager ¶ added in v0.1.1
TokenManager defines an interface for obtaining OAuth2 tokens
Click to show internal directories.
Click to hide internal directories.