Documentation ¶
Overview ¶
Package hammer provides a queued work consumer for CCP ESI API
Index ¶
- Constants
- type ContactEntity
- type FactionWarEntities
- type Hammer
- func (s *Hammer) AddAlliance(allianceID int32) error
- func (s *Hammer) AddCharacter(characterID int32) error
- func (s *Hammer) AddCorporation(corporationID int32) error
- func (s *Hammer) BulkLookup(ids []int32) error
- func (s *Hammer) ChangeBasePath(path string)
- func (s *Hammer) ChangeTokenPath(path string)
- func (s *Hammer) Close()
- func (s *Hammer) GetActiveWarsByID(id int64) ([]ContactEntity, error)
- func (s *Hammer) GetCharacterIDByName(character string) (int32, error)
- func (s *Hammer) GetFactionWarEntitiesForID(factionID int32) ([]FactionWarEntities, error)
- func (s *Hammer) GetPendingWarsByID(id int64) ([]ContactEntity, error)
- func (s *Hammer) GetTokenSourceContext(c context.Context, characterID, tokenCharacterID int32) (context.Context, error)
- func (s *Hammer) QueueResult(v interface{}, topic string) error
- func (s *Hammer) QueueWork(work []redisqueue.Work, priority int) error
- func (s *Hammer) Run()
- func (s *Hammer) SetToken(cid, tcid int32, token *oauth2.Token) error
Constants ¶
const NUM_WORKERS = 25
NUM_WORKERS number of concurrent workers
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContactEntity ¶
ContactEntity denormalizes corporations, alliance, and characters
type FactionWarEntities ¶
type Hammer ¶
type Hammer struct {
// contains filtered or unexported fields
}
Hammer completes work handling CCP ESI and other API.
func NewHammer ¶
func NewHammer(redis *redis.Pool, db *sqlx.DB, nsq *nsq.Producer, refresh, tokenClientID, tokenSecret string) *Hammer
NewHammer Service.
func (*Hammer) AddAlliance ¶
AddAlliance adds an alliance to queue
func (*Hammer) AddCharacter ¶
AddCharacter adds a character to queue
func (*Hammer) AddCorporation ¶
AddCorporation adds a corporation to queue
func (*Hammer) BulkLookup ¶
BulkLookup looks up ID to entities in bulk and adds them to the queue
func (*Hammer) ChangeBasePath ¶
ChangeBasePath for ESI (sisi/mock/tranquility)
func (*Hammer) ChangeTokenPath ¶
ChangeTokenPath for ESI (sisi/mock/tranquility)
func (*Hammer) GetActiveWarsByID ¶
func (s *Hammer) GetActiveWarsByID(id int64) ([]ContactEntity, error)
func (*Hammer) GetCharacterIDByName ¶
GetCharacterIDByName checks if a character exists in the database
func (*Hammer) GetFactionWarEntitiesForID ¶
func (s *Hammer) GetFactionWarEntitiesForID(factionID int32) ([]FactionWarEntities, error)
GetFactionWarEntitiesForID gets entities in faction war with this factionID
func (*Hammer) GetPendingWarsByID ¶
func (s *Hammer) GetPendingWarsByID(id int64) ([]ContactEntity, error)
func (*Hammer) GetTokenSourceContext ¶
func (s *Hammer) GetTokenSourceContext(c context.Context, characterID, tokenCharacterID int32) (context.Context, error)
GetTokenSourceContext sets a token source to a context value for authentication
func (*Hammer) QueueResult ¶
QueueResult queues a result to NSQ topic