Documentation
¶
Index ¶
- Constants
- Variables
- func FindJournals() (dir string, err error)
- func LoadJSON(file string, into interface{}) error
- func Must(err error)
- func SaveJSON(file string, data interface{}) error
- type App
- type AppChannel
- type Change
- type ChgF32
- type ChgString
- type Commander
- type EDState
- func (ed *EDState) Load(file string) error
- func (es *EDState) MustCommander() *Commander
- func (es *EDState) Read(do func() error) error
- func (ed *EDState) Save(file string, cmdrFile string) error
- func (es *EDState) SetEDVersion(v string)
- func (es *EDState) SetLanguage(lang string)
- func (es *EDState) Write(do func() error) error
- func (es *EDState) WriteCmdr(do func(*Commander) error) error
- type EventHandlingError
- type Extension
- func (ext *Extension) AddApp(name string, app App)
- func (ext *Extension) DiffEvtsHdls() (es []string, hs []string)
- func (ext *Extension) EventHandler(evtType events.Type, raw []byte) (err error)
- func (ext *Extension) MustRun(latestJournal bool)
- func (ext *Extension) Run(latestJournal bool) (err error)
- func (ext *Extension) Stop()
- type Galaxy
- type InMemGalaxy
- type JSONLocation
- type Location
- type Material
- type Materials
- type Port
- type Rank
- type RankType
- type Ranks
- type Ship
- type SysCoos
- type System
Examples ¶
Constants ¶
View Source
const ( Major = 0 Minor = 1 Patch = 0 Quality = `dev` BuildNo = 1 )
View Source
const EchoGalaxy = echoGxy(0)
Variables ¶
Functions ¶
func FindJournals ¶
Types ¶
type AppChannel ¶
type AppChannel struct {
// contains filtered or unexported fields
}
func NewAppChannel ¶
func NewAppChannel(app App, capacity int) *AppChannel
func (*AppChannel) Close ¶
func (ac *AppChannel) Close()
type Commander ¶
type Commander struct {
FID string
Name string
Ranks Ranks
ShipID int
At JSONLocation
Ships map[int]*Ship
Mats Materials
// contains filtered or unexported fields
}
func NewCommander ¶
func (*Commander) StoreCurrentShip ¶
shipId == 0 => caller has no idea of id
type EDState ¶
type EDState struct {
Lock sync.RWMutex `json:"-"`
GoEDXversion struct{ Major, Minor, Patch int }
// Is modified w/o using Lock!
EDVersion string
Beta bool
Language string
L10n struct {
Lang string
Region string
}
Cmdr *Commander `json:"-"`
LastJournalEvent time.Time
}
func NewEDState ¶
func NewEDState() *EDState
func (*EDState) MustCommander ¶
func (*EDState) SetEDVersion ¶
func (*EDState) SetLanguage ¶
type EventHandlingError ¶
func (*EventHandlingError) Error ¶
func (ehe *EventHandlingError) Error() string
type Extension ¶
type Extension struct {
JournalDir string
JournalAfter time.Time
EdState *EDState
Galaxy Galaxy
CmdrFile func(*Commander) string
// contains filtered or unexported fields
}
func (*Extension) DiffEvtsHdls ¶
func (*Extension) EventHandler ¶
type InMemGalaxy ¶
func (InMemGalaxy) EdgxSystem ¶
func (g InMemGalaxy) EdgxSystem(addr uint64, name string, coos []float32) (*System, interface{})
type JSONLocation ¶
type JSONLocation struct {
Location
}
func (JSONLocation) MarshalJSON ¶
func (jloc JSONLocation) MarshalJSON() ([]byte, error)
func (JSONLocation) Port ¶
func (jl JSONLocation) Port() *Port
func (JSONLocation) System ¶
func (jl JSONLocation) System() *System
func (*JSONLocation) UnmarshalJSON ¶
func (jloc *JSONLocation) UnmarshalJSON(data []byte) (err error)
type Port ¶
Example ¶
p := Port{
Sys: &System{
Addr: 4711,
Name: "Köln",
Coos: ToSysCoos(3, 2, 1),
},
Name: "Hafen",
}
var sb bytes.Buffer
enc := json.NewEncoder(&sb)
enc.Encode(&p)
os.Stdout.Write(sb.Bytes())
sb.Reset()
enc.Encode(JSONLocation{&p})
os.Stdout.Write(sb.Bytes())
var jloc JSONLocation
fmt.Println(json.Unmarshal(sb.Bytes(), &jloc))
sb.Reset()
enc.Encode(&p)
os.Stdout.Write(sb.Bytes())
Output: {"Sys":{"Addr":4711,"Name":"Köln","Coos":[3,2,1]},"Name":"Hafen","Docked":false} {"@type":"port","Docked":false,"Name":"Hafen","Sys":{"Addr":4711,"Name":"Köln","Coos":[3,2,1]}} <nil> {"Sys":{"Addr":4711,"Name":"Köln","Coos":[3,2,1]},"Name":"Hafen","Docked":false}
Source Files
¶
- apps.go
- changeable.go
- edstate.go
- edx.go
- ehCommander.go
- ehDocked.go
- ehFSDJump.go
- ehFileheader.go
- ehLoadout.go
- ehLocation.go
- ehMaterials.go
- ehSellShipOnRebuy.go
- ehSetUserShipName.go
- ehShipTargeted.go
- ehShipyardBuy.go
- ehShipyardNew.go
- ehShipyardSell.go
- ehShipyardSwap.go
- ehUndocked.go
- galaxy.go
- locations.go
- log.go
- os.go
- ranktype_string.go
- version.go
Directories
¶
| Path | Synopsis |
|---|---|
|
apps
|
|
|
bboltgalaxy/bbgxydump
command
|
|
|
examples
|
|
|
feedfiles
command
|
|
|
tools
|
|
|
newjournalevent
command
|
Click to show internal directories.
Click to hide internal directories.