eden

package module
v0.0.0-...-92a3ac0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2021 License: MIT Imports: 6 Imported by: 0

README

go-eden

Elite Dangerous Event Notifications

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterEventParser

func RegisterEventParser(name string, p EventParser)

Types

type Destination

type Destination struct {
	System int64  `json:"system"`
	Body   int64  `json:"body"`
	Name   string `json:"name"`
}

func (*Destination) String

func (d *Destination) String() string

type ErrAncientJournal

type ErrAncientJournal struct {
	Err error
}

func (ErrAncientJournal) Error

func (e ErrAncientJournal) Error() string

type ErrUnknownEvent

type ErrUnknownEvent struct {
	Err error
}

func (ErrUnknownEvent) Error

func (e ErrUnknownEvent) Error() string

type EventParser

type EventParser interface {
	Parse([]byte) (Eventer, error)
	IsEnabled() bool
}

func GetRegisteredEventParsers

func GetRegisteredEventParsers() []EventParser

type Eventer

type Eventer interface {
	Time() time.Time
	Name() string
	String() string
}

type Fuel

type Fuel struct {
	FuelMain      float64 `json:"fuelmain"`
	FuelReservoir float64 `json:"fuelreservoir"`
}

func (Fuel) String

func (f Fuel) String() string

type GenericEvent

type GenericEvent struct {
	Timestamp time.Time
	Event     string
	// contains filtered or unexported fields
}

func NewGenericEvent

func NewGenericEvent() *GenericEvent

func (*GenericEvent) Name

func (e *GenericEvent) Name() string

func (*GenericEvent) String

func (e *GenericEvent) String() string

func (*GenericEvent) Time

func (e *GenericEvent) Time() time.Time

func (*GenericEvent) UnmarshalJSON

func (e *GenericEvent) UnmarshalJSON(data []byte) error

type GenericEventParser

type GenericEventParser struct {
	// contains filtered or unexported fields
}

func NewGenericEventParser

func NewGenericEventParser() *GenericEventParser

func (GenericEventParser) IsEnabled

func (p GenericEventParser) IsEnabled() bool

func (GenericEventParser) Parse

func (p GenericEventParser) Parse(b []byte) (Eventer, error)

type Journal

type Journal struct {
	// contains filtered or unexported fields
}

func NewJournal

func NewJournal(path string) (*Journal, error)

func (*Journal) Close

func (j *Journal) Close() error

func (*Journal) Error

func (j *Journal) Error() error

func (*Journal) Events

func (j *Journal) Events() <-chan Eventer

type Journaler

type Journaler interface {
	Events() <-chan Eventer
	Close() error
}

type Status

type Status struct {
	Timestamp      time.Time    `json:"timestamp"`
	Event          string       `json:"event"`
	Flags          int64        `json:"flags"`
	Flags2         int64        `json:"flags2"`
	Pips           []int64      `json:"pips"`
	Firegroup      int64        `json:"firegroup"`
	GuiFocus       int64        `json:"guifocus"`
	Fuel           *Fuel        `json:"fuel"`
	Cargo          float64      `json:"cargo"`
	LegalState     string       `json:"legalstate"`
	Latitude       float64      `json:"latitude"`
	Altitude       float64      `json:"altitude"`
	Longitude      float64      `json:"longitude"`
	Heading        int          `json:"heading"`
	BodyName       string       `json:"bodyname"`
	PlanetRadius   float64      `json:"planetradius"`
	Balance        float64      `json:"balance"`
	Destination    *Destination `json:"destination"`
	Oxygen         float64      `json:"oxygen"`
	Health         float64      `json:"health"`
	Temperature    float64      `json:"temperature"`
	SelectedWeapon string       `json:"selectedweapon"`
	Gravity        float64      `json:"gravity"`
}

func (*Status) UnmarshalJSON

func (s *Status) UnmarshalJSON(data []byte) error

type StatusWatcher

type StatusWatcher struct {
	// contains filtered or unexported fields
}

func NewStatusWatcher

func NewStatusWatcher(path string) (*StatusWatcher, error)

func (*StatusWatcher) Changed

func (s *StatusWatcher) Changed() <-chan bool

func (*StatusWatcher) Close

func (s *StatusWatcher) Close() error

func (*StatusWatcher) Status

func (s *StatusWatcher) Status() *Status

type StatusWatcherer

type StatusWatcherer interface {
	Changed() <-chan bool
	Status() *Status
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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