edsm

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearCache

func ClearCache()

ClearCache will clear the module cache

func GetSystemBodies

func GetSystemBodies(id64 int64) <-chan SystemResult

GetSystemBodies retrieves body information from EDSM.net

func GetSystemValue

func GetSystemValue(id64 int64) <-chan SystemResult

GetSystemValue returns information about the system value

Types

type Body

type Body struct {
	ID64   uint64
	BodyID int64

	Name        string
	IsMainStar  bool
	IsScoopable bool
	Type        string
	SubType     string

	Gravity float64

	Volcanism  string
	IsLandable bool

	Materials map[string]float64
}

Body parses information about a single body

func (Body) MaterialsSorted

func (b Body) MaterialsSorted() []Material

MaterialsSorted returns the materials of this body in descending sorted order

func (Body) ShortName

func (b Body) ShortName(s System) string

ShortName returns the shortened name of the body, without the system name prefix

type Material

type Material struct {
	Name       string
	Percentage float64
}

Material presents a single material and it's presence as a percentage

type System

type System struct {
	ID64      uint64
	Name      string
	BodyCount int

	EstimatedValue       int64
	EstimatedValueMapped int64

	Bodies         []Body
	ValuableBodies []ValuableBody
}

System parses the root object response from the api-system-v1 apis

func (System) BodyByID

func (s System) BodyByID(bodyID int64) Body

BodyByID retrieves a body from the system by it's BodyID

func (System) MainStar

func (s System) MainStar() Body

MainStar returns the main star in the system

type SystemResult

type SystemResult struct {
	S     System
	Error error
}

SystemResult bundles the result of fetching system information with the optional error

type ValuableBody

type ValuableBody struct {
	BodyName string
	ValueMax int64
}

ValuableBody holds information about the value of bodies

func (ValuableBody) ShortName

func (b ValuableBody) ShortName(s System) string

ShortName returns the shortened name of the body, without the system name prefix

Jump to

Keyboard shortcuts

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