Documentation
¶
Index ¶
- func Init(database *gorm.DB)
- func MapToDomain(modelTile Tile) domain.Tile
- func Paginate(page int, pageSize int) func(db *gorm.DB) *gorm.DB
- type FormBase
- type ModelBase
- type Satellite
- type SatelliteForm
- type TLE
- type TLEForm
- type Tile
- type TileForm
- type TileSatelliteMapping
- type TileSatelliteMappingForm
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MapToDomain ¶
MapToDomain converts a models.Tile to a domain.Tile.
Types ¶
type ModelBase ¶
type Satellite ¶
type Satellite struct { ModelBase Name string `gorm:"size:255;not null"` // Satellite name NoradID string `gorm:"size:255;unique;not null"` // NORAD ID Type string `gorm:"size:255"` // Satellite type (e.g., telescope, communication) }
Satellite Model
func (*Satellite) MapToForm ¶
func (model *Satellite) MapToForm() *SatelliteForm
type SatelliteForm ¶
type SatelliteForm struct { FormBase Name string `json:"name" validate:"required,min=2,max=50"` // Satellite name NoradID string `json:"norad_id" validate:"required,min=1,max=10"` // NORAD ID (unique identifier) Type string `json:"type" validate:"required,min=2,max=80"` // Satellite type }
func (*SatelliteForm) MapToModel ¶
func (form *SatelliteForm) MapToModel() *Satellite
type TLE ¶
type TLE struct { ModelBase NoradID string `gorm:"size:255;not null;index"` // Foreign key to Satellite table via Norad ID Line1 string `gorm:"size:255;not null"` Line2 string `gorm:"size:255;not null"` Epoch time.Time `gorm:"not null"` // Time associated with the TLE }
TLE Model
type TLEForm ¶
type TLEForm struct { FormBase NoradID string `json:"norad_id" validate:"required"` // Reference to the Satellite via NORAD ID Line1 string `json:"line1" validate:"required"` // First line of TLE Line2 string `json:"line2" validate:"required"` // Second line of TLE Epoch string `json:"epoch" validate:"required,datetime=2006-01-02T15:04:05Z"` // Epoch time (ISO8601 format) }
func (*TLEForm) MapToModel ¶
MapToModel maps TLEForm to a TLE model
type Tile ¶
type Tile struct { ModelBase Quadkey string `gorm:"size:256;unique;not null"` // Unique identifier for the tile (Quadkey) ZoomLevel int `gorm:"not null"` // Zoom level for the tile CenterLat float64 `gorm:"not null"` // Center latitude of the tile CenterLon float64 `gorm:"not null"` // Center longitude of the tile SpatialIndex string `gorm:"type:geometry;spatialIndex"` // Geometry column for spatial queries NbFaces int `gorm:"not null"` // Number of faces in the tile's shape Radius float64 `gorm:"not null"` // Radius of the tile in meters BoundariesJSON string `gorm:"type:json"` // Serialized JSON of the boundary vertices of the tile }
Tile Model
func MapFromDomain ¶
MapFromDomain converts a domain.Tile to a models.Tile.
type TileForm ¶
type TileForm struct { FormBase Quadkey string `json:"quadkey" validate:"required"` // Unique Quadkey for the tile ZoomLevel int `json:"zoom_level" validate:"required,min=1,max=20"` // Zoom level (1 = world, higher = more detailed) CenterLat float64 `json:"center_lat" validate:"required,min=-90,max=90"` // Center latitude of the tile CenterLon float64 `json:"center_lon" validate:"required,min=-180,max=180"` // Center longitude of the tile }
func (*TileForm) MapToModel ¶
type TileSatelliteMapping ¶
type TileSatelliteMapping struct { ModelBase NoradID string `gorm:"size:255;not null;index"` // Foreign key to Satellite table via NORAD ID TileID string `gorm:"type:char(36);not null"` // Foreign key to Tile table Aos time.Time `gorm:"not null"` // Visibility start time MaxElevation float64 `gorm:"not null"` // Max elevation during visibility in degrees }
func (*TileSatelliteMapping) MapToForm ¶
func (model *TileSatelliteMapping) MapToForm() *TileSatelliteMappingForm
MapToForm converts the Visibility model to a form structure
type TileSatelliteMappingForm ¶
type TileSatelliteMappingForm struct { FormBase NoradID string `json:"norad_id"` // NORAD ID for the satellite TileID string `json:"tile_id"` // Tile ID (string to match updated schema) Aos string `json:"start_time"` // ISO8601 format EndTime string `json:"end_time"` // ISO8601 format MaxElevation float64 `json:"max_elevation"` }
func (*TileSatelliteMappingForm) MapToModel ¶
func (form *TileSatelliteMappingForm) MapToModel() *TileSatelliteMapping
MapToModel converts a VisibilityForm to a Visibility model
Click to show internal directories.
Click to hide internal directories.