Documentation ¶
Overview ¶
Package characterstatus is a service which provides cached access to the current update status of general and character sections.
Index ¶
- type StatusCacheService
- func (sc *StatusCacheService) CharacterSectionExists(characterID int32, section app.CharacterSection) bool
- func (sc *StatusCacheService) CharacterSectionGet(characterID int32, section app.CharacterSection) (app.SectionStatus, bool)
- func (sc *StatusCacheService) CharacterSectionList(characterID int32) []app.SectionStatus
- func (sc *StatusCacheService) CharacterSectionSet(o *app.CharacterSectionStatus)
- func (sc *StatusCacheService) CharacterSectionSummary(characterID int32) app.StatusSummary
- func (sc *StatusCacheService) GeneralSectionExists(section app.GeneralSection) bool
- func (sc *StatusCacheService) GeneralSectionGet(section app.GeneralSection) (app.SectionStatus, bool)
- func (sc *StatusCacheService) GeneralSectionList() []app.SectionStatus
- func (sc *StatusCacheService) GeneralSectionSet(o *app.GeneralSectionStatus)
- func (sc *StatusCacheService) GeneralSectionSummary() app.StatusSummary
- func (sc *StatusCacheService) InitCache(ctx context.Context, st app.StatusCacheStorage) error
- func (sc *StatusCacheService) ListCharacters() []*app.CharacterShort
- func (sc *StatusCacheService) SectionList(entityID int32) []app.SectionStatus
- func (sc *StatusCacheService) Summary() app.StatusSummary
- func (sc *StatusCacheService) UpdateCharacters(ctx context.Context, r app.StatusCacheStorage) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StatusCacheService ¶
type StatusCacheService struct {
// contains filtered or unexported fields
}
StatusCacheService provides cached access to the current update status of all characters to improve performance of UI refresh tickers.
func New ¶
func New(cache app.CacheService) *StatusCacheService
New creates and returns a new instance of a character status service. When nil is provided it will create and use it's own cache instance.
func (*StatusCacheService) CharacterSectionExists ¶
func (sc *StatusCacheService) CharacterSectionExists(characterID int32, section app.CharacterSection) bool
CharacterSectionExists reports wether a character section exists.
func (*StatusCacheService) CharacterSectionGet ¶
func (sc *StatusCacheService) CharacterSectionGet(characterID int32, section app.CharacterSection) (app.SectionStatus, bool)
func (*StatusCacheService) CharacterSectionList ¶
func (sc *StatusCacheService) CharacterSectionList(characterID int32) []app.SectionStatus
func (*StatusCacheService) CharacterSectionSet ¶
func (sc *StatusCacheService) CharacterSectionSet(o *app.CharacterSectionStatus)
func (*StatusCacheService) CharacterSectionSummary ¶
func (sc *StatusCacheService) CharacterSectionSummary(characterID int32) app.StatusSummary
func (*StatusCacheService) GeneralSectionExists ¶
func (sc *StatusCacheService) GeneralSectionExists(section app.GeneralSection) bool
func (*StatusCacheService) GeneralSectionGet ¶
func (sc *StatusCacheService) GeneralSectionGet(section app.GeneralSection) (app.SectionStatus, bool)
func (*StatusCacheService) GeneralSectionList ¶
func (sc *StatusCacheService) GeneralSectionList() []app.SectionStatus
func (*StatusCacheService) GeneralSectionSet ¶
func (sc *StatusCacheService) GeneralSectionSet(o *app.GeneralSectionStatus)
func (*StatusCacheService) GeneralSectionSummary ¶
func (sc *StatusCacheService) GeneralSectionSummary() app.StatusSummary
func (*StatusCacheService) InitCache ¶
func (sc *StatusCacheService) InitCache(ctx context.Context, st app.StatusCacheStorage) error
InitCache initializes the internal state from local storage. It should always be called once for a new instance to ensure the cache is current.
func (*StatusCacheService) ListCharacters ¶
func (sc *StatusCacheService) ListCharacters() []*app.CharacterShort
func (*StatusCacheService) SectionList ¶
func (sc *StatusCacheService) SectionList(entityID int32) []app.SectionStatus
func (*StatusCacheService) Summary ¶
func (sc *StatusCacheService) Summary() app.StatusSummary
Summary returns the current summary status in percent of fresh sections and the number of missing and errors.
func (*StatusCacheService) UpdateCharacters ¶
func (sc *StatusCacheService) UpdateCharacters(ctx context.Context, r app.StatusCacheStorage) error