app

package
v0.0.0-...-e5aba8a Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authorize

func Authorize(
	ctx context.Context,
	gmailCredentials string,
	tokenFilePath string,
	opener Opener,
	timeout time.Duration,
	port uint,
	baseTransport http.RoundTripper,
	dryRun bool,
) (retErr error)

func LogTransport

func LogTransport(logDirPath string, baseTransport http.RoundTripper) http.RoundTripper

func Run

func Run(
	ctx context.Context,
	gmailCredentials string,
	tokenFilePath string,
	measurements []extractor.Measurement,
	influxdbServerURL string,
	influxdbAuthToken string,
	influxdbOrg string,
	influxdbBucket string,
	baseTransport http.RoundTripper,
	dryRunWriter io.Writer,
) (retErr error)

func SetupLogger

func SetupLogger()

Types

type Config

type Config struct {
	Measurements []extractor.Measurement `json:"measurements"`
	Influxdb     Influxdb                `json:"influxdb"`
}

func ReadConfig

func ReadConfig(
	ctx context.Context,
	path string,
	baseTransport http.RoundTripper,
) (_ *Config, retErr error)

type Influxdb

type Influxdb struct {
	ServerURL string `json:"serverUrl"`
	Org       string `json:"org"`
	Bucket    string `json:"bucket"`
}

type Opener

type Opener interface {
	Open(ctx context.Context, url string) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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