Documentation ¶
Index ¶
- Variables
- func DecodeDBID(dbID []byte) (string, error)
- func EncodeDBID(appraisalID string) ([]byte, error)
- func EncodeDBIDFromUint64(appraisalID uint64) []byte
- func NewAppraisalDB(filename string) (evepraisal.AppraisalDB, error)
- func NewPriceDB(filename string) (evepraisal.PriceDB, error)
- func NewTypeDB(filename string, writable bool) (typedb.TypeDB, error)
- type AppraisalDB
- func (db *AppraisalDB) Close() error
- func (db *AppraisalDB) DeleteAppraisal(appraisalID string) error
- func (db *AppraisalDB) GetAppraisal(appraisalID string, updateUsedTime bool) (*evepraisal.Appraisal, error)
- func (db *AppraisalDB) IncrementTotalAppraisals() error
- func (db *AppraisalDB) LatestAppraisals(reqCount int, kind string) ([]evepraisal.Appraisal, error)
- func (db *AppraisalDB) LatestAppraisalsByUser(user evepraisal.User, reqCount int, kind string, after string) ([]evepraisal.Appraisal, error)
- func (db *AppraisalDB) PutNewAppraisal(appraisal *evepraisal.Appraisal) error
- func (db *AppraisalDB) TotalAppraisals() (int64, error)
- type HTTPCache
- type PriceDB
- type TypeDB
- func (db *TypeDB) Close() error
- func (db *TypeDB) Delete() error
- func (db *TypeDB) GetType(typeName string) (typedb.EveType, bool)
- func (db *TypeDB) GetTypeByID(typeID int64) (typedb.EveType, bool)
- func (db *TypeDB) HasType(typeName string) bool
- func (db *TypeDB) ListTypes(startingTypeID int64, limit int64) ([]typedb.EveType, error)
- func (db *TypeDB) PutTypes(eveTypes []typedb.EveType) error
- func (db *TypeDB) Search(s string) []typedb.EveType
Constants ¶
This section is empty.
Variables ¶
var ( // ErrCacheKeyNotFound is returned whenever there's a cache miss ErrCacheKeyNotFound = errors.New("Cache key not found, cache miss") )
Functions ¶
func DecodeDBID ¶
DecodeDBID converts the database ID into the user-visible appraisalID
func EncodeDBID ¶
EncodeDBID encodes an appraisalID (which is seen by users) into a Unint64 that is used to sort appraisals properly
func EncodeDBIDFromUint64 ¶
EncodeDBIDFromUint64 converts the given uint64 into a byte array for storage. The uint64 is an intermediary form and is only really used when a new appraisalID is generated.
func NewAppraisalDB ¶
NewAppraisalDB returns a new AppraisalDB with the buckets created
func NewPriceDB ¶
NewPriceDB returns a new PriceDB instance
Types ¶
type AppraisalDB ¶
AppraisalDB holds all appraisals
func (*AppraisalDB) DeleteAppraisal ¶
func (db *AppraisalDB) DeleteAppraisal(appraisalID string) error
DeleteAppraisal deletes an appraisal by ID
func (*AppraisalDB) GetAppraisal ¶
func (db *AppraisalDB) GetAppraisal(appraisalID string, updateUsedTime bool) (*evepraisal.Appraisal, error)
GetAppraisal returns the given appraisal by ID
func (*AppraisalDB) IncrementTotalAppraisals ¶
func (db *AppraisalDB) IncrementTotalAppraisals() error
IncrementTotalAppraisals will increment to total appraisal count, useful to track non-persistent appraisals
func (*AppraisalDB) LatestAppraisals ¶
func (db *AppraisalDB) LatestAppraisals(reqCount int, kind string) ([]evepraisal.Appraisal, error)
LatestAppraisals returns the global latest appraisals
func (*AppraisalDB) LatestAppraisalsByUser ¶
func (db *AppraisalDB) LatestAppraisalsByUser(user evepraisal.User, reqCount int, kind string, after string) ([]evepraisal.Appraisal, error)
LatestAppraisalsByUser returns the latest appraisals by the given user
func (*AppraisalDB) PutNewAppraisal ¶
func (db *AppraisalDB) PutNewAppraisal(appraisal *evepraisal.Appraisal) error
PutNewAppraisal stores the given appraisal
func (*AppraisalDB) TotalAppraisals ¶
func (db *AppraisalDB) TotalAppraisals() (int64, error)
TotalAppraisals returns the number of total appraisals
type HTTPCache ¶
type HTTPCache struct {
// contains filtered or unexported fields
}
HTTPCache caches HTTP responses and adheres to the interface in github.com/gregjones/httpcache
func NewHTTPCache ¶
NewHTTPCache makes a new boltdb-based HTTPCache object
type PriceDB ¶
type PriceDB struct {
// contains filtered or unexported fields
}
PriceDB stores the market prices for items
func (*PriceDB) UpdatePrices ¶
UpdatePrices updates the price for the given typeID in the given market
type TypeDB ¶
type TypeDB struct {
// contains filtered or unexported fields
}
TypeDB holds all EveTypes
func (*TypeDB) GetTypeByID ¶
GetTypeByID returns the EveType that matches the integer ID