model

package
v0.0.0-...-d602987 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound       = errors.New("Not Found")
	ErrNotImplemented = errors.New("Not Implemented")
)

Functions

This section is empty.

Types

type Character

type Character struct {
	ID                 int    `json:"-"`
	CharacterID        int    `json:"id"`
	CharacterName      string `json:"name"`
	CharacterOwnerHash string `json:"-"`
	UserID             int    `json:"-"`
}

type DB

type DB interface {
	AllUserStations() ([]*sde.Station, error)
	DeleteFavorites(int) error
	FindOrCreateCharacterForUser(int, esi.VerifyOK) (*Character, error)
	FindOrCreateUserAndCharacter(esi.VerifyOK) (*User, *Character, error)
	GetCharacterByUserAndCharacterID(int, int) (*Character, error)
	GetCharacterByOwnerHash(string) (*Character, error)
	GetCharactersForUser(int) (map[int]*Character, error)
	GetFavoriteTypes(userID int) ([]int, error)
	GetLatestTxnID() (int, error)
	GetPricesForStation(int) (map[int]esi.Price, error)
	GetTokenForCharacter(characterID int) (*Token, error)
	GetUser(userID int) (*User, error)
	IsFavorite(userID, typeID int) (bool, error)
	RemoveCharacterForUser(int, int) error
	SaveActiveCharacterHash(int, string) error
	SavePrice(int, int, esi.Price) error
	SaveTokenForCharacter(int, string, string) error
	SaveUserStationA(userID, stationID int) error
	SaveUserStationB(userID, stationID int) error
	SetFavorite(userID, typeID int, val bool) error
}

func Initialize

func Initialize(dbfilename string) (DB, error)

type Token

type Token struct {
	ID           int
	CharacterID  int
	RefreshToken string
	Scopes       string
}

type User

type User struct {
	ID                  int    `json:"-"`
	ActiveCharacterHash string `json:"-"`
	ActiveCharacterID   int    `json:"activeCharacterID"`
	ActiveCharacterName string `json:"activeCharacterName"`
	StationA            int    `json:"stationA"`
	StationB            int    `json:"statoinB"`
}

Jump to

Keyboard shortcuts

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