activity

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFieldNotFound = errors.New("field not found in struct")
	ErrTypeNotAssert = errors.New("could not assert type in struct")
)
View Source
var (
	ErrTextLocationNotInitialized = errors.New("textLocation not properly initialized")
	ErrDateNotInitialized         = errors.New("date not properly initialized")
)
View Source
var ErrTourenbuchDirNameWrong = errors.New("directory name does not match expected schema")

Functions

func GetActivityLocation

func GetActivityLocation() (string, string, error)

func GetAssetLibraryPath

func GetAssetLibraryPath() (string, error)

func GetFromHeader added in v0.2.0

func GetFromHeader[T any](dir string, field string) (T, error)

func GetStartLocationQr

func GetStartLocationQr() (string, error)

func GetTextLibraryPath

func GetTextLibraryPath() (string, error)

Types

type Activity

type Activity struct {
	Meta Meta
	Tb   Tourenbuch
}

func (*Activity) CreateActivity

func (a *Activity) CreateActivity() error

func (*Activity) StravaSync

func (a *Activity) StravaSync() error
type Header struct {
	Meta struct {
		Version string `yaml:"version,omitempty"`
	} `yaml:"meta"`
	Activity struct {
		Wandern       bool   `yaml:"wandern,omitempty"`
		Skitour       bool   `yaml:"skitour,omitempty"`
		MTB           bool   `yaml:"mtb,omitempty"`
		Type          string `yaml:"type"`
		Date          string `yaml:"date"`
		Title         string `yaml:"title"`
		PointOfOrigin struct {
			Name   string `yaml:"name"`
			Qr     string `yaml:"qr"`
			Region string `yaml:"region"`
		} `yaml:"pointOfOrigin"`
		Season       string `yaml:"season"`
		Rating       string `yaml:"rating"`
		Company      string `yaml:"company"`
		Restaurant   string `yaml:"restaurant"`
		Difficulty   string `yaml:"difficulty,omitempty"`
		LLB          string `yaml:"llb,omitempty"`
		MaxElevation string `yaml:"maxElevation"`
	} `yaml:"activity"`
	Layout struct {
		HeadElevationProfile        bool    `yaml:"headElevationProfile"`
		ElevationProfileType        string  `yaml:"elevationProfileType,omitempty"`
		ElevationProfileRightMargin float32 `yaml:"elevationProfileRightMargin"`
		TableSize                   float32 `yaml:"tableSize"`
		MapSize                     float32 `yaml:"mapSize"`
		MapHeight                   int     `yaml:"mapHeight"`
		Linespread                  float32 `yaml:"linespread"`
	} `yaml:"layout"`
	Stats struct {
		Ascent      string `yaml:"ascent"`
		Distance    string `yaml:"distance"`
		MovingTime  string `yaml:"movingTime"`
		OverallTime string `yaml:"overallTime"`
		StartTime   string `yaml:"startTime"`
		SummitTime  string `yaml:"summitTime"`
		Puls        string `yaml:"puls,omitempty"`
	} `yaml:"stats"`
}

type Meta

type Meta struct {
	Category           string
	Name               string
	TextLocation       string
	AssetLocation      string
	StravaSync         bool
	StravaGpxSync      bool
	StravaID           int64
	QueryStartLocation bool
	Multiday           bool
}

type Tourenbuch

type Tourenbuch struct {
	Title           string
	Date            time.Time
	Rating          int
	TrailDifficulty int
	SkiDifficulty   string
	AvalancheReport int
	StartLocationQr string
	Company         string
	Restaurant      string
	Distance        int
	Ascent          int
	MaxElevation    int
	MovingTime      time.Duration
	ElapsedTime     time.Duration
	StartTime       time.Time
}

Jump to

Keyboard shortcuts

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