gravl

package module
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: May 10, 2022 License: MIT Imports: 19 Imported by: 0

README

Overview

build codecov

gravl logo

gravl command line clients for activity-related services

Activity clients

Documentation

Documentation

Index

Constants

View Source
const RuntimeKey = "github.com/bzimmer/gravl#RuntimeKey"

Variables

View Source
var ErrUnknownEncoder = errors.New("unknown encoder")

Functions

func Afters

func Afters(afs ...cli.AfterFunc) cli.AfterFunc

Afters combines multiple `cli.AfterFunc`s into a single `cli.AfterFunc`

func Befores

func Befores(bfs ...cli.BeforeFunc) cli.BeforeFunc

Befores combines multiple `cli.BeforeFunc`s into a single `cli.BeforeFunc`

func Stats

func Stats(c *cli.Context) error

Stats logs and encodes (if requested) the stats

func Token

func Token(n int) (string, error)

Token produces a random token of length `n`

Types

type Encoder

type Encoder interface {
	Encode(v any) error
}

func Blackhole

func Blackhole() Encoder

func GPX

func GPX(writer io.Writer, compact bool) Encoder

func GeoJSON

func GeoJSON(writer io.Writer, compact bool) Encoder

func JSON

func JSON(writer io.Writer, compact bool) Encoder

func XML

func XML(writer io.Writer, compact bool) Encoder

type ExporterFunc

type ExporterFunc func(c *cli.Context) (activity.Exporter, error)

type Rt

type Rt struct {
	// Metadata
	Start time.Time

	// Activity clients
	Zwift            *zwift.Client
	Strava           *strava.Client
	RideWithGPS      *rwgps.Client
	CyclingAnalytics *cyclinganalytics.Client
	InReach          *inreach.Client

	// Endpoints
	Endpoints map[string]oauth2.Endpoint

	// Export / Upload
	Exporters map[string]ExporterFunc
	Uploaders map[string]UploaderFunc

	// IO
	Fs      afero.Fs
	Encoder Encoder

	// Metrics
	Metrics *metrics.Metrics
	Sink    *metrics.InmemSink

	// Evaluation
	Filterer  func(string) (eval.Filterer, error)
	Evaluator func(string) (eval.Evaluator, error)
}

Rt holds the gravl runtime

func Runtime

func Runtime(c *cli.Context) *Rt

type UploaderFunc

type UploaderFunc func(c *cli.Context) (activity.Uploader, error)

Directories

Path Synopsis
qp
cmd

Jump to

Keyboard shortcuts

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