package module
Version: v0.7.2 Latest Latest

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

Go to latest
Published: Jun 14, 2022 License: AGPL-3.0 Imports: 6 Imported by: 4


Watch Elite: Dangerous Journal Files

This is a Go library to watch Journal files of Elite: Dangerous. The commander's Journal is official way to hook player tools into E:D.

This root package only defines some abstractions for event processing. This gives developers the opportunity to build different processing strategies for the events coming from ED.


Using watched as a library does not need anything special. Just

import ""

in your application.

If you want to build edeh and use it right in place, you have to build the project. Want to get platform independent, instead of make try to use

$ go run mk/mk.go




View Source
const (
	StatCargoName    = "Cargo"
	StatMarketName   = "Market"
	StatModulesName  = "ModuleInfo"
	StatNavRouteName = "NavRoute"
	StatOutfitName   = "Outfitting"
	StatShipyardName = "Shipyard"
	StatStatusName   = "Status"
View Source
const (
	JESequenceMask = (1 << jeSequenceBits) - 1
View Source
const Stop = internal.StopEvent(0)


This section is empty.


func LogCfg

func LogCfg() c4hgol.Group

func Peek added in v0.6.0

func Peek(str []byte) (t time.Time, event string, err error)

func PeekEvent added in v0.6.0

func PeekEvent(str []byte) (event string, err error)

func PeekTime added in v0.6.0

func PeekTime(str []byte) (t time.Time, err error)


type BranchConfig added in v0.6.0

type BranchConfig struct {
	JournalQLen int
	StatusQLen  int

type EventRecv added in v0.6.0

type EventRecv interface {
	OnJournalEvent(e JounalEvent) error
	OnStatusEvent(e StatusEvent) error
	Close() error

type EventSrc added in v0.6.0

type EventSrc struct {
	Journal <-chan JounalEvent
	Status  <-chan StatusEvent

type JEIDCounter added in v0.6.7

type JEIDCounter struct {
	// contains filtered or unexported fields

JEIDCounter generates unique journal event IDs from the event timestamp and a sequence part that numbers all events from one second. JEIDCounter requires that not more than 2^jeSequenceBits=1024 events per second occur.

func (*JEIDCounter) Count added in v0.6.7

func (idc *JEIDCounter) Count(t time.Time) (JEventID, error)

func (*JEIDCounter) CountUnix added in v0.6.7

func (idc *JEIDCounter) CountUnix(tu int64) (JEventID, error)

func (*JEIDCounter) Last added in v0.6.7

func (idc *JEIDCounter) Last() JEventID

func (*JEIDCounter) SetLast added in v0.6.7

func (idc *JEIDCounter) SetLast(jeid JEventID)

type JEventID added in v0.6.0

type JEventID = int64
const StartNow JEventID = -1

type JounalEvent added in v0.6.0

type JounalEvent struct {
	Serial JEventID
	Event  RawEvent

type RawEvent added in v0.6.0

type RawEvent []byte

func (RawEvent) Peek added in v0.6.0

func (re RawEvent) Peek() (time.Time, string, error)

func (RawEvent) PeekEvent added in v0.6.0

func (re RawEvent) PeekEvent() (string, error)

func (RawEvent) PeekTime added in v0.6.0

func (re RawEvent) PeekTime() (time.Time, error)

type RecvToSrc added in v0.6.0

type RecvToSrc struct {
	// contains filtered or unexported fields

func (*RecvToSrc) Branch added in v0.6.0

func (rs *RecvToSrc) Branch(cfg BranchConfig) EventSrc

func (*RecvToSrc) Close added in v0.6.0

func (rs *RecvToSrc) Close() error

func (*RecvToSrc) OnJournalEvent added in v0.6.4

func (rs *RecvToSrc) OnJournalEvent(e JounalEvent) error

func (*RecvToSrc) OnStatusEvent added in v0.6.4

func (rs *RecvToSrc) OnStatusEvent(e StatusEvent) error

type StatusEvent added in v0.6.0

type StatusEvent struct {
	Type  StatusType
	Event RawEvent

type StatusType added in v0.6.0

type StatusType int
const (
	StatCargo StatusType = iota + 1

func ParseStatusType added in v0.6.0

func ParseStatusType(s string) StatusType

func (StatusType) String added in v0.6.0

func (st StatusType) String() string

Jump to

Keyboard shortcuts

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