stats

package
v0.0.0-...-bd21981 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2023 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MainPageURL = "http://tenhou.net/sc/raw/"
	ListURL     = "http://tenhou.net/sc/raw/list.cgi"
	ListOldURL  = "http://tenhou.net/sc/raw/list.cgi?old"
)
View Source
const (
	Location = "./tenhou/stats/"
)

Variables

This section is empty.

Functions

func CMD

func CMD() *cobra.Command

func MakeFullURL

func MakeFullURL(short string) string

func MakeFullURLs

func MakeFullURLs(short []string) []string

func ParseMain

func ParseMain(data string) []string

ParseMain parses tenhou main page http://tenhou.net/sc/raw/ and returns list of year index archives. Like scraw2017.zip

func ParseStats

func ParseStats(reader io.Reader, info *StatFileInfo, f func(*stats.Record) error) error

func ParseStatsForFile

func ParseStatsForFile(reader io.Reader, filename string, f func(*stats.Record) error) error

Types

type FileIndex

type FileIndex struct {
	utils.JSONGZFile
	// contains filtered or unexported fields
}

func LoadIndex

func LoadIndex() (*FileIndex, error)

func NewFileIndex

func NewFileIndex(p string) *FileIndex

func NewIndex

func NewIndex() *FileIndex

func (*FileIndex) Add

func (i *FileIndex) Add(url, path string) error

func (*FileIndex) Check

func (i *FileIndex) Check(url string) bool

func (*FileIndex) Files

func (i *FileIndex) Files() []string

func (*FileIndex) JustAdd

func (i *FileIndex) JustAdd(url, path string)

func (*FileIndex) Len

func (i *FileIndex) Len() int

func (*FileIndex) Load

func (i *FileIndex) Load() error

func (*FileIndex) Save

func (i *FileIndex) Save() (err error)

func (*FileIndex) Validate

func (i *FileIndex) Validate() error

type ListItem

type ListItem struct {
	File string `yaml:"file"`
	Size int    `yaml:"size"`
}

func MustParseList

func MustParseList(data string) []ListItem

func ParseList

func ParseList(data string) ([]ListItem, error)

type StatFileInfo

type StatFileInfo struct {
	Source string
	Date   time.Time
}

func ParseStatFileName

func ParseStatFileName(filename string) (*StatFileInfo, error)

Jump to

Keyboard shortcuts

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