data

package
v0.0.0-...-76b4bc4 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateRenderList

func GenerateRenderList(satList []Satellite) []render.Renderer

Types

type CelestrakClient

type CelestrakClient struct {
	AllSatellitesURL string
	GeoSatellitesURL string
	// contains filtered or unexported fields
}

CelestrakClient implementation of the Source interface for Celestrak

func NewCelestrakClient

func NewCelestrakClient(allSatellitesURL, geoSatellitesURL string) *CelestrakClient

NewCelestrakClient Generates a new CelestrakClient from the information in the configuration file

func (*CelestrakClient) GetConfig

func (cc *CelestrakClient) GetConfig() (map[string]interface{}, error)

GetConfig return server configuration

func (*CelestrakClient) GetData

func (cc *CelestrakClient) GetData() ([]Satellite, error)

GetData Implementation of the Source interface for Celestrak

func (*CelestrakClient) GetDataSource

func (cc *CelestrakClient) GetDataSource() string

GetDataSource return server data source

type CelestrakConfiguration

type CelestrakConfiguration struct {
	AllSatellitesURL string `yaml:"all_satellites_url"`
	GeoSatellitesURL string `yaml:"geo_satellites_url"`
	RefreshRateHours int    `yaml:"celestrak_refresh_rate_hours"`
}

type CelestrakData

type CelestrakData struct {
	ObjectName         string  `json:"OBJECT_NAME"`
	ObjectID           string  `json:"OBJECT_ID"`
	Epoch              string  `json:"EPOCH"`
	MeanMotion         float64 `json:"MEAN_MOTION"`
	Eccentricity       float64 `json:"ECCENTRICITY"`
	Inclination        float64 `json:"INCLINATION"`
	RaOfASCMode        float64 `json:"RA_OF_ASC_NODE"`
	ArgOfPericenter    float64 `json:"ARG_OF_PERICENTER"`
	MeanAnomaly        float64 `json:"MEAN_ANOMALY"`
	EphemerisType      int     `json:"EPHEMERIS_TYPE"`
	ClassificationType string  `json:"CLASSIFICATION_TYPE"`
	NORADCatID         int     `json:"NORAD_CAT_ID"`
	ElementSetNo       int     `json:"ELEMENT_SET_NO"`
	RevAtEpoch         int     `json:"REV_AT_EPOCH"`
	BStar              float64 `json:"BSTAR"`
	MeanMotionDOT      float64 `json:"MEAN_MOTION_DOT"`
	MeanMotionDDOT     float64 `json:"MEAN_MOTION_DDOT"`
}

CelestrakData structure used to parse Celestrak response when using the JSON API

type FileSource

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

func NewFileSource

func NewFileSource(filePath string) *FileSource

func (*FileSource) GetConfig

func (fs *FileSource) GetConfig() (map[string]interface{}, error)

func (*FileSource) GetData

func (fs *FileSource) GetData() ([]Satellite, error)

func (*FileSource) GetDataSource

func (fs *FileSource) GetDataSource() string

type FileSourceConfiguration

type FileSourceConfiguration struct {
	SourceFilePath     string `yaml:"source_file_path"`
	RefreshRateSeconds int    `yaml:"refresh_rate_seconds"`
}

type Info

type Info struct {
	ServerPort              int                     `yaml:"server_port"`
	DataSource              string                  `yaml:"data_source"`
	CelestrakConfiguration  CelestrakConfiguration  `yaml:"celestrak_configuration"`
	FileSourceConfiguration FileSourceConfiguration `yaml:"file_source_configuration"`
}

Info Receiving structure when parsing the configuration file

func (Info) IsValid

func (i Info) IsValid() bool

type Satellite

type Satellite struct {
	SatelliteName string `json:"satellite_name"`
	NORADID       int    `json:"norad_id"`
	TLELine1      string `json:"tle_line_1"`
	TLELine2      string `json:"tle_line_2"`
}

Satellite data structure for each satellite

func (Satellite) IsNull

func (s Satellite) IsNull() bool

func (Satellite) Render

func (s Satellite) Render(w http.ResponseWriter, r *http.Request) error

type SatelliteErr

type SatelliteErr struct {
	Err error
	Sat Satellite
}

type Source

type Source interface {
	GetData() ([]Satellite, error)
	GetDataSource() string
	GetConfig() (map[string]interface{}, error)
}

Source interface for either Celestrak or Skyminer data

Jump to

Keyboard shortcuts

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