d2m

package module
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

README

D2M

GitHub release GitHub license Go GitHub commits

Dota2 scheduled matches tracker

Main

Installation

Install from source with go (requires go 1.18+)

go install github.com/vuon9/d2m@latest

Or download the binary from release page

Usage

❯ d2m

Features

  • View details of teams
  • Type o to open Twitch streaming link in web browser
  • Type ? to see all available filter commands
  • Type / to quickly filter with Regular expression then your regex, e.g. team1|team2
  • Display icons to help you quickly identify the status:
    • Team has info: ◆ (but not 100% sure if it has roster, some teams have no roster or no info at all)
    • Team has no info (e.g TBD): ◇
    • Live match has streaming page: Twitch icon

Documentation

Index

Constants

View Source
const (
	All matchFilter = iota
	FromToday
	Today
	Tomorrow
	Yesterday
	Live
	Finished
	Coming
)

Variables

View Source
var (
	KeyAllMatches       = key.NewBinding(key.WithKeys("a"), key.WithHelp("a", "all"))
	KeyFromTodayMatches = key.NewBinding(key.WithKeys("r"), key.WithHelp("r", "from today"))
	KeyTodayMatches     = key.NewBinding(key.WithKeys("t"), key.WithHelp("t", "today"))
	KeyTomorrowMatches  = key.NewBinding(key.WithKeys("m"), key.WithHelp("m", "tomorrow"))
	KeyYesterdayMatches = key.NewBinding(key.WithKeys("y"), key.WithHelp("y", "yesterday"))
	KeyLiveMatches      = key.NewBinding(key.WithKeys("l"), key.WithHelp("l", "live"))
	KeyFinishedMatches  = key.NewBinding(key.WithKeys("f"), key.WithHelp("f", "finished"))
	KeyComingMatches    = key.NewBinding(key.WithKeys("c"), key.WithHelp("c", "coming"))
	KeyOpenStreamURL    = key.NewBinding(key.WithKeys("o"), key.WithHelp("o", "open stream url"))
)

Functions

func CommandExists

func CommandExists() bool

CommandExists returns true if an 'open' command exists

func GetSubCommands

func GetSubCommands() []*cli.Command

func IsFilterKey

func IsFilterKey(msg tea.KeyMsg) bool

func OpenURL

func OpenURL(url string) error

OpenURL open url

func RegexFilter

func RegexFilter(term string, targets []string) []list.Rank

Types

type App

type App struct{}

func NewApp

func NewApp() *App

func (*App) Run

func (a *App) Run(ctx context.Context) error

RunProgram prints matches as table on terminal

type Encoder

type Encoder struct {
	// contains filtered or unexported fields
}

Encoder is encoder struct

func NewEncoder

func NewEncoder(w io.Writer) *Encoder

NewEncoder returns a new encoder instance

func (*Encoder) Encode

func (enc *Encoder) Encode(v interface{}) error

Encode encodes interface to toml

type MatchItem

type MatchItem interface {
	list.Item
	list.DefaultItem
}

type MetaData

type MetaData = toml.MetaData

MetaData is meta data struct

func Decode

func Decode(data string, v interface{}) (MetaData, error)

Decode decodes toml data to interface

func DecodeFile

func DecodeFile(fpath string, v interface{}) (MetaData, error)

DecodeFile decodes toml file

Directories

Path Synopsis
cmd
d2m
pkg
api

Jump to

Keyboard shortcuts

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