server

package
v0.0.0-...-93756bf Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CachedStat

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

type CachedUnits

type CachedUnits struct {
	Units []*unit.Unit
	Mercs map[string]*mercenary.Mercenary
}

type Server

type Server struct {
	Api      *ltdapi.LtdApi
	Version  string
	AllUnits CachedUnits
	UnitMap  map[string]*unit.Unit
	Stats    map[string]map[int]map[string]map[string]CachedStat
	Tables   map[string]bool
	Versions []string
	Guides   []guide.Guide
	// contains filtered or unexported fields
}

func New

func New() (*Server, error)

func (*Server) CreateTable

func (s *Server) CreateTable(name string) error

func (*Server) DeleteOldData

func (s *Server) DeleteOldData(version, table string) error

func (*Server) FindHold

func (s *Server) FindHold(tb, hash string, version string) (*dynamicdata.Hold, error)

func (*Server) FindSend

func (s *Server) FindSend(tb string, id int, sends string) (*dynamicdata.Send, error)

func (*Server) GenerateGuides

func (s *Server) GenerateGuides()

func (*Server) GetMercs

func (s *Server) GetMercs() (map[string]*mercenary.Mercenary, error)

func (*Server) GetUnits

func (s *Server) GetUnits() (map[string]*unit.Unit, error)

func (*Server) GetUpgrades

func (s *Server) GetUpgrades() (map[string][]string, error)

func (*Server) GetVersions

func (s *Server) GetVersions() ([]string, error)

func (*Server) HandleGetGuides

func (s *Server) HandleGetGuides(w http.ResponseWriter, r *http.Request)

func (*Server) HandleGetTopHolds

func (s *Server) HandleGetTopHolds(w http.ResponseWriter, r *http.Request)

func (*Server) HandleGetUnits

func (s *Server) HandleGetUnits(w http.ResponseWriter, r *http.Request)

func (*Server) HandleGetVersions

func (s *Server) HandleGetVersions(w http.ResponseWriter, r *http.Request)

func (*Server) InsertSend

func (s *Server) InsertSend(tb string, send *dynamicdata.Send) (int, error)

func (*Server) RefreshTables

func (s *Server) RefreshTables() error

func (*Server) SaveHold

func (s *Server) SaveHold(tb string, h *dynamicdata.Hold) (int, error)

func (*Server) SaveMerc

func (s *Server) SaveMerc(m *mercenary.Mercenary) error

func (*Server) SaveUnit

func (s *Server) SaveUnit(u *unit.Unit) error

func (*Server) SaveUpgrade

func (s *Server) SaveUpgrade(up *unit.UnitUpgrade) error

func (*Server) UpdateHold

func (s *Server) UpdateHold(tb string, h *dynamicdata.Hold) error

func (*Server) UpdateSend

func (s *Server) UpdateSend(tb string, send *dynamicdata.Send) error

Jump to

Keyboard shortcuts

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