eddnc

package module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MIT Imports: 11 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 = 32
)
View Source
const ScmNo = 18

Variables

View Source
var ScmDefs = []string{
	approachsettlementSchema,
	blackmarketSchema,
	codexentrySchema,
	commoditySchema,
	dockingdeniedSchema,
	dockinggrantedSchema,
	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/dockingdenied/1":       Sdockingdenied,
	"https://eddn.edcd.io/schemas/dockinggranted/1":      Sdockinggranted,
	"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/dockingdenied/1",
	"https://eddn.edcd.io/schemas/dockinggranted/1",
	"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

func SetLog added in v0.3.2

func SetLog(logger *slog.Logger)

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
	Sdockingdenied       ScmID = 4
	Sdockinggranted      ScmID = 5
	Sfcmaterials_capi    ScmID = 6
	Sfcmaterials_journal ScmID = 7
	Sfssallbodiesfound   ScmID = 8
	Sfssbodysignals      ScmID = 9
	Sfssdiscoveryscan    ScmID = 10
	Sfsssignaldiscovered ScmID = 11
	Sjournal             ScmID = 12
	Snavbeaconscan       ScmID = 13
	Snavroute            ScmID = 14
	Soutfitting          ScmID = 15
	Sscanbarycentre      ScmID = 16
	Sshipyard            ScmID = 17
)

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