ffs

package
v0.14.4 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrCreateSchema        = Error("create schema")
	ErrCreateMeta          = Error("create metadata")
	ErrDatabaseExists      = Error("database exists")
	ErrForeignKeysDisabled = Error("foreign keys disabled")
	ErrInvalidPath         = Error("invalid path")
	ErrPragmaReturnedNil   = Error("pragma returned nil")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Clan_t

type Clan_t struct {
	Id    string    // id of the player's clan
	Turns []*Turn_t // list of turns that the clan has uploaded reports for
}

type Error

type Error string

func (Error) Error

func (e Error) Error() string

type Option

type Option func(*Store) error

func WithPath

func WithPath(path string) Option

type Report_t

type Report_t struct {
	Id    int64    // id of the report from the database table
	Clan  string   // id of the clan that owns the report
	Units []Unit_t // list of units included in this report
	Path  string   // path to the report file
	Map   string   // path to the map, only set when there is a map file
}

type Session_t

type Session_t struct {
	Id        string
	Uid       int64
	Clan      string
	ExpiresAt time.Time
}

func (Session_t) IsAuthenticated

func (sess Session_t) IsAuthenticated() bool

type Store

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

func New

func New(options ...Option) (*Store, error)

func (*Store) Close

func (s *Store) Close() error

func (*Store) CreateSession

func (s *Store) CreateSession(clan, magicKey string) (Session_t, error)

func (*Store) DeleteSession

func (s *Store) DeleteSession(sid string) error

func (*Store) GetClan

func (s *Store) GetClan(uid int64) (Clan_t, error)

func (*Store) GetClans

func (s *Store) GetClans(id string) ([]string, error)

func (*Store) GetSession

func (s *Store) GetSession(r *http.Request) Session_t

type Turn_t

type Turn_t struct {
	Id      string
	Reports []*Report_t // list of reports that the clan has uploaded for this turn
}

type Unit_t

type Unit_t struct {
	Id          string
	CurrentHex  string
	PreviousHex string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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