eddnc

package module
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 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 (
	TheRelay    = "tcp://eddn.edcd.io:9500"
	ConnTimeout = 6 * time.Second
	RecvTimeout = 2 * time.Second
	NoTimout    = time.Duration(-1)
)
View Source
const ScmNo = 18

Variables

View Source
var ScmInfos = []ScmInfo{
	{allScms[0:49], allScms[0:48], 1},
	{allScms[49:91], allScms[49:90], 1},
	{allScms[91:132], allScms[91:131], 1},
	{allScms[132:172], allScms[132:171], 3},
	{allScms[172:216], allScms[172:215], 1},
	{allScms[216:261], allScms[216:260], 1},
	{allScms[261:308], allScms[261:307], 1},
	{allScms[308:358], allScms[308:357], 1},
	{allScms[358:406], allScms[358:405], 1},
	{allScms[406:451], allScms[406:450], 1},
	{allScms[451:498], allScms[451:497], 1},
	{allScms[498:548], allScms[498:547], 1},
	{allScms[548:586], allScms[548:585], 1},
	{allScms[586:630], allScms[586:629], 1},
	{allScms[630:669], allScms[630:668], 1},
	{allScms[669:710], allScms[669:709], 2},
	{allScms[710:755], allScms[710:754], 1},
	{allScms[755:794], allScms[755:793], 2},
}
View Source
var ScmMap = map[string]ScmID{
	allScms[0:49]:    Sapproachsettlement,
	allScms[49:91]:   Sblackmarket,
	allScms[91:132]:  Scodexentry,
	allScms[132:172]: Scommodity,
	allScms[172:216]: Sdockingdenied,
	allScms[216:261]: Sdockinggranted,
	allScms[261:308]: Sfcmaterials_capi,
	allScms[308:358]: Sfcmaterials_journal,
	allScms[358:406]: Sfssallbodiesfound,
	allScms[406:451]: Sfssbodysignals,
	allScms[451:498]: Sfssdiscoveryscan,
	allScms[498:548]: Sfsssignaldiscovered,
	allScms[548:586]: Sjournal,
	allScms[586:630]: Snavbeaconscan,
	allScms[630:669]: Snavroute,
	allScms[669:710]: Soutfitting,
	allScms[710:755]: Sscanbarycentre,
	allScms[755:794]: Sshipyard,
}

Functions

func Decode added in v0.6.0

func Decode(zmqmsg []byte, limit int64, into []byte) ([]byte, error)

func Message

func Message(event []byte) []byte

func MessageEnd added in v0.6.0

func MessageEnd(event []byte) int

func MessageStart added in v0.6.0

func MessageStart(event []byte) int

func NqDrop added in v0.6.0

func NqDrop(q chan<- []byte, b []byte)

func Schema added in v0.6.0

func Schema(raw []byte) []byte

func SchemaString added in v0.6.0

func SchemaString(event []byte) string

Types

type Event

type Event struct {
	SchemaRef string `json:"$schemaRef"`
	ID        string `json:"$id"`
	Header    struct {
		UploaderID      string `json:"uploaderID"`
		SoftwareName    string `json:"softwareName"`
		SoftwareVersion string `json:"softwareVersion"`
	}
}

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) Info added in v0.6.0

func (sid ScmID) Info() ScmInfo

func (ScmID) String

func (i ScmID) String() string

type ScmInfo added in v0.6.0

type ScmInfo struct {
	Ref     string
	Topic   string
	Version int
}

type Subscriber added in v0.6.0

type Subscriber struct {
	Relay       string
	ConnTimeout time.Duration
	RecvTimeout time.Duration
	Nq          func(chan<- []byte, []byte)
	LogInfo     func(format string, args ...any)
	LogError    func(format string, args ...any)
	// contains filtered or unexported fields
}

One-time-use; create a new after Stop()

func (*Subscriber) LastRecv added in v0.6.0

func (zc *Subscriber) LastRecv() time.Time

func (*Subscriber) Run added in v0.6.0

func (zc *Subscriber) Run(q chan<- []byte) (err error)

func (*Subscriber) Stop added in v0.6.0

func (zc *Subscriber) Stop()

Directories

Path Synopsis
doc
examples

Jump to

Keyboard shortcuts

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