gmail

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnauthorized = errors.New("gmail: unauthorized")
	ErrForbidden    = errors.New("gmail: forbidden")
	ErrRateLimited  = errors.New("gmail: rate limited")
	ErrUpstream     = errors.New("gmail: upstream")
)

Error sentinels for cmd.classifyError integration.

Functions

func ValidateServiceAccountJSON

func ValidateServiceAccountJSON(b []byte) error

ValidateServiceAccountJSON checks structure-level invariants on a candidate service-account JSON blob: parseable JSON, type=="service_account", non-empty client_email. Used at configure time so bad input is rejected before it hits Keychain.

Types

type Sender

type Sender interface {
	Send(ctx context.Context, rfc822 []byte) (messageID string, err error)
}

Sender sends a pre-built RFC 5322 message via Gmail API users.messages.send, using the service account in saJSON to impersonate subjectUser via DWD.

func NewSender

func NewSender(ctx context.Context, saJSON []byte, subjectUser string) (Sender, error)

NewSender returns a Sender. saJSON is the raw service-account JSON read from Keychain. subjectUser is the Workspace user to impersonate (the "From" address). The OAuth scope is hard-coded to gmail.send.

Jump to

Keyboard shortcuts

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