eddnc

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2022 License: MIT Imports: 12 Imported by: 0

README

eddnc – Go EDDN Connector

Go package to connect to EDDN

Downstream – Receiving data from EDDN

Still works quite nice (for me). See example/dump.

Upstream – Sending data to EDDN

Code is somewhat bit-rotten.

Documentation

Overview

generated with go run gen/main.go

Index

Constants

View Source
const (
	Major   = 0
	Minor   = 6
	Patch   = 0
	Quality = `a`
	BuildNo = 28
)
View Source
const ScmNo = 16

Variables

View Source
var (
	LogCfg c4hgol.LogConfig = log
)
View Source
var ScmDefs = []string{
	approachsettlementSchema,
	blackmarketSchema,
	codexentrySchema,
	commoditySchema,
	fcmaterials_capiSchema,
	fcmaterials_journalSchema,
	fssallbodiesfoundSchema,
	fssbodysignalsSchema,
	fssdiscoveryscanSchema,
	fsssignaldiscoveredSchema,
	journalSchema,
	navbeaconscanSchema,
	navrouteSchema,
	outfittingSchema,
	scanbarycentreSchema,
	shipyardSchema,
}
View Source
var ScmMap = map[string]ScmID{
	"https://eddn.edcd.io/schemas/approachsettlement/1":  Sapproachsettlement,
	"https://eddn.edcd.io/schemas/blackmarket/1":         Sblackmarket,
	"https://eddn.edcd.io/schemas/codexentry/1":          Scodexentry,
	"https://eddn.edcd.io/schemas/commodity/3":           Scommodity,
	"https://eddn.edcd.io/schemas/fcmaterials_capi/1":    Sfcmaterials_capi,
	"https://eddn.edcd.io/schemas/fcmaterials_journal/1": Sfcmaterials_journal,
	"https://eddn.edcd.io/schemas/fssallbodiesfound/1":   Sfssallbodiesfound,
	"https://eddn.edcd.io/schemas/fssbodysignals/1":      Sfssbodysignals,
	"https://eddn.edcd.io/schemas/fssdiscoveryscan/1":    Sfssdiscoveryscan,
	"https://eddn.edcd.io/schemas/fsssignaldiscovered/1": Sfsssignaldiscovered,
	"https://eddn.edcd.io/schemas/journal/1":             Sjournal,
	"https://eddn.edcd.io/schemas/navbeaconscan/1":       Snavbeaconscan,
	"https://eddn.edcd.io/schemas/navroute/1":            Snavroute,
	"https://eddn.edcd.io/schemas/outfitting/2":          Soutfitting,
	"https://eddn.edcd.io/schemas/scanbarycentre/1":      Sscanbarycentre,
	"https://eddn.edcd.io/schemas/shipyard/2":            Sshipyard,
}
View Source
var ScmURLs = []string{
	"https://eddn.edcd.io/schemas/approachsettlement/1",
	"https://eddn.edcd.io/schemas/blackmarket/1",
	"https://eddn.edcd.io/schemas/codexentry/1",
	"https://eddn.edcd.io/schemas/commodity/3",
	"https://eddn.edcd.io/schemas/fcmaterials_capi/1",
	"https://eddn.edcd.io/schemas/fcmaterials_journal/1",
	"https://eddn.edcd.io/schemas/fssallbodiesfound/1",
	"https://eddn.edcd.io/schemas/fssbodysignals/1",
	"https://eddn.edcd.io/schemas/fssdiscoveryscan/1",
	"https://eddn.edcd.io/schemas/fsssignaldiscovered/1",
	"https://eddn.edcd.io/schemas/journal/1",
	"https://eddn.edcd.io/schemas/navbeaconscan/1",
	"https://eddn.edcd.io/schemas/navroute/1",
	"https://eddn.edcd.io/schemas/outfitting/2",
	"https://eddn.edcd.io/schemas/scanbarycentre/1",
	"https://eddn.edcd.io/schemas/shipyard/2",
}

Functions

This section is empty.

Types

type CodexMsg

type CodexMsg struct {
	EntryID       int64
	SystemAddress int64
	StarPos       [3]float32
	Region        int16
	Name          string
	Category      string
	SubCategory   string
	BodyID        int16
	BodyName      string
	Latitude      float32
	Longitude     float32
	// contains filtered or unexported fields
}

func (*CodexMsg) SystemName

func (m *CodexMsg) SystemName() string

func (*CodexMsg) Timestamp

func (m *CodexMsg) Timestamp() time.Time

func (*CodexMsg) Wrap

func (cdx *CodexMsg) Wrap(msg ggja.Obj) error

type Commodity

type Commodity struct {
	Name          string
	MeanPrice     int
	BuyPrice      int
	Stock         int
	StockBracket  int
	SellPrice     int
	Demand        int
	DemandBracket int
	StatusFlags   []string
}

type CommodityMsg

type CommodityMsg struct {
	MarketID    int64
	Commodities []*Commodity
	// contains filtered or unexported fields
}

func (*CommodityMsg) Wrap

func (cm *CommodityMsg) Wrap(msg ggja.Obj) error

type Event

type Event struct {
	SchemaRef string
	Header    Header
	Message   Message
}

func (*Event) Parse

func (e *Event) Parse(txt []byte) error

func (*Event) Wrap

func (e *Event) Wrap(evt ggja.Obj) (err error)

type FSSDiscoScanMsg

type FSSDiscoScanMsg struct {
	SystemAddress int64
	StarPos       [3]float32
	BodyCount     int16
	NonBodyCount  int16
	// contains filtered or unexported fields
}

func (*FSSDiscoScanMsg) SystemName

func (m *FSSDiscoScanMsg) SystemName() string

func (*FSSDiscoScanMsg) Timestamp

func (m *FSSDiscoScanMsg) Timestamp() time.Time

func (*FSSDiscoScanMsg) Wrap

func (fds *FSSDiscoScanMsg) Wrap(msg ggja.Obj) error
type Header struct {
	UploaderID       string
	SoftwareName     string
	SoftwareVersion  string
	GatewayTimestamp time.Time `json:",omitempty"`
	ggja.Obj
}

func (*Header) Wrap

func (h *Header) Wrap(hdr ggja.Obj)

type JournalMsg

type JournalMsg struct {
	SystemAddr int64
	StarPos    [3]float64
	Event      string
	ggja.Obj
	// contains filtered or unexported fields
}

func (*JournalMsg) SystemName

func (m *JournalMsg) SystemName() string

func (*JournalMsg) Timestamp

func (m *JournalMsg) Timestamp() time.Time

func (*JournalMsg) Wrap

func (je *JournalMsg) Wrap(msg ggja.Obj) error

type Message

type Message interface {
	Timestamp() time.Time
	SystemName() string
}

type ScmID

type ScmID int
const (
	Sapproachsettlement  ScmID = 0
	Sblackmarket         ScmID = 1
	Scodexentry          ScmID = 2
	Scommodity           ScmID = 3
	Sfcmaterials_capi    ScmID = 4
	Sfcmaterials_journal ScmID = 5
	Sfssallbodiesfound   ScmID = 6
	Sfssbodysignals      ScmID = 7
	Sfssdiscoveryscan    ScmID = 8
	Sfsssignaldiscovered ScmID = 9
	Sjournal             ScmID = 10
	Snavbeaconscan       ScmID = 11
	Snavroute            ScmID = 12
	Soutfitting          ScmID = 13
	Sscanbarycentre      ScmID = 14
	Sshipyard            ScmID = 15
)

func (ScmID) String

func (i ScmID) String() string

Directories

Path Synopsis
doc
example

Jump to

Keyboard shortcuts

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