ino

package module
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2017 License: MIT Imports: 14 Imported by: 0

README

ino

NMEA AIS data stuff. Not for public consumption yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateRouter

func CreateRouter(server *HTTPServer) (*mux.Router, error)

Types

type DB

type DB struct {
	*sqlx.DB
}

func (*DB) AddMessage

func (db *DB) AddMessage(mmsi int64, messageType int64, message []byte, raw []byte) error

func (*DB) AddPacket

func (db *DB) AddPacket(raw string) error

func (*DB) GetMessageStatsByVesselForTypeJson

func (db *DB) GetMessageStatsByVesselForTypeJson(messageType int) ([]byte, error)

func (*DB) GetMessageStatsByVesselForVesselJson

func (db *DB) GetMessageStatsByVesselForVesselJson(mmsi int) ([]byte, error)

func (*DB) GetMessageStatsByVesselJson

func (db *DB) GetMessageStatsByVesselJson() ([]byte, error)

func (*DB) GetMessageStatsJson

func (db *DB) GetMessageStatsJson() ([]byte, error)

func (*DB) GetPositionsForVessel

func (db *DB) GetPositionsForVessel(mmsi int) ([]*Position, error)

func (*DB) GetPositionsForVesselGeojson

func (db *DB) GetPositionsForVesselGeojson(mmsi int) ([]byte, error)

func (*DB) GetVessel

func (db *DB) GetVessel(mmsi int) (*Vessel, error)

func (*DB) GetVessels

func (db *DB) GetVessels() ([]*Vessel, error)

func (*DB) GetVesselsGeojson

func (db *DB) GetVesselsGeojson() ([]byte, error)

func (*DB) Open

func (db *DB) Open(connectionString string) error

func (*DB) UpdatePosition

func (db *DB) UpdatePosition(r nmeaais.DecoderOutput)

func (*DB) UpdatePositionFromPositionReportClassA

func (db *DB) UpdatePositionFromPositionReportClassA(m *nmeaais.PositionReportClassA) error

func (*DB) UpdatePositionFromPositionReportClassBStandard

func (db *DB) UpdatePositionFromPositionReportClassBStandard(m *nmeaais.PositionReportClassBStandard) error

func (*DB) UpdateVessel

func (db *DB) UpdateVessel(r nmeaais.DecoderOutput)

func (*DB) UpdateVesselFromPositionReportClassA

func (db *DB) UpdateVesselFromPositionReportClassA(m *nmeaais.PositionReportClassA) error

func (*DB) UpdateVesselFromPositionReportClassBStandard

func (db *DB) UpdateVesselFromPositionReportClassBStandard(m *nmeaais.PositionReportClassBStandard) error

func (*DB) UpdateVesselFromStaticAndVoyageRelatedData

func (db *DB) UpdateVesselFromStaticAndVoyageRelatedData(m *nmeaais.StaticAndVoyageRelatedData) error

func (*DB) UpdateVesselFromStaticDataReportA

func (db *DB) UpdateVesselFromStaticDataReportA(m *nmeaais.StaticDataReportA) error

func (*DB) UpdateVesselFromStaticDataReportB

func (db *DB) UpdateVesselFromStaticDataReportB(m *nmeaais.StaticDataReportB) error

type HTTPServer

type HTTPServer struct {
	DB *DB
}

func NewHTTPServer

func NewHTTPServer(db *DB) *HTTPServer

func (*HTTPServer) GetMessageStats

func (s *HTTPServer) GetMessageStats(w http.ResponseWriter, r *http.Request, vars map[string]string) error

func (*HTTPServer) GetMessageStatsByVessel

func (s *HTTPServer) GetMessageStatsByVessel(w http.ResponseWriter, r *http.Request, vars map[string]string) error

func (*HTTPServer) GetMessageStatsByVesselForType

func (s *HTTPServer) GetMessageStatsByVesselForType(w http.ResponseWriter, r *http.Request, vars map[string]string) error

func (*HTTPServer) GetMessageStatsByVesselForVessel

func (s *HTTPServer) GetMessageStatsByVesselForVessel(w http.ResponseWriter, r *http.Request, vars map[string]string) error

func (*HTTPServer) GetPositionsForVessel

func (s *HTTPServer) GetPositionsForVessel(w http.ResponseWriter, r *http.Request, vars map[string]string) error

func (*HTTPServer) GetVesselByMmsi

func (s *HTTPServer) GetVesselByMmsi(w http.ResponseWriter, r *http.Request, vars map[string]string) error

func (*HTTPServer) GetVessels

func (s *HTTPServer) GetVessels(w http.ResponseWriter, r *http.Request, vars map[string]string) error

type HttpApiFunc

type HttpApiFunc func(w http.ResponseWriter, r *http.Request, vars map[string]string) error

type Monstah

type Monstah struct {
	DB *DB
	// contains filtered or unexported fields
}

func NewMonstah

func NewMonstah(db *DB) *Monstah

func (*Monstah) Decode

func (m *Monstah) Decode(address string)

func (*Monstah) Shutdown

func (m *Monstah) Shutdown()

type Position

type Position struct {
	MMSI      int64      `json:"mmsi" db:"mmsi"`
	Latitude  null.Float `json:"latitude" db:"latitude"`
	Longitude null.Float `json:"longitude" db:"longitude"`
	CreatedAt time.Time  `json:"createdAt" db:"created_at"`
}

type Vessel

type Vessel struct {
	MMSI             int64       `json:"mmsi" db:"mmsi"`
	VesselName       null.String `json:"vesselName" db:"vessel_name"`
	CallSign         null.String `json:"callSign" db:"call_sign"`
	ShipType         null.String `json:"shipType" db:"ship_type"`
	Length           null.Int    `json:"length" db:"length"`
	Breadth          null.Int    `json:"breadth" db:"breadth"`
	Draught          null.Float  `json:"draught" db:"draught"`
	Latitude         null.Float  `json:"latitude" db:"latitude"`
	Longitude        null.Float  `json:"longitude" db:"longitude"`
	SpeedOverGround  null.Float  `json:"speedOverGround" db:"speed_over_ground"`
	TrueHeading      null.Float  `json:"trueHeading" db:"true_heading"`
	CourseOverGround null.Float  `json:"courseOverGround" db:"course_over_ground"`
	NavigationStatus null.String `json:"navigationStatus" db:"navigation_status"`
	Destination      null.String `json:"destination" db:"destination"`
	UpdatedAt        time.Time   `json:"updatedAt" db:"updated_at"`
}

Directories

Path Synopsis
cmd
ino

Jump to

Keyboard shortcuts

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