emds

package
v0.0.0-...-d2e1d9a Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2018 License: BSD-3-Clause Imports: 8 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertRange

func ConvertRange(rangeString string) (int64, error)

ConvertRange converts a string range returned by the API into an int for use in UUDIF

func RowsetsToUUDIF

func RowsetsToUUDIF(rowsets []Rowset, generatorName string, generatorVersion string) ([]byte, error)

RowsetsToUUDIF converts a list of rowsets to a UUDIF message

Types

type ByOrderID

type ByOrderID []Order

ByOrderID sorts orders by order ID

func (ByOrderID) Len

func (o ByOrderID) Len() int

func (ByOrderID) Less

func (o ByOrderID) Less(i, j int) bool

func (ByOrderID) Swap

func (o ByOrderID) Swap(i, j int)

type ColumnIndices

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

ColumnIndices keeps index values of the rowsets from UUDIF.

func GetColumnIndices

func GetColumnIndices(message []byte) (ColumnIndices, error)

GetColumnIndices gets column indices for mapping keys correctly.

func (ColumnIndices) MarshalEasyJSON

func (v ColumnIndices) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (ColumnIndices) MarshalJSON

func (v ColumnIndices) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*ColumnIndices) UnmarshalEasyJSON

func (v *ColumnIndices) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*ColumnIndices) UnmarshalJSON

func (v *ColumnIndices) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Order

type Order struct {
	OrderID       int64   `json:"orderID"`
	RegionID      int64   `json:"regionID"`
	TypeID        int64   `json:"typeID"`
	GeneratedAt   string  `json:"generatedAt"`
	Price         float64 `json:"price"`
	VolRemaining  int64   `json:"volRemaining"`
	OrderRange    int64   `json:"range"`
	VolEntered    int64   `json:"volEntered"`
	MinVolume     int64   `json:"minVolume"`
	Bid           bool    `json:"bid"`
	IssueDate     string  `json:"issueDate"`
	Duration      int64   `json:"duration"`
	StationID     int64   `json:"stationID"`
	SolarSystemID int64   `json:"solarSystemID"`
}

Order stores information about a single order on the market including info from the rowset.

func ParseOrders

func ParseOrders(rows []byte, indices ColumnIndices, regionID int64, typeID int64, generatedAt string) ([]Order, error)

ParseOrders parses orders from rows.

func (Order) MarshalEasyJSON

func (v Order) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Order) MarshalJSON

func (v Order) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Order) UnmarshalEasyJSON

func (v *Order) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Order) UnmarshalJSON

func (v *Order) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type RawRowset

type RawRowset struct {
	GeneratedAt string `json:"generatedAt"`
	RegionID    int64  `json:"regionID"`
	TypeID      int64  `json:"typeID"`
	Rows        []byte `json:"-"`
}

RawRowset contains unparsed orders for a given region/type combination at generatedAt (market snapshot). Can be used for deduplication of orders without parsing.

func ExtractRawRowsets

func ExtractRawRowsets(message []byte) ([]RawRowset, error)

ExtractRawRowsets extracts raw rowsets (orders are not being parsed).

func (RawRowset) MarshalEasyJSON

func (v RawRowset) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (RawRowset) MarshalJSON

func (v RawRowset) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*RawRowset) UnmarshalEasyJSON

func (v *RawRowset) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*RawRowset) UnmarshalJSON

func (v *RawRowset) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Rowset

type Rowset struct {
	GeneratedAt string  `json:"generatedAt"`
	RegionID    int64   `json:"regionID"`
	TypeID      int64   `json:"typeID"`
	Rows        []Order `json:"orders"`
}

Rowset contains all orders for a given region/type combination at generatedAt (market snapshot).

func ParseRawRowsets

func ParseRawRowsets(rawRowsets []RawRowset, indices ColumnIndices) ([]Rowset, error)

ParseRawRowsets parses orders in raw rowset.

func ParseUUDIF

func ParseUUDIF(message []byte) ([]Rowset, error)

ParseUUDIF message into structs. You probably want to use this function if all you want is to get all data.

func (Rowset) MarshalEasyJSON

func (v Rowset) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Rowset) MarshalJSON

func (v Rowset) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Rowset) UnmarshalEasyJSON

func (v *Rowset) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Rowset) UnmarshalJSON

func (v *Rowset) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

Jump to

Keyboard shortcuts

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