esi

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNilParams = errors.New("received nil for params")
View Source
var Resolvers = endpointResolvers{
	GetAlliance: resolverFuncs["allianceID"](GetAlliance),

	GetCharacter:                   resolverFuncs["characterID"](GetCharacter),
	GetCharacterCorporationHistory: resolverFuncs["characterID"](GetCharacterCorporationHistory),
	GetCharacterContacts:           resolverFuncs["characterID"](GetCharacterContacts),
	GetCharacterClones:             resolverFuncs["characterID"](GetCharacterClones),
	GetCharacterImplants:           resolverFuncs["characterID"](GetCharacterImplants),
	GetCharacterSkills:             resolverFuncs["characterID"](GetCharacterSkills),
	GetCharacterSkillQueue:         resolverFuncs["characterID"](GetCharacterSkillQueue),
	GetCharacterAttributes:         resolverFuncs["characterID"](GetCharacterAttributes),

	GetCorporation:                resolverFuncs["corporationID"](GetCorporation),
	GetCorporationAllianceHistory: resolverFuncs["corporationID"](GetCorporationAllianceHistory),

	GetRegion:        resolverFuncs["regionID"](GetRegion),
	GetConstellation: resolverFuncs["constellationID"](GetConstellation),
	GetSolarSystem:   resolverFuncs["solarSystemID"](GetSolarSystem),
	GetStation:       resolverFuncs["stationID"](GetStation),
	GetStructure:     resolverFuncs["structureID"](GetStructure),

	GetCategory: resolverFuncs["categoryID"](GetCategory),
	GetGroup:    resolverFuncs["groupID"](GetGroup),
	GetType:     resolverFuncs["typeID"](GetType),
}

Functions

This section is empty.

Types

type API

type API interface {
	// contains filtered or unexported methods
}

type AllianceAPI

type AllianceAPI interface {
	// contains filtered or unexported methods
}

type CharacterAPI

type CharacterAPI interface {
	// contains filtered or unexported methods
}

type CloneAPI

type CloneAPI interface {
	// contains filtered or unexported methods
}

type ContactAPI

type ContactAPI interface {
	// contains filtered or unexported methods
}

type CorporationAPI

type CorporationAPI interface {
	// contains filtered or unexported methods
}

type EndpointID

type EndpointID uint
const (
	GetAlliance EndpointID = iota
	GetCharacter
	GetCharacterCorporationHistory
	GetCharacterAttributes
	GetCharacterAssets
	GetCharacterSkills
	GetCharacterSkillQueue
	GetCharacterClones
	GetCharacterImplants
	GetCharacterContacts
	GetCharacterContactLabels
	GetCharacterContracts
	GetCharacterContractItems
	GetCharacterContractBids
	GetCharacterFittings
	GetCharacterLocation
	GetCharacterMailHeaders
	GetCharacterMailHeader
	GetCharacterMailLabels
	GetCharacterMailLists
	GetCharacterOnline
	GetCharacterShip
	GetCharacterWalletBalance
	GetCharacterWalletTransactions
	GetCharacterWalletJournal
	GetCorporation
	GetCorporationAllianceHistory
	GetAncestries
	GetAsteroidBelt
	GetBloodlines
	GetCategories
	GetCategory
	GetConstellation
	GetConstellations
	GetFactions
	GetGroups
	GetGroup
	GetMoon
	GetPlanet
	GetRaces
	GetRegions
	GetRegion
	GetSolarSystem
	GetStation
	GetStructure
	GetType
	PostUniverseNames
)

type ErrInvalidParameter

type ErrInvalidParameter struct {
	Parameter string
}

func (ErrInvalidParameter) Error

func (e ErrInvalidParameter) Error() string

type ModifierFunc

type ModifierFunc func(req *http.Request, res *http.Response) error

type Params

type Params struct {
	AllianceID      null.Uint
	CategoryID      null.Uint
	CharacterID     null.Uint64
	ConstellationID null.Uint
	ContractID      null.Uint
	CorporationID   null.Uint
	From            null.Uint64
	GroupID         null.Uint
	MailID          null.Uint
	ItemID          null.Uint
	LastMailID      null.Uint64
	Page            null.Uint
	RegionID        null.Uint
	StationID       null.Uint
	SolarSystemID   null.Uint
	StructureID     null.Uint64
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(client *http.Client, redis *redis.Client, logger *logrus.Logger, etag etag.API) *Service

func (*Service) AddAuthorizationHeader

func (s *Service) AddAuthorizationHeader(ctx context.Context, token string) ModifierFunc

func (*Service) AddIfNoneMatchHeader

func (s *Service) AddIfNoneMatchHeader(ctx context.Context, etag string) ModifierFunc

func (*Service) BaseCharacterModifiers

func (s *Service) BaseCharacterModifiers(ctx context.Context, user *skillz.User, etagID string, etag *skillz.Etag) []ModifierFunc

func (*Service) CacheEtag

func (s *Service) CacheEtag(ctx context.Context, hash string, expiration *time.Time) ModifierFunc

func (*Service) Etag

func (s *Service) Etag(ctx context.Context, endpointID EndpointID, params *Params) (string, *skillz.Etag, error)

func (*Service) GetAlliance

func (s *Service) GetAlliance(ctx context.Context, allianceID uint, mods ...ModifierFunc) (*skillz.Alliance, error)

func (*Service) GetBloodlines

func (s *Service) GetBloodlines(ctx context.Context, mods ...ModifierFunc) ([]*skillz.Bloodline, error)

func (*Service) GetCategories

func (s *Service) GetCategories(ctx context.Context, mods ...ModifierFunc) ([]uint, error)

func (*Service) GetCategory

func (s *Service) GetCategory(ctx context.Context, categoryID uint, mods ...ModifierFunc) (*skillz.Category, error)

func (*Service) GetCharacter

func (s *Service) GetCharacter(ctx context.Context, characterID uint64, mods ...ModifierFunc) (*skillz.Character, error)

func (*Service) GetCharacterAttributes

func (s *Service) GetCharacterAttributes(ctx context.Context, characterID uint64, mods ...ModifierFunc) (*skillz.CharacterAttributes, error)

func (*Service) GetCharacterContacts

func (s *Service) GetCharacterContacts(ctx context.Context, characterID uint64, mods ...ModifierFunc) ([]*skillz.CharacterContact, error)

func (*Service) GetCharacterHistory

func (s *Service) GetCharacterHistory(ctx context.Context, characterID uint64, mods ...ModifierFunc) ([]*skillz.CharacterCorporationHistory, error)

func (*Service) GetCharacterImplants

func (s *Service) GetCharacterImplants(ctx context.Context, characterID uint64, mods ...ModifierFunc) ([]*skillz.CharacterImplant, error)

func (*Service) GetCharacterSkillQueue

func (s *Service) GetCharacterSkillQueue(ctx context.Context, characterID uint64, mods ...ModifierFunc) ([]*skillz.CharacterSkillQueue, error)

func (*Service) GetCharacterSkills

func (s *Service) GetCharacterSkills(ctx context.Context, characterID uint64, mods ...ModifierFunc) (*skillz.CharacterSkillMeta, error)

func (*Service) GetConstellation

func (s *Service) GetConstellation(ctx context.Context, constellationID uint, mods ...ModifierFunc) (*skillz.Constellation, error)

func (*Service) GetConstellations

func (s *Service) GetConstellations(ctx context.Context, mods ...ModifierFunc) ([]uint, error)

func (*Service) GetCorporation

func (s *Service) GetCorporation(ctx context.Context, corporationID uint, mods ...ModifierFunc) (*skillz.Corporation, error)

func (*Service) GetCorporationAllianceHistory

func (s *Service) GetCorporationAllianceHistory(ctx context.Context, corporationID uint, mods ...ModifierFunc) ([]*skillz.CorporationAllianceHistory, error)

func (*Service) GetGroup

func (s *Service) GetGroup(ctx context.Context, groupID uint, mods ...ModifierFunc) (*skillz.Group, error)

func (*Service) GetGroups

func (s *Service) GetGroups(ctx context.Context, mods ...ModifierFunc) ([]uint, error)

func (*Service) GetRaces

func (s *Service) GetRaces(ctx context.Context, mods ...ModifierFunc) ([]*skillz.Race, error)

func (*Service) GetRegion

func (s *Service) GetRegion(ctx context.Context, regionID uint, mods ...ModifierFunc) (*skillz.Region, error)

func (*Service) GetRegions

func (s *Service) GetRegions(ctx context.Context, mods ...ModifierFunc) ([]uint, error)

func (*Service) GetSolarSystem

func (s *Service) GetSolarSystem(ctx context.Context, solarSystemID uint, mods ...ModifierFunc) (*skillz.SolarSystem, error)

func (*Service) GetStation

func (s *Service) GetStation(ctx context.Context, stationID uint, mods ...ModifierFunc) (*skillz.Station, error)

func (*Service) GetStructure

func (s *Service) GetStructure(ctx context.Context, structureID uint64, mods ...ModifierFunc) (*skillz.Structure, error)

func (*Service) GetType

func (s *Service) GetType(ctx context.Context, typeID uint, mods ...ModifierFunc) (*skillz.Type, error)

type SkillAPI

type SkillAPI interface {
	// contains filtered or unexported methods
}

type UniverseAPI

type UniverseAPI interface {
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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