ino

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: MIT Imports: 17 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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) (*chi.Mux, error)

Types

type DB

type DB struct {
	*sqlx.DB
}

func (*DB) AddMessage

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

func (*DB) AddPacket

func (db *DB) AddPacket(raw string, feedID int) error

func (*DB) GetFeedId added in v0.0.1

func (db *DB) GetFeedId(address string) (int, error)

func (*DB) GetFeeds added in v0.0.1

func (db *DB) GetFeeds() ([]*Feed, error)

func (*DB) GetMessageStatsByVesselForTypeJSON added in v1.0.0

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

func (*DB) GetMessageStatsByVesselForVesselJSON added in v1.0.0

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

func (*DB) GetMessageStatsByVesselJSON added in v1.0.0

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

func (*DB) GetMessageStatsJSON added in v1.0.0

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 Feed added in v0.0.1

type Feed struct {
	FeedID        int64     `json:"feedId" db:"feed_id"`
	RemoteAddress string    `json:"remoteAddress" db:"remote_address"`
	Active        bool      `json:"active" db:"active"`
	CreatedAt     time.Time `json:"createdAt" db:"created_at"`
}

type HTTPApiFunc added in v1.0.0

type HTTPApiFunc func(w http.ResponseWriter, r *http.Request) 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) error

func (*HTTPServer) GetMessageStatsByVessel

func (s *HTTPServer) GetMessageStatsByVessel(w http.ResponseWriter, r *http.Request) error

func (*HTTPServer) GetMessageStatsByVesselForType

func (s *HTTPServer) GetMessageStatsByVesselForType(w http.ResponseWriter, r *http.Request) error

func (*HTTPServer) GetMessageStatsByVesselForVessel

func (s *HTTPServer) GetMessageStatsByVesselForVessel(w http.ResponseWriter, r *http.Request) error

func (*HTTPServer) GetPositionsForVessel

func (s *HTTPServer) GetPositionsForVessel(w http.ResponseWriter, r *http.Request) error

func (*HTTPServer) GetVesselByMmsi

func (s *HTTPServer) GetVesselByMmsi(w http.ResponseWriter, r *http.Request) error

func (*HTTPServer) GetVessels

func (s *HTTPServer) GetVessels(w http.ResponseWriter, r *http.Request) 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 MonstahManager added in v0.0.1

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

func NewMonstahManager added in v0.0.1

func NewMonstahManager(db *DB) (*MonstahManager, error)

func (*MonstahManager) Shutdown added in v0.0.1

func (mm *MonstahManager) 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 command

Jump to

Keyboard shortcuts

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