gmail

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package gmail provides the transport implementation for gmail.

Index

Constants

View Source
const (
	// Provider is the provider name for Gmail.
	Provider = "gmail"
)

Variables

This section is empty.

Functions

func AutowireTransport

func AutowireTransport(ctx context.Context, cfg map[string]interface{}) (postdog.Transport, error)

AutowireTransport autowires gmail transport from the given config.

func NewTransport

func NewTransport(ctx context.Context, options ...Option) (postdog.Transport, error)

NewTransport initializes a gmail transport. Credentials must be provided, if GMAIL_CREDENTIALS environment variable is not set. If no scopes are provided, the gmail.MailGoogleComScope (https://mail.google.com/) scope is used.

func Register

func Register(cfg *autowire.Config)

Register registers the transport factory in the autowire config.

Types

type Option

type Option func(*transport)

Option is a gmail transport option.

func ClientOptions

func ClientOptions(options ...option.ClientOption) Option

ClientOptions adds custom option.ClientOption to the gmail service.

func Credentials

func Credentials(creds *google.Credentials) Option

Credentials adds an option.ClientOption that authenticates API calls.

func CredentialsFile

func CredentialsFile(filename string) Option

CredentialsFile adds an option.ClientOption that authenticates API calls with the given service account or refresh token JSON credentials file.

func CredentialsJSON

func CredentialsJSON(p []byte) Option

CredentialsJSON adds an option.ClientOption that authenticates API calls with the given service account or refresh token JSON credentials.

func Scopes

func Scopes(scopes ...string) Option

Scopes adds gmail scopes.

Jump to

Keyboard shortcuts

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