model

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JitaRegionID = 10000002
)
View Source
const (
	JwtSecretKey = "aCf2enHaMAxKKrNKZgVaMCFn"
)

Variables

This section is empty.

Functions

func IssueToken

func IssueToken(characterID int32) (token string, err error)

IssueToken issues a JWT token for use of the API

Types

type APIClaims

type APIClaims struct {
	*jwt.StandardClaims
	CharacterID int32
}

type AccessToken

type AccessToken struct {
	Token         string
	CharacterID   int32
	CharacterName string
	// contains filtered or unexported fields
}

func (*AccessToken) ExpiresOn

func (token *AccessToken) ExpiresOn() *time.Time

func (*AccessToken) HashKey

func (token *AccessToken) HashKey() string

func (*AccessToken) ID

func (token *AccessToken) ID() int32

func (*AccessToken) SetExpire

func (token *AccessToken) SetExpire(t *time.Time)

type Asset

type Asset struct {
	IsSingleton  bool
	ItemID       int64
	LocationFlag string
	LocationID   int64
	LocationType string
	Quantity     int
	TypeID       int32
}

type Blueprint

type Blueprint struct {
	TypeID             int32 `json:"typeID" db:"typeID" yaml:"blueprintTypeID"`
	MaxProductionLimit int   `json:"maxProductionLimit" db:"maxProductionLimit" yaml:"maxProductionLimit"`
}

type CachedObject

type CachedObject interface {
	ID() int32
	HashKey() string
	ExpiresOn() *time.Time
	SetExpire(t *time.Time)
}

type Category

type Category struct {
	CategoryID   int32  `json:"categoryID" db:"categoryID"`
	CategoryName string `json:"categoryName" db:"categoryName"`
	Published    bool   `json:"published"`
	IconID       *int32 `json:"iconID" db:"iconID"`
}

type Character

type Character struct {
	CharacterID     int32            `json:"characterID"`
	CharacterName   string           `json:"name"`
	CorporationID   int32            `json:"corporationID"`
	CorporationName string           `json:"corporationName"`
	AllianceID      int32            `json:"allianceID"`
	AllianceName    string           `json:"allianceName"`
	Skills          map[string]Skill `json:"skills"` // index type needs to be string because of the flat map library
	// contains filtered or unexported fields
}

func (*Character) ExpiresOn

func (c *Character) ExpiresOn() *time.Time

func (*Character) HashKey

func (c *Character) HashKey() string

func (*Character) ID

func (c *Character) ID() int32

func (*Character) SetExpire

func (c *Character) SetExpire(t *time.Time)

func (*Character) SkillLevel

func (c *Character) SkillLevel(skillID int32) int

type Corporation

type Corporation struct {
	CorporationID   int32            `json:"corporationID"`
	CorporationName string           `json:"name"`
	AllianceID      int32            `json:"allianceID"`
	CEOID           int32            `json:"CEOID"`
	Ticker          string           `json:"ticker"`
	Members         map[string]int32 `json:"members"`
	// contains filtered or unexported fields
}

func (*Corporation) ExpiresOn

func (c *Corporation) ExpiresOn() *time.Time

func (*Corporation) HashKey

func (c *Corporation) HashKey() string

func (*Corporation) ID

func (c *Corporation) ID() int32

func (*Corporation) SetExpire

func (c *Corporation) SetExpire(t *time.Time)

type CorporationAccessToken

type CorporationAccessToken struct {
	CorporationID int32
	CharacterID   int32
	// contains filtered or unexported fields
}

CorporationAccessToken is basically just a link from a corporation ID to a character ID which then has the actual token

func (*CorporationAccessToken) ExpiresOn

func (token *CorporationAccessToken) ExpiresOn() *time.Time

func (*CorporationAccessToken) HashKey

func (token *CorporationAccessToken) HashKey() string

func (*CorporationAccessToken) ID

func (token *CorporationAccessToken) ID() int32

func (*CorporationAccessToken) SetExpire

func (token *CorporationAccessToken) SetExpire(t *time.Time)

type CorporationAssets

type CorporationAssets struct {
	CorporationID int32
	Assets        map[string]Asset
	// contains filtered or unexported fields
}

func (*CorporationAssets) ExpiresOn

func (c *CorporationAssets) ExpiresOn() *time.Time

func (*CorporationAssets) HashKey

func (c *CorporationAssets) HashKey() string

func (*CorporationAssets) ID

func (c *CorporationAssets) ID() int32

func (*CorporationAssets) SetExpire

func (c *CorporationAssets) SetExpire(t *time.Time)

type Group

type Group struct {
	GroupID    int32  `json:"groupID" db:"groupID"`
	CategoryID int32  `json:"categoryID" db:"categoryID" yaml:"categoryID"`
	GroupName  string `json:"groupName" db:"groupName"`
	Published  bool   `json:"published"`
}

type IndustryActivity

type IndustryActivity struct {
	TypeID     int32              `json:"typeID" db:"typeID"`
	Time       int                `json:"time"`
	ActivityID IndustryActivityID `json:"activityID" db:"activityID"`
}

type IndustryActivityID added in v0.3.0

type IndustryActivityID int32

type IndustryJob

type IndustryJob struct {
	JobID                int32      `json:"jobID" db:"jobID"`
	ActivityID           int32      `json:"activityID" db:"activityID"`
	CompletedCharacterID int32      `json:"completedCharacterID" db:"completedCharacterID"`
	CompletedDate        *time.Time `json:"completedDate" db:"completedDate"`
	Cost                 float64    `json:"cost" db:"cost"`
	Duration             int32      `json:"duration" db:"duration"`
	EndDate              time.Time  `json:"endDate" db:"endDate"`
	FacilityID           int64      `json:"facilityID" db:"facilityID"`
	InstallerID          int32      `json:"installerID" db:"installerID"`
	LocationID           int64      `json:"locationID" db:"locationID"`
	BlueprintID          int64      `json:"blueprintID" db:"blueprintID"`
	BlueprintTypeID      int32      `json:"blueprintTypeID" db:"blueprintTypeID"`
	StartDate            time.Time  `json:"startDate" db:"startDate"`
	PauseDate            *time.Time `json:"pauseDate" db:"pauseDate"`
	LicensedRuns         int32      `json:"licensedRuns" db:"licensedRuns"`
	OutputLocationID     int64      `json:"outputLocationID" db:"outputLocationID"`
	Probability          float32    `json:"probability" db:"probability"`
	ProductTypeID        int32      `json:"productTypeID" db:"productTypeID"`
	Runs                 int32      `json:"runs" db:"runs"`
	SuccesfulRuns        int32      `json:"succesfulRuns" db:"succesfulRuns"`
	Status               string     `json:"status" db:"status"`
}

type IndustryJobWithTypeNames added in v0.4.0

type IndustryJobWithTypeNames struct {
	*IndustryJob
	BlueprintTypeName string `json:"blueprintTypeName" db:"blueprintTypeName"`
	ProductTypeName   string `json:"productTypeName" db:"productTypeName"`
}

type IndustryJobs

type IndustryJobs struct {
	CorporationID int32                       `json:"corporationID"`
	Jobs          []*IndustryJobWithTypeNames `json:"jobs"`
}

type Invention

type Invention struct {
	BlueprintType               *Type                            `json:"blueprintType" bson:"blueprintType"`
	CostsPerInvention           int                              `json:"costsPerInvention" bson:"costsPerInvention"`
	DecryptorTypeID             int32                            `json:"decryptorTypeID" bson:"decryptorTypeID"`
	Materials                   map[string]ManufacturingMaterial `json:"materials"`
	RequiredSkills              map[string]ManufacturingSkill    `json:"requiredSkills" bson:"requiredSkills"`
	SuccessProbabilityModifiers map[string]float64               `json:"successProbabilityModifiers" bson:"successProbabilityModifiers"`
	CostsPerRun                 float64                          `json:"costsPerRun" bson:"costsPerRun"`
	InventionChance             float64                          `json:"inventionChance" bson:"inventionChance"`
	TriesForManufacturing       float64                          `json:"triesForManufacturing" bson:"triesForManufacturing"`
	CostsForManufacturing       float64                          `json:"costsForManufacturing" bson:"costsForManufacturing"`
}

type JournalEntry

type JournalEntry struct {
	Amount        float64
	Balance       float64
	Date          time.Time
	Description   string
	FirstPartyID  int32  `json:"firstPartyID" db:"firstPartyID"`
	ID            int64  `json:"id" db:"id"`
	RefType       string `json:"refType" db:"refType"`
	SecondPartyID int32  `json:"secondPartyID" db:"secondPartyID"`
	CorporationID int32  `json:"corporationID" db:"corporationID"`
	Division      int32  `json:"division" db:"division"`
}

type LocalizedName

type LocalizedName struct {
	DE string `json:"de" db:"de"`
	EN string `json:"en" db:"en"`
	FR string `json:"fr" db:"fr"`
	JA string `json:"ja" db:"ja"`
	RU string `json:"ru" db:"ru"`
	ZH string `json:"zh" db:"zh"`
}

func (*LocalizedName) Scan

func (p *LocalizedName) Scan(src interface{}) error

func (LocalizedName) Value

func (p LocalizedName) Value() (driver.Value, error)

type Manufacturing

type Manufacturing struct {
	BlueprintType                *Type                            `json:"blueprintType" bson:"blueprintType"`
	Product                      *Type                            `json:"product"`
	ProductTypeID                int32                            `json:"productTypeID"`
	IsTech2                      bool                             `json:"isTech2" bson:"isTech2"`
	Runs                         int                              `json:"runs"`
	MaxSlots                     int                              `json:"maxSlots" bson:"maxSlots"`
	SlotsUsed                    int                              `json:"slotsUsed" bson:"slotsUsed"`
	JobDurationModifiers         map[string]float64               `json:"jobDurationModifiers" bson:"jobDurationModifiers"`
	MaterialConsumptionModifiers map[string]float64               `json:"materialConsumptionModifiers" bson:"materialConsumptionModifiers"`
	ME                           int64                            `json:"me"`
	TE                           int64                            `json:"te"`
	TimeModifier                 float64                          `json:"timeModifier" bson:"timeModifier"`
	MaterialModifier             float64                          `json:"materialModifier" bson:"materialModifier"`
	Materials                    map[string]ManufacturingMaterial `json:"materials"`
	RequiredSkills               map[string]ManufacturingSkill    `json:"requiredSkills" bson:"requiredSkills"`
	HasRequiredSkills            bool                             `json:"hasRequiredSkills" bson:"hasRequiredSkills"`
	Facility                     string                           `json:"facility"`
	Costs                        struct {
		TotalMaterials float64 `json:"totalMaterials" bson:"totalMaterials"`
		TotalJobCost   float64 `json:"totalJobCost" bson:"totalJobCost"`
		Total          float64 `json:"total"`
		PerItem        float64 `json:"perItem" bson:"perItem"`
	} `json:"costs"`
	Revenue struct {
		Total   ProfitValue `json:"total"`
		PerItem ProfitValue `json:"perItem" bson:"perItem"`
	} `json:"revenue"`
	Profit struct {
		Total   ProfitValue `json:"total"`
		PerItem ProfitValue `json:"perItem" bson:"perItem"`
		PerDay  ProfitValue `json:"perDay" bson:"perDay"`
		Margin  ProfitValue `json:"margin"`
	} `json:"profit"`
	BuyOrderVolume int        `json:"buyOrderVolume" bson:"buyOrderVolume"`
	DailyBuyFactor float64    `json:"dailyBuyFactor" bson:"dailyBuyFactor"`
	Time           int        `json:"time"`
	ItemsPerDay    float64    `json:"itemsPerDay" bson:"itemsPerDay"`
	Invention      *Invention `json:"invention"`
}

func (Manufacturing) ExpiresOn

func (m Manufacturing) ExpiresOn() *time.Time

func (Manufacturing) HashKey

func (m Manufacturing) HashKey() string

func (Manufacturing) ID

func (m Manufacturing) ID() int32

func (Manufacturing) SetExpire

func (m Manufacturing) SetExpire(t *time.Time)

type ManufacturingMaterial

type ManufacturingMaterial struct {
	// TypeID is the id of the type that is beeing manufactured
	TypeID       int32   `json:"typeID" db:"typeID"`
	Quantity     int     `json:"quantity"`
	RawQuantity  int     `json:"rawQuantity" db:"rawQuantity"`
	TypeName     string  `json:"typeName" db:"typeName"`
	PricePerUnit float64 `json:"pricePerUnit" db:"pricePerUnit"`
	Cost         float64 `json:"cost"`
}

type ManufacturingSkill

type ManufacturingSkill struct {
	TypeID        int32  `json:"typeID" db:"typeID"`
	TypeName      string `json:"typeName" db:"typeName"`
	RequiredLevel int    `json:"requiredLevel" db:"requiredLevel"`
	SkillLevel    int    `json:"skillLevel" db:"skillLevel"`
	HasLearned    bool   `json:"hasLearned" db:"hasLearned"`
}

type MarketPrice

type MarketPrice struct {
	AdjustedPrice float64 `json:"adjustedPrice"`
	AveragePrice  float64 `json:"averagePrice"`
	TypeID        int32   `json:"typeID"`
	// contains filtered or unexported fields
}

func (*MarketPrice) ExpiresOn

func (c *MarketPrice) ExpiresOn() *time.Time

func (*MarketPrice) HashKey

func (c *MarketPrice) HashKey() string

func (*MarketPrice) ID

func (c *MarketPrice) ID() int32

func (*MarketPrice) SetExpire

func (c *MarketPrice) SetExpire(t *time.Time)

type Material

type Material struct {
	TypeID   int32 `json:"typeID" db:"typeID" yaml:"typeID"`
	Quantity int   `json:"quantity"`
}

type MetaGroup

type MetaGroup struct {
	MetaGroupID  int32 "metaGroupID"
	ParentTypeID int32 "parentTypeID"
	TypeID       int32 "typeID"
}

type Price

type Price struct {
	TypeID int32
	Buy    PriceData
	Sell   PriceData
	// contains filtered or unexported fields
}

func (*Price) ExpiresOn

func (c *Price) ExpiresOn() *time.Time

func (*Price) HashKey

func (c *Price) HashKey() string

func (*Price) ID

func (c *Price) ID() int32

func (*Price) SetExpire

func (c *Price) SetExpire(t *time.Time)

type PriceData

type PriceData struct {
	WeightedAverage float64 `json:"weightedAverage,string"`
	Max             float64 `json:"max,string"`
	Min             float64 `json:"min,string"`
	StdDev          float64 `json:"stddev,string"`
	Median          float64 `json:"median,string"`
	Volume          int     `json:"volume,string"`
	OrderCount      int     `json:"orderCount,string"`
	Percentile      float64 `json:"percentile,string"`
}

type Product

type Product struct {
	Probability float32
	Quantity    int
	TypeID      int32 `json:"typeID" db:"typeID" yaml:"typeID"`
}

type ProfitValue

type ProfitValue struct {
	BasedOnBuyPrice  float64 `json:"basedOnBuyPrice" bson:"basedOnBuyPrice"`
	BasedOnSellPrice float64 `json:"basedOnSellPrice" bson:"basedOnSellPrice"`
}

type RefreshToken

type RefreshToken struct {
	Token       string
	CharacterID int32
}

func (*RefreshToken) ExpiresOn

func (token *RefreshToken) ExpiresOn() *time.Time

func (*RefreshToken) HashKey

func (token *RefreshToken) HashKey() string

func (*RefreshToken) ID

func (token *RefreshToken) ID() int32

func (*RefreshToken) SetExpire

func (token *RefreshToken) SetExpire(t *time.Time)

type RequiredSkill

type RequiredSkill struct {
	TypeID int32 `json:"typeID" db:"typeID" yaml:"typeID"`
	Level  int
}

type Skill

type Skill struct {
	SkillID     int32 `json:"skillID"`
	SkillPoints int64 `json:"skillpoints"`
	Level       int32 `json:"level"`
	// contains filtered or unexported fields
}

type SystemCostIndex

type SystemCostIndex struct {
	ActivityCost  map[string]float32
	SolarSystemID int32
	// contains filtered or unexported fields
}

func (*SystemCostIndex) ExpiresOn

func (i *SystemCostIndex) ExpiresOn() *time.Time

func (*SystemCostIndex) HashKey

func (i *SystemCostIndex) HashKey() string

func (*SystemCostIndex) ID

func (i *SystemCostIndex) ID() int32

func (*SystemCostIndex) SetExpire

func (i *SystemCostIndex) SetExpire(t *time.Time)

type Transaction

type Transaction struct {
	TransactionID int64     `json:"transactionID" db:"transactionID"`
	ClientID      int32     `json:"clientID" db:"clientID"`
	Date          time.Time `json:"date" db:"date"`
	IsBuy         bool      `json:"isBuy" db:"isBuy"`
	JournalRefID  int64     `json:"journalRefID" db:"journalRefID"`
	LocationID    int64     `json:"locationID" db:"locationID"`
	Quantity      int
	TypeID        TypeIdentifier `json:"typeID" db:"typeID"`
	UnitPrice     float64        `json:"unitPrice" db:"unitPrice"`
	CorporationID int32          `json:"corporationID" db:"corporationID"`
	Division      int32          `json:"division" db:"division"`
}

type Type

type Type struct {
	TypeID        int32    `json:"typeID" db:"typeID"`
	BasePrice     *float32 `json:"basePrice" db:"basePrice" yaml:"basePrice"`
	Description   string   `json:"description,omitempty" db:"description,omitempty"`
	GroupID       int32    `json:"groupID" db:"groupID" yaml:"groupID"`
	MarketGroupID *int32   `json:"marketGroupID" db:"marketGroupID" yaml:"marketGroupID"`
	Group                  // not part of SDE, but joined from postgres
	TypeName      string   `json:"typeName" db:"typeName"`
	Mass          float64  `db:"mass"`
	Capacity      float64
	IconID        *int32  `json:"iconID" db:"iconID"`
	SoundID       *int32  `json:"soundID" db:"soundID"`
	GraphicID     int32   `json:"graphicID" db:"graphicID"`
	MetaGroupID   *int32  `json:"metaGroupID" db:"metaGroupID" yaml:"metaGroupID"`
	PortionSize   int     `json:"portionSize" db:"portionSize" yaml:"portionSize"`
	Published     bool    `json:"published"`
	RaceID        *int32  `json:"raceID" db:"raceID" yaml:"raceID"`
	Volume        float64 `json:"volume"`
}

func (Type) ExpiresOn

func (t Type) ExpiresOn() *time.Time

func (Type) HashKey

func (t Type) HashKey() string

func (Type) ID

func (t Type) ID() int32

func (Type) IsTechII added in v0.3.0

func (t Type) IsTechII() bool

func (Type) SetExpire

func (t Type) SetExpire(time *time.Time)

type TypeIdentifier

type TypeIdentifier int32

type Wallet added in v0.4.0

type Wallet struct {
	Division int32   `json:"division"`
	Balance  float64 `json:"balance"`
}

type Wallets added in v0.4.0

type Wallets struct {
	CorporationID int32             `json:"corporationID"`
	Divisions     map[string]Wallet `json:"divisions"`
	// contains filtered or unexported fields
}

func (*Wallets) ExpiresOn added in v0.4.0

func (w *Wallets) ExpiresOn() *time.Time

func (*Wallets) HashKey added in v0.4.0

func (w *Wallets) HashKey() string

func (*Wallets) ID added in v0.4.0

func (w *Wallets) ID() int32

func (*Wallets) SetExpire added in v0.4.0

func (w *Wallets) SetExpire(t *time.Time)

Jump to

Keyboard shortcuts

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