skillz

package module
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2022 License: MIT Imports: 9 Imported by: 0

README

Welcome to the Eve Is ESI Skillboard Repository

Skillboard is a Third Party Application written for the MMORPG Eve Online. It is part of the Eve Is ESI Brand and operates on one of it's subdomains. Skillboard.Evie is a Golang Application. This repository contians the code for Skillboard Evie API as well as the processors and crons. This application runs entirely inside of Docker with the exception of some minor setup that makes use of the main binary (there are plans to move this to a docker container that'll be controlled by a combination of environment variables and redis queries)

Setup

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllSort = []Sort{
	SortAsc,
	SortDesc,
}
View Source
var StatusMap = map[AuthAttemptStatus]string{
	CreateAuthStatus:    "create",
	PendingAuthStatus:   "pending",
	InvalidAuthStatus:   "invalid",
	ExpiredAuthStatus:   "expired",
	CompletedAuthStatus: "completed",
}

Functions

This section is empty.

Types

type Alliance

type Alliance struct {
	ID                    uint      `db:"id" json:"id"`
	Name                  string    `db:"name" json:"name"`
	Ticker                string    `db:"ticker" json:"ticker"`
	DateFounded           time.Time `db:"date_founded" json:"date_founded"`
	CreatorID             uint      `db:"creator_id" json:"creator_id"`
	CreatorCorporationID  uint      `db:"creator_corporation_id" json:"creator_corporation_id"`
	ExecutorCorporationID uint      `db:"executor_corporation_id" json:"executor_corporation_id"`
	FactionID             null.Uint `db:"faction_id,omitempty" json:"faction_id,omitempty"`
	IsClosed              bool      `db:"is_closed" json:"is_closed"`
	CreatedAt             time.Time `db:"created_at" json:"-"`
	UpdatedAt             time.Time `db:"updated_at" json:"-"`
}

Alliance is an object representing the database table.

type AllianceRepository

type AllianceRepository interface {
	Alliance(ctx context.Context, id uint) (*Alliance, error)
	CreateAlliance(ctx context.Context, alliance *Alliance) error
	UpdateAlliance(ctx context.Context, alliance *Alliance) error
}

type AuthAttempt

type AuthAttempt struct {
	Status AuthAttemptStatus
	State  string
	Token  null.String `json:",omitempty"`
}

type AuthAttemptStatus

type AuthAttemptStatus uint
const (
	CreateAuthStatus AuthAttemptStatus = iota
	PendingAuthStatus
	InvalidAuthStatus
	ExpiredAuthStatus
	CompletedAuthStatus
)

type Bloodline

type Bloodline struct {
	ID            uint      `db:"id" json:"bloodline_id"`
	Name          string    `db:"name" json:"name"`
	RaceID        uint      `db:"race_id" json:"race_id"`
	CorporationID uint      `db:"corporation_id" json:"corporation_id"`
	ShipTypeID    uint      `db:"ship_type_id" json:"ship_type_id"`
	Charisma      uint      `db:"charisma" json:"charisma"`
	Intelligence  uint      `db:"intelligence" json:"intelligence"`
	Memory        uint      `db:"memory" json:"memory"`
	Perception    uint      `db:"perception" json:"perception"`
	Willpower     uint      `db:"willpower" json:"willpower"`
	CreatedAt     time.Time `db:"created_at" json:"-"`
	UpdatedAt     time.Time `db:"updated_at" json:"-"`
}

type Category

type Category struct {
	ID        uint      `db:"id" json:"id"`
	Name      string    `db:"name" json:"name"`
	Published bool      `db:"published" json:"published"`
	Groups    []uint    `db:"-" json:"groups,omitempty"`
	CreatedAt time.Time `db:"created_at" json:"-"`
	UpdatedAt time.Time `db:"updated_at" json:"-"`
}

type Character

type Character struct {
	ID             uint64       `db:"id" json:"id"`
	Name           string       `db:"name" json:"name"`
	CorporationID  uint         `db:"corporation_id" json:"corporation_id"`
	AllianceID     null.Uint    `db:"alliance_id,omitempty" json:"alliance_id,omitempty"`
	FactionID      null.Uint    `db:"faction_id,omitempty" json:"faction_id,omitempty"`
	SecurityStatus null.Float64 `db:"security_status,omitempty" json:"security_status,omitempty"`
	Gender         string       `db:"gender" json:"gender"`
	Birthday       time.Time    `db:"birthday" json:"birthday"`
	Title          null.String  `db:"title,omitempty" json:"title,omitempty"`
	BloodlineID    uint         `db:"bloodline_id" json:"bloodline_id"`
	RaceID         uint         `db:"race_id" json:"race_id"`
	CreatedAt      time.Time    `db:"created_at" json:"-"`
	UpdatedAt      time.Time    `db:"updated_at" json:"-"`

	Corporation *Corporation `json:"corporation,omitempty"`
	Alliance    *Alliance    `json:"alliance,omitempty"`
}

type CharacterAttributes

type CharacterAttributes struct {
	CharacterID              uint64    `db:"character_id" json:"character_id"`
	Charisma                 uint      `db:"charisma" json:"charisma"`
	Intelligence             uint      `db:"intelligence" json:"intelligence"`
	Memory                   uint      `db:"memory" json:"memory"`
	Perception               uint      `db:"perception" json:"perception"`
	Willpower                uint      `db:"willpower" json:"willpower"`
	BonusRemaps              null.Uint `db:"bonus_remaps,omitempty" json:"bonus_remaps,omitempty"`
	LastRemapDate            null.Time `db:"last_remap_date,omitempty" json:"last_remap_date,omitempty"`
	AccruedRemapCooldownDate null.Time `db:"accrued_remap_cooldown_date,omitempty" json:"accrued_remap_cooldown_date,omitempty"`
	CreatedAt                time.Time `db:"created_at" json:"-" deep:"-"`
	UpdatedAt                time.Time `db:"updated_at" json:"-" deep:"-"`
}

type CharacterCloneMeta

type CharacterCloneMeta struct {
	CharacterID           uint64    `db:"character_id" json:"character_id"`
	LastCloneJumpDate     null.Time `db:"last_clone_jump_date" json:"last_clone_jump_date"`
	LastStationChangeDate null.Time `db:"last_station_change_date" json:"last_station_change_date"`
	CreatedAt             time.Time `db:"created_at" json:"-"`
	UpdatedAt             time.Time `db:"updated_at" json:"-"`

	HomeLocation *CharacterDeathClone  `json:"home_location"`
	JumpClones   []*CharacterJumpClone `json:"jump_clones"`
}

type CharacterContact

type CharacterContact struct {
	CharacterID uint64      `db:"character_id" json:"character_id"`
	ContactID   uint        `db:"contact_id" json:"contact_id"`
	ContactType ContactType `db:"contact_type" json:"contact_type"`
	Standing    float64     `db:"standing" json:"standing"`
	CreatedAt   time.Time   `db:"created_at" json:"-"`
	UpdatedAt   time.Time   `db:"updated_at" json:"-"`

	Alliance    *Alliance    `json:"alliance,omitempty"`
	Corporation *Corporation `json:"corporation,omitempty"`
	Character   *Character   `json:"character,omitempty"`
}

type CharacterCorporationHistory

type CharacterCorporationHistory struct {
	CharacterID   uint64    `db:"character_id" json:"character_id"`
	RecordID      uint64    `db:"record_id" json:"record_id"`
	CorporationID uint      `db:"corporation_id" json:"corporation_id"`
	IsDeleted     bool      `db:"is_deleted" json:"is_deleted"`
	StartDate     time.Time `db:"start_date" json:"start_date"`
	CreatedAt     time.Time `db:"created_at" json:"-"`
	UpdatedAt     time.Time `db:"updated_at" json:"-"`
}

type CharacterDeathClone

type CharacterDeathClone struct {
	CharacterID  uint64            `db:"character_id" json:"character_id"`
	LocationID   uint64            `db:"location_id" json:"location_id"`
	LocationType CloneLocationType `db:"location_type" json:"location_type"`
	CreatedAt    time.Time         `db:"created_at" json:"-"`
	UpdatedAt    time.Time         `db:"updated_at" json:"-"`

	Station   *Station   `json:"station,omitempty"`
	Structure *Structure `json:"structure,omitempty"`
}

type CharacterFlyableShip

type CharacterFlyableShip struct {
	CharacterID uint64    `db:"character_id" json:"character_id"`
	ShipTypeID  uint      `db:"ship_type_id" json:"ship_type_id"`
	Flyable     bool      `db:"flyable" json:"flyable"`
	CreatedAt   time.Time `db:"created_at" json:"-"`

	Ship *Type `json:"info"`
}

type CharacterImplant

type CharacterImplant struct {
	CharacterID uint64    `db:"character_id" json:"character_id"`
	ImplantID   uint      `db:"implant_id" json:"implant_id"`
	CreatedAt   time.Time `db:"created_at" json:"-"`

	Type *Type `json:"info,omitempty"`
}

type CharacterJumpClone

type CharacterJumpClone struct {
	CharacterID  uint64            `db:"character_id" json:"character_id"`
	JumpCloneID  uint              `db:"jump_clone_id" json:"jump_clone_id"`
	LocationID   uint64            `db:"location_id" json:"location_id"`
	LocationType CloneLocationType `db:"location_type" json:"location_type"`
	CreatedAt    time.Time         `db:"created_at" json:"-"`

	ImplantIDs SliceUint `db:"implant_ids" json:"-"`
	Implants   []*Type   `json:"implants,omitempty"`

	Station   *Station   `json:"station,omitempty"`
	Structure *Structure `json:"structure,omitempty"`
}

type CharacterRepository

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

type CharacterSkill

type CharacterSkill struct {
	CharacterID        uint64    `db:"character_id" json:"character_id"`
	ActiveSkillLevel   uint      `db:"active_skill_level" json:"active_skill_level"`
	SkillID            uint      `db:"skill_id" json:"skill_id"`
	SkillpointsInSkill uint      `db:"skillpoints_in_skill" json:"skillpoints_in_skill"`
	TrainedSkillLevel  uint      `db:"trained_skill_level" json:"trained_skill_level"`
	CreatedAt          time.Time `db:"created_at" json:"-"`
	UpdatedAt          time.Time `db:"updated_at" json:"-"`

	Info *Type `json:"type,omitempty"`
}

type CharacterSkillGroup

type CharacterSkillGroup struct {
	Info         *Group            `json:"info"`
	Skills       []*CharacterSkill `json:"skills"`
	TotalGroupSP uint              `json:"totalGroupSP"`
}

type CharacterSkillMeta

type CharacterSkillMeta struct {
	CharacterID   uint64    `db:"character_id" json:"character_id"`
	TotalSP       uint      `db:"total_sp" json:"total_sp"`
	UnallocatedSP *uint     `db:"unallocated_sp,omitempty" json:"unallocated_sp,omitempty"`
	CreatedAt     time.Time `db:"created_at" json:"-"`
	UpdatedAt     time.Time `db:"updated_at" json:"-"`

	Skills []*CharacterSkill `json:"skills,omitempty"`
}

type CharacterSkillQueue

type CharacterSkillQueue struct {
	CharacterID     uint64    `db:"character_id" json:"character_id" deep:"-"`
	QueuePosition   uint      `db:"queue_position" json:"queue_position"`
	SkillID         uint      `db:"skill_id" json:"skill_id"`
	FinishedLevel   uint      `db:"finished_level" json:"finished_level"`
	TrainingStartSp null.Uint `db:"training_start_sp,omitempty" json:"training_start_sp,omitempty"`
	LevelStartSp    null.Uint `db:"level_start_sp,omitempty" json:"level_start_sp,omitempty"`
	LevelEndSp      null.Uint `db:"level_end_sp,omitempty" json:"level_end_sp,omitempty"`
	StartDate       null.Time `db:"start_date,omitempty" json:"start_date,omitempty"`
	FinishDate      null.Time `db:"finish_date,omitempty" json:"finish_date,omitempty"`
	CreatedAt       time.Time `db:"created_at" json:"-" deep:"-"`

	Type *Type `json:"type"`
}

type CharacterSkillRepository

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

type CloneLocationType

type CloneLocationType string
const (
	CloneLocationTypeStation   CloneLocationType = "station"
	CloneLocationTypeStructure CloneLocationType = "structure"
)

func (CloneLocationType) String

func (c CloneLocationType) String() string

func (CloneLocationType) Valid

func (c CloneLocationType) Valid() bool

type CloneRepository

type CloneRepository interface {
	CharacterCloneMeta(ctx context.Context, characterID uint64) (*CharacterCloneMeta, error)
	CreateCharacterCloneMeta(ctx context.Context, meta *CharacterCloneMeta) error

	CharacterDeathClone(ctx context.Context, characterID uint64) (*CharacterDeathClone, error)
	CreateCharacterDeathClone(ctx context.Context, death *CharacterDeathClone) error

	CharacterJumpClones(ctx context.Context, characterID uint64) ([]*CharacterJumpClone, error)
	CreateCharacterJumpClones(ctx context.Context, clones []*CharacterJumpClone) error
	DeleteCharacterJumpClones(ctx context.Context, characterID uint64) error

	CharacterImplants(ctx context.Context, characterID uint64) ([]*CharacterImplant, error)
	CreateCharacterImplants(ctx context.Context, implants []*CharacterImplant) error
	DeleteCharacterImplants(ctx context.Context, characterID uint64) error
}

type Constellation

type Constellation struct {
	ID        uint      `db:"id" json:"id"`
	Name      string    `db:"name" json:"name"`
	RegionID  uint      `db:"region_id" json:"region_id"`
	SystemIDs []uint    `db:"-" json:"systems,omitempty"`
	CreatedAt time.Time `db:"created_at" json:"-"`
	UpdatedAt time.Time `db:"updated_at" json:"-"`
}

type ContactRepository

type ContactRepository interface {
	CharacterContacts(ctx context.Context, characterID uint64) ([]*CharacterContact, error)
	CreateCharacterContacts(ctx context.Context, contacts []*CharacterContact) error
	DeleteCharacterContacts(ctx context.Context, characterID uint64) error
}

type ContactType

type ContactType string
const (
	CharacterContactType   ContactType = "character"
	CorporationContactType ContactType = "corporation"
	AllianceContactType    ContactType = "alliance"
	FactionContactType     ContactType = "faction"
)

type Corporation

type Corporation struct {
	ID            uint        `db:"id" json:"id"`
	AllianceID    null.Uint   `db:"alliance_id,omitempty" json:"alliance_id,omitempty"`
	CeoID         uint        `db:"ceo_id" json:"ceo_id"`
	CreatorID     uint        `db:"creator_id" json:"creator_id"`
	DateFounded   null.Time   `db:"date_founded,omitempty" json:"date_founded,omitempty"`
	FactionID     null.Uint   `db:"faction_id,omitempty" json:"faction_id,omitempty"`
	HomeStationID null.Uint   `db:"home_station_id,omitempty" json:"home_station_id,omitempty"`
	MemberCount   uint        `db:"member_count" json:"member_count"`
	Name          string      `db:"name" json:"name"`
	Shares        uint64      `db:"shares,omitempty" json:"shares,omitempty"`
	TaxRate       float32     `db:"tax_rate" json:"tax_rate"`
	Ticker        string      `db:"ticker" json:"ticker"`
	URL           null.String `db:"url,omitempty" json:"url,omitempty"`
	WarEligible   bool        `db:"war_eligible" json:"war_eligible"`
	CreatedAt     time.Time   `db:"created_at" json:"-"`
	UpdatedAt     time.Time   `db:"updated_at" json:"-"`
}

type CorporationAllianceHistory

type CorporationAllianceHistory struct {
	CorporationID uint      `db:"corporation_id" json:"id"`
	RecordID      uint      `db:"record_id" json:"record_id"`
	AllianceID    null.Uint `db:"alliance_id" json:"alliance_id"`
	IsDeleteed    null.Bool `db:"is_deleted" json:"is_deleted"`
	StartDate     time.Time `db:"start_date" json:"start_date"`
	CreatedAt     time.Time `db:"created_at" json:"-"`
	UpdatedAt     time.Time `db:"updated_at" json:"-"`
}

type CorporationRepository

type CorporationRepository interface {
	Corporation(ctx context.Context, corporationID uint) (*Corporation, error)
	CreateCorporation(ctx context.Context, corporation *Corporation) error
	UpdateCorporation(ctx context.Context, corporation *Corporation) error
	CorporationAllianceHistory(ctx context.Context, corporationID uint) ([]*CorporationAllianceHistory, error)
	CreateCorporationAllianceHistory(ctx context.Context, records []*CorporationAllianceHistory) ([]*CorporationAllianceHistory, error)
}

type Environment

type Environment uint
const (
	Production Environment = iota
	Development
)

type Etag

type Etag struct {
	Path        string    `db:"path" json:"path"`
	Etag        string    `db:"etag" json:"etag"`
	CachedUntil time.Time `db:"cached_until" json:"cached_until"`
	CreatedAt   time.Time `db:"created_at" json:"-"`
	UpdatedAt   time.Time `db:"updated_at" json:"-"`
}

type EtagRepository

type EtagRepository interface {
	Etag(ctx context.Context, path string) (*Etag, error)
	// Etags(ctx context.Context, operators ...*Operator) ([]*Etag, error)
	InsertEtag(ctx context.Context, etag *Etag) error
}

type Faction

type Faction struct {
	ID                   uint      `db:"id" json:"faction_id"`
	Name                 string    `db:"name" json:"name"`
	IsUnique             bool      `db:"is_unique" json:"is_unique"`
	SizeFactor           float64   `db:"size_factor" json:"size_factor"`
	StationCount         uint      `db:"station_count" json:"station_count"`
	StationSystemCount   uint      `db:"station_system_count" json:"station_system_count"`
	CorporationID        null.Uint `db:"corporation_id,omitempty" json:"corporation_id,omitempty"`
	MilitiaCorporationID null.Uint `db:"militia_corporation_id,omitempty" json:"militia_corporation_id,omitempty"`
	SolarSystemID        null.Uint `db:"solar_system_id,omitempty" json:"solar_system_id,omitempty"`
	CreatedAt            time.Time `db:"created_at" json:"-"`
	UpdatedAt            time.Time `db:"updated_at" json:"-"`
}

func (Faction) IsContactInfo

func (Faction) IsContactInfo()

type Group

type Group struct {
	ID         uint      `db:"id" json:"id"`
	Name       string    `db:"name" json:"name"`
	Published  bool      `db:"published" json:"published"`
	CategoryID uint      `db:"category_id" json:"category_id"`
	TypeIDs    []uint    `db:"-" json:"types,omitempty"`
	CreatedAt  time.Time `db:"created_at" json:"-"`
	UpdatedAt  time.Time `db:"updated_at" json:"-"`

	Types []*Type `json:"items"`
}

type OpValue

type OpValue interface{}

type Operation

type Operation int
const (
	EqualOp Operation = iota
	NotEqualOp
	GreaterThanOp
	GreaterThanEqualToOp
	LessThanOp
	LessThanEqualToOp
	InOp
	NotInOp
	LikeOp

	LimitOp
	OrderOp
	SkipOp
	OrOp
	AndOp
	ExistsOp
)

func (Operation) IsValid

func (o Operation) IsValid() bool

type Operator

type Operator struct {
	Column    string    `json:"column"`
	Operation Operation `json:"operation"`
	Value     OpValue   `json:"value"`
}

func NewAndOperator

func NewAndOperator(value ...*Operator) *Operator

func NewEqualOperator

func NewEqualOperator(column string, value interface{}) *Operator

func NewExistsOperator

func NewExistsOperator(column string, value bool) *Operator

func NewGreaterThanEqualToOperator

func NewGreaterThanEqualToOperator(column string, value interface{}) *Operator

func NewGreaterThanOperator

func NewGreaterThanOperator(column string, value interface{}) *Operator

func NewInOperator

func NewInOperator(column string, value []interface{}) *Operator

func NewLessThanEqualToOperator

func NewLessThanEqualToOperator(column string, value interface{}) *Operator

func NewLessThanOperator

func NewLessThanOperator(column string, value interface{}) *Operator

func NewLikeOperator

func NewLikeOperator(column string, value string) *Operator

func NewLimitOperator

func NewLimitOperator(value uint64) *Operator

func NewNotEqualOperator

func NewNotEqualOperator(column string, value interface{}) *Operator

func NewNotInOperator

func NewNotInOperator(column string, value interface{}) *Operator

func NewOrOperator

func NewOrOperator(value ...*Operator) *Operator

func NewOrderOperator

func NewOrderOperator(column string, sort Sort) *Operator

func NewSkipOperator

func NewSkipOperator(value int64) *Operator

type Processor

type Processor interface {
	Process(ctx context.Context, user *User) error
	Scopes() []Scope
}

type Race

type Race struct {
	ID        uint      `db:"id" json:"race_id"`
	Name      string    `db:"name" json:"name"`
	CreatedAt time.Time `db:"created_at" json:"-"`
	UpdatedAt time.Time `db:"updated_at" json:"-"`
}

type Region

type Region struct {
	ID               uint      `db:"id" json:"id"`
	Name             string    `db:"name" json:"name"`
	ConstellationIDs []uint    `db:"-" json:"constellations,omitempty"`
	CreatedAt        time.Time `db:"created_at" json:"-"`
	UpdatedAt        time.Time `db:"updated_at" json:"-"`
}

type Scope

type Scope string
const (
	ReadContactsV1   Scope = "esi-characters.read_contacts.v1"
	ReadClonesV1     Scope = "esi-clones.read_clones.v1"
	ReadImplantsV1   Scope = "esi-clones.read_implants.v1"
	ReadLocationV1   Scope = "esi-location.read_location.v1"
	ReadOnlineV1     Scope = "esi-location.read_online.v1"
	ReadShipV1       Scope = "esi-location.read_ship_type.v1"
	ReadSkillQueueV1 Scope = "esi-skills.read_skillqueue.v1"
	ReadSkillsV1     Scope = "esi-skills.read_skills.v1"
	ReadStructuresV1 Scope = "esi-universe.read_structures.v1"
)

func (Scope) String

func (s Scope) String() string

type ScopeProcessors

type ScopeProcessors []Processor

type ScopeResolver

type ScopeResolver struct {
	Name string
	Func func(context.Context, *User) (*Etag, error)
}

type SliceUint

type SliceUint []uint64

func (SliceUint) MarshalJSON

func (s SliceUint) MarshalJSON() ([]byte, error)

func (*SliceUint) Scan

func (s *SliceUint) Scan(value interface{}) error

func (*SliceUint) UnmarshalJSON

func (s *SliceUint) UnmarshalJSON(value []byte) error

func (SliceUint) Value

func (s SliceUint) Value() (driver.Value, error)

type SolarSystem

type SolarSystem struct {
	ID              uint        `db:"id" json:"id"`
	Name            string      `db:"name" json:"name"`
	ConstellationID uint        `db:"constellation_id" json:"constellation_id"`
	SecurityStatus  float64     `db:"security_status" json:"security_status"`
	StarID          null.Uint   `db:"star_id,omitempty" json:"star_id,omitempty"`
	SecurityClass   null.String `db:"security_class,omitempty" json:"security_class,omitempty"`
	CreatedAt       time.Time   `db:"created_at" json:"-"`
	UpdatedAt       time.Time   `db:"updated_at" json:"-"`
}

type Sort

type Sort int
const (
	SortAsc  Sort = 1
	SortDesc Sort = -1
)

func (Sort) IsValid

func (e Sort) IsValid() bool

func (Sort) Value

func (e Sort) Value() int

type Station

type Station struct {
	ID                       uint      `db:"id" json:"id"`
	Name                     string    `db:"name" json:"name"`
	SystemID                 uint      `db:"system_id" json:"system_id"`
	TypeID                   uint      `db:"type_id" json:"type_id"`
	RaceID                   null.Uint `db:"race_id" json:"race_id"`
	OwnerCorporationID       null.Uint `db:"owner_corporation_id" json:"owner"`
	MaxDockableShipVolume    float64   `db:"max_dockable_ship_volume" json:"max_dockable_ship_volume"`
	OfficeRentalCost         float64   `db:"office_rental_cost" json:"office_rental_cost"`
	ReprocessingEfficiency   float64   `db:"reprocessing_efficiency" json:"reprocessing_efficiency"`
	ReprocessingStationsTake float64   `db:"reprocessing_stations_take" json:"reprocessing_stations_take"`
	CreatedAt                time.Time `db:"created_at" json:"-"`
	UpdatedAt                time.Time `db:"updated_at" json:"-"`
}

func (Station) IsLocationInfo

func (Station) IsLocationInfo()

type Structure

type Structure struct {
	ID            uint64    `db:"id" json:"id"`
	Name          string    `db:"name" json:"name"`
	OwnerID       uint      `db:"owner_id" json:"owner_id"`
	SolarSystemID uint      `db:"solar_system_id" json:"solar_system_id"`
	TypeID        null.Uint `db:"type_id" json:"type_id"`
	CreatedAt     time.Time `db:"created_at" json:"-"`
	UpdatedAt     time.Time `db:"updated_at" json:"-"`
}

func (Structure) IsLocationInfo

func (Structure) IsLocationInfo()

type Type

type Type struct {
	ID             uint         `db:"id" json:"id"`
	Name           string       `db:"name" json:"name"`
	GroupID        uint         `db:"group_id" json:"group_id"`
	Published      bool         `db:"published" json:"published"`
	Capacity       float64      `db:"capacity,omitempty" json:"capacity,omitempty"`
	MarketGroupID  null.Uint    `db:"market_group_id,omitempty" json:"market_group_id,omitempty"`
	Mass           null.Float64 `db:"mass,omitempty" json:"mass,omitempty"`
	PackagedVolume null.Float64 `db:"packaged_volume,omitempty" json:"packaged_volume,omitempty"`
	PortionSize    null.Uint    `db:"portion_size,omitempty" json:"portion_size,omitempty"`
	Radius         null.Float64 `db:"radius,omitempty" json:"radius,omitempty"`
	Volume         float64      `db:"volume,omitempty" json:"volume,omitempty"`
	CreatedAt      time.Time    `db:"created_at" json:"-"`
	UpdatedAt      time.Time    `db:"updated_at" json:"-"`

	Attributes []*TypeDogmaAttribute `json:"dogma_attributes"`
	Group      *Group                `json:"group"`
}

type TypeDogmaAttribute

type TypeDogmaAttribute struct {
	TypeID      uint      `db:"type_id" json:"type_id"`
	AttributeID uint      `db:"attribute_id" json:"attribute_id"`
	Value       float64   `db:"value" json:"value"`
	CreatedAt   time.Time `db:"created_at" json:"-"`
}

type UniverseRepository

type UniverseRepository interface {
	Bloodline(ctx context.Context, bloodlineID uint) (*Bloodline, error)
	Bloodlines(ctx context.Context) ([]*Bloodline, error)
	CreateBloodline(ctx context.Context, bloodline *Bloodline) error
	UpdateBloodline(ctx context.Context, bloodline *Bloodline) error

	Category(ctx context.Context, categoryID uint) (*Category, error)
	Categories(ctx context.Context) ([]*Category, error)
	CreateCategory(ctx context.Context, category *Category) error
	UpdateCategory(ctx context.Context, category *Category) error

	Constellation(ctx context.Context, constellationID uint) (*Constellation, error)
	Constellations(ctx context.Context) ([]*Constellation, error)
	CreateConstellation(ctx context.Context, constellation *Constellation) error
	UpdateConstellation(ctx context.Context, constellation *Constellation) error

	Faction(ctx context.Context, factionID uint) (*Faction, error)
	Factions(ctx context.Context) ([]*Faction, error)
	CreateFaction(ctx context.Context, faction *Faction) error
	UpdateFaction(ctx context.Context, faction *Faction) error

	Group(ctx context.Context, groupID uint) (*Group, error)
	Groups(ctx context.Context, operators ...*Operator) ([]*Group, error)
	CreateGroup(ctx context.Context, group *Group) error
	UpdateGroup(ctx context.Context, group *Group) error

	Race(ctx context.Context, raceID uint) (*Race, error)
	Races(ctx context.Context, operators ...*Operator) ([]*Race, error)
	CreateRace(ctx context.Context, race *Race) error
	UpdateRace(ctx context.Context, race *Race) error

	Region(ctx context.Context, regionID uint) (*Region, error)
	Regions(ctx context.Context) ([]*Region, error)
	CreateRegion(ctx context.Context, region *Region) error
	UpdateRegion(ctx context.Context, region *Region) error

	SolarSystem(ctx context.Context, solarSystemID uint) (*SolarSystem, error)
	SolarSystems(ctx context.Context, operators ...*Operator) ([]*SolarSystem, error)
	CreateSolarSystem(ctx context.Context, solarSystem *SolarSystem) error
	UpdateSolarSystem(ctx context.Context, solarSystem *SolarSystem) error

	Station(ctx context.Context, stationID uint) (*Station, error)
	Stations(ctx context.Context, operators ...*Operator) ([]*Station, error)
	CreateStation(ctx context.Context, station *Station) error
	UpdateStation(ctx context.Context, station *Station) error

	Structure(ctx context.Context, structureID uint64) (*Structure, error)
	Structures(ctx context.Context) ([]*Structure, error)
	CreateStructure(ctx context.Context, structure *Structure) error
	UpdateStructure(ctx context.Context, structure *Structure) error

	Type(ctx context.Context, typeID uint) (*Type, error)
	Types(ctx context.Context, operators ...*Operator) ([]*Type, error)
	CreateType(ctx context.Context, item *Type) error
	UpdateType(ctx context.Context, item *Type) error

	TypeDogmaAttributes(ctx context.Context, typeID uint) ([]*TypeDogmaAttribute, error)
	CreateTypeDogmaAttributes(ctx context.Context, attributes []*TypeDogmaAttribute) error
	DeleteTypeDogmaAttributes(ctx context.Context, typeID uint) error
}

type User

type User struct {
	ID                uuid.UUID   `db:"id" json:"id"`
	CharacterID       uint64      `db:"character_id,omitempty" json:"character_id"`
	AccessToken       string      `db:"access_token" json:"-"`
	RefreshToken      string      `db:"refresh_token" json:"-"`
	Expires           time.Time   `db:"expires," json:"expires"`
	OwnerHash         string      `db:"owner_hash" json:"owner_hash"`
	Scopes            UserScopes  `db:"scopes,omitempty" json:"scopes,omitempty"`
	IsNew             bool        `db:"is_new" json:"is_new"`
	Disabled          bool        `db:"disabled" json:"disabled"`
	DisabledReason    null.String `db:"disabled_reason,omitempty" json:"disabled_reason"`
	DisabledTimestamp null.Time   `db:"disabled_timestamp,omitempty" json:"disabled_timestamp"`
	LastLogin         time.Time   `db:"last_login" json:"last_login"`
	LastProcessed     null.Time   `db:"last_processed" json:"last_processed"`
	CreatedAt         time.Time   `db:"created_at" json:"-"`
	UpdatedAt         time.Time   `db:"updated_at" json:"-"`

	Character *Character `json:"character,omitempty"`
}

func (*User) ApplyToken

func (i *User) ApplyToken(t *oauth2.Token)

type UserRepository

type UserRepository interface {
	User(ctx context.Context, id uuid.UUID) (*User, error)
	UserByCharacterID(ctx context.Context, characterID uint64) (*User, error)
	SearchUsers(ctx context.Context, q string) ([]*User, error)
	CreateUser(ctx context.Context, user *User) error
	UpdateUser(ctx context.Context, user *User) error

	UsersSortedByProcessedAtLimit(ctx context.Context, limit uint64) ([]*User, error)

	NewUsersBySP(ctx context.Context) ([]*User, error)
}

type UserScopes

type UserScopes []Scope

func (*UserScopes) Scan

func (s *UserScopes) Scan(value interface{}) error

func (UserScopes) Value

func (s UserScopes) Value() (driver.Value, error)

type UserSearchResult

type UserSearchResult struct {
	*User
	Info *Character `json:"info"`
}

type UserWithSkillMeta

type UserWithSkillMeta struct {
	*User
	Meta   *CharacterSkillMeta    `json:"meta"`
	Skills []*CharacterSkill      `json:"skills"`
	Queue  []*CharacterSkillQueue `json:"skillQueue"`
	Info   *Character             `json:"info"`
}

Jump to

Keyboard shortcuts

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