Documentation
¶
Overview ¶
Package images implements the durable EVE-KILL image surface.
Index ¶
- Constants
- func Register(a huma.API, service *Service)
- type Cache
- type CacheStats
- type Error
- type ImportOptions
- type ImportResult
- func GenerateMapImages(ctx context.Context, db MapDatabase, store ObjectStore, ...) (ImportResult, error)
- func ImportBundledStatic(ctx context.Context, store ObjectStore, options ImportOptions) (ImportResult, error)
- func ImportOldCharacters(ctx context.Context, store ObjectStore, source string, client *http.Client, ...) (ImportResult, error)
- func ImportStaticTree(ctx context.Context, store ObjectStore, root string, options ImportOptions) (ImportResult, error)
- type MapDatabase
- type MapGenerateOptions
- type MapKind
- type ObjectStore
- type Options
- type PostgresSocialLoader
- type Result
- type Service
- func (s *Service) Available() bool
- func (s *Service) CacheStats() CacheStats
- func (s *Service) KillmailSocial(ctx context.Context, id int64) (Result, error)
- func (s *Service) OldCharacter(ctx context.Context, id int64, size int, format string) (Result, error)
- func (s *Service) Static(ctx context.Context, category string, name string, size int, format string) (Result, error)
- func (s *Service) Type(ctx context.Context, id int64, variant string, size int, format string) (Result, error)
- type SocialDatabase
- type SocialKillmail
- type SocialLoader
- type SocialParty
- type TypeExportSyncOptions
- type TypeExportSyncResult
Constants ¶
const ( TurtleToolsRepository = "SentientTurtle/EVE-TurtleTools" TurtleTypeExportAsset = "Image.Export.Collection.zip" )
const (
OldCharacterArchiveURL = "https://data.everef.net/ccp/portraits/OldCharPortraits_256.zip"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is the serve-only, byte-bounded LRU for final encoded responses. Values are immutable after insertion, so a hit can be written directly to the response without another allocation proportional to the image size.
func (*Cache) RemovePrefix ¶
func (*Cache) Stats ¶
func (c *Cache) Stats() CacheStats
type CacheStats ¶
type ImportOptions ¶
type ImportOptions struct {
Concurrency int
CacheDirectory string
Force bool
Progress func(ImportResult)
DownloadProgress func(completed, total int64)
}
type ImportResult ¶
type ImportResult struct {
Scanned int64 `json:"scanned"`
Uploaded int64 `json:"uploaded"`
Skipped int64 `json:"skipped"`
Bytes int64 `json:"bytes"`
}
func GenerateMapImages ¶ added in v0.1.5
func GenerateMapImages(ctx context.Context, db MapDatabase, store ObjectStore, options MapGenerateOptions) (ImportResult, error)
func ImportBundledStatic ¶ added in v0.1.5
func ImportBundledStatic(ctx context.Context, store ObjectStore, options ImportOptions) (ImportResult, error)
ImportBundledStatic imports the UI, Dust 514, and overlay assets shipped in the Shrike binary. Map images are generated from PostgreSQL separately.
func ImportOldCharacters ¶
func ImportOldCharacters( ctx context.Context, store ObjectStore, source string, client *http.Client, options ImportOptions, ) (ImportResult, error)
ImportOldCharacters downloads or opens the static EVE Ref archive and uploads individual portraits. Remote archives are kept in CacheDirectory and resumed with HTTP Range requests. B2 completion markers are published after each two-digit shard, so a restart neither probes every object nor repeats more than the interrupted shard.
func ImportStaticTree ¶
func ImportStaticTree( ctx context.Context, store ObjectStore, root string, options ImportOptions, ) (ImportResult, error)
ImportStaticTree uploads the checked-in image-server assets that are not supplied by the TurtleTools release: maps, UI icons, Dust 514 images, and overlay definitions.
type MapDatabase ¶ added in v0.1.5
type MapGenerateOptions ¶ added in v0.1.5
type ObjectStore ¶
type ObjectStore interface {
GetObject(context.Context, string) (*objectstore.Object, error)
Stat(context.Context, string) (*objectstore.ObjectInfo, error)
PutWithOptions(context.Context, string, []byte, objectstore.PutOptions) error
Delete(context.Context, string) error
}
type PostgresSocialLoader ¶
type PostgresSocialLoader struct {
DB SocialDatabase
}
func (PostgresSocialLoader) LoadKillmailSocial ¶
func (l PostgresSocialLoader) LoadKillmailSocial( ctx context.Context, id int64, ) (SocialKillmail, bool, error)
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) CacheStats ¶
func (s *Service) CacheStats() CacheStats
func (*Service) KillmailSocial ¶
func (*Service) OldCharacter ¶
type SocialDatabase ¶
type SocialKillmail ¶
type SocialKillmail struct {
TotalValue float64
SolarSystemName string
RegionName string
Victim SocialParty
FinalBlow *SocialParty
}
type SocialLoader ¶
type SocialLoader interface {
LoadKillmailSocial(context.Context, int64) (SocialKillmail, bool, error)
}
SocialLoader owns the database lookup so rendering stays testable without a live Postgres instance.
type SocialParty ¶
type TypeExportSyncOptions ¶
type TypeExportSyncResult ¶
type TypeExportSyncResult struct {
Release string `json:"release"`
Digest string `json:"digest"`
Changed bool `json:"changed"`
Import ImportResult `json:"import"`
}
func SyncTypeExport ¶
func SyncTypeExport( ctx context.Context, store ObjectStore, options TypeExportSyncOptions, ) (TypeExportSyncResult, error)