datasource

package
v0.0.0-...-38f6706 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataSource

type DataSource interface {
	GetAll() []Entry
	SaveNew(entry Entry)
}

DataSource is an interface defining what must be present for a potential back-end storage

type Entry

type Entry struct {
	Name  string
	Score float64

	//meta data about this entry
	Meta string
}

Entry is a leaderboard row containing a name, score, and metadata

type File

type File struct {
	FilePath string
	// contains filtered or unexported fields
}

func (*File) GetAll

func (f *File) GetAll() []Entry

Gets the entries out of the cache updates cache first if not initialized

func (*File) SaveNew

func (f *File) SaveNew(entry Entry)

Saves a new entry to file and updates cache

Jump to

Keyboard shortcuts

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