rvglutils

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2025 License: MIT Imports: 12 Imported by: 0

README

rvgl-utils CI godoc goreportcard

Documentation

Index

Constants

View Source
const (
	EnvVarRVGLDataDir = "RVGL_DATA_DIR"
)

Variables

This section is empty.

Functions

func DataDir

func DataDir() (string, error)

func RegisterSink

func RegisterSink(o SinkOpener, scheme string, schemes ...string)

func ResolveSessionCSV

func ResolveSessionCSV(opts ...ResolveSessionCSVOpt) (string, error)

Types

type Race

type Race struct {
	Track   string
	Results []Result
}

type ResolveSessionCSVOpt

type ResolveSessionCSVOpt interface {
	Apply(*ResolveSessionCSVOpts)
}

type ResolveSessionCSVOpts

type ResolveSessionCSVOpts struct {
	Time time.Time
	Name string
	Path string
}

func (*ResolveSessionCSVOpts) Apply

type Result

type Result struct {
	Position int
	Player   string
	Car      string
	Time     time.Duration
	BestLap  time.Duration
	Finished bool
	Cheating bool
}

type Score

type Score struct {
	Player string
	Points int
}

func ScoreSession

func ScoreSession(session *Session, opts ...ScoreSessionOpt) []Score

type ScoreSessionOpt

type ScoreSessionOpt interface {
	Apply(*ScoreSessionOpts)
}

type ScoreSessionOpts

type ScoreSessionOpts struct {
	IncludeAI bool
}

func (*ScoreSessionOpts) Apply

func (o *ScoreSessionOpts) Apply(opts *ScoreSessionOpts)

type Session

type Session struct {
	Version string
	Date    time.Time
	Host    string
	Mode    string
	Laps    int
	AI      bool
	Races   []Race
}

func DecodeSessionCSV

func DecodeSessionCSV(r io.Reader) (*Session, error)

type Sink

type Sink interface {
	UpdateScore(context.Context, *Session, []Score) error
}

func OpenSink

func OpenSink(ctx context.Context, s string) (Sink, error)

type SinkOpener

type SinkOpener interface {
	Open(context.Context, *url.URL) (Sink, error)
}

Directories

Path Synopsis
cmd
rvglsm command
sinks

Jump to

Keyboard shortcuts

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