Documentation
¶
Index ¶
- Variables
- type Client
- func (c *Client) Connect(groundstation GroundStationConfig)
- func (c *Client) ListPlans(start time.Time, end time.Time) ([]*api.Plan, error)
- func (c *Client) OpenGroundStationStream(ctx context.Context) (api.GroundStationService_OpenGroundStationStreamClient, error)
- func (c *Client) Stop()
- func (c *Client) TelemetryRequest(telemetry *api.SatelliteTelemetry) *api.GroundStationStreamRequest
- func (c *Client) Wait()
- type Config
- type DataServer
- type DataServerConfig
- type GroundStationConfig
- type PlanEndFunction
- type PlanStartFunction
- type PlanWatcher
- func (w *PlanWatcher) CheckPlanState(planStart PlanStartFunction, planEnd PlanEndFunction)
- func (w *PlanWatcher) Start(planCheckInterval time.Duration, planStart PlanStartFunction, ...)
- func (w *PlanWatcher) Stop()
- func (w *PlanWatcher) UpdatePlans(planStart PlanStartFunction, planEnd PlanEndFunction)
- func (w *PlanWatcher) Wait()
- type Runner
- type ScheduleServer
- type SchedulerConfig
- type StartFunction
- type StopFunction
Constants ¶
This section is empty.
Variables ¶
var ByteOrder = binary.LittleEndian
var DefaultPlanUpdateInterval = time.Minute * 5
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a StellarStation Ground Station API client.
func (*Client) Connect ¶
func (c *Client) Connect(groundstation GroundStationConfig)
Connect connects to the ground station.
func (*Client) OpenGroundStationStream ¶
func (c *Client) OpenGroundStationStream(ctx context.Context) (api.GroundStationService_OpenGroundStationStreamClient, error)
OpenGroundStationStream returns a bidirectional streaming client.
func (*Client) TelemetryRequest ¶
func (c *Client) TelemetryRequest(telemetry *api.SatelliteTelemetry) *api.GroundStationStreamRequest
TelemetryRequest wraps a telemetry message in a request object.
type Config ¶
type Config struct { // GroundStation contains the groundstation configuration. GroundStation GroundStationConfig `yaml:"station"` // Data contains the data server configurations Data []DataServerConfig `yaml:"ports"` // Schedulers contains the schedular configurations Schedulers []SchedulerConfig }
Config contains all of the configuration for the application.
func LoadConfig ¶
LoadConfig loads a configuration file.
type DataServer ¶
type DataServer struct {
// contains filtered or unexported fields
}
DataServer does all of the actual work.
func NewDataServer ¶
func NewDataServer(gsConfig GroundStationConfig, config DataServerConfig, client *Client) *DataServer
NewDataServer creates a new DataServer instance
func (*DataServer) PlanStart ¶
func (s *DataServer) PlanStart(plan *api.Plan)
PlanStart is executed when a plan starts
func (*DataServer) TelemetryRequest ¶
func (s *DataServer) TelemetryRequest(plan *api.Plan, framing v1.Framing, data []byte) *api.GroundStationStreamRequest
TelemetryRequest creates a telemetry request objet for the given plan and data.
func (*DataServer) Wait ¶
func (s *DataServer) Wait()
Wait will wait for the dataServer to stop before returning
type DataServerConfig ¶
type DataServerConfig struct { // Name should be a descriptive name. // This is mainly used for logging purposes. (required) Name string // Address is the TCP address and port number to listen to. // (required) Address string // Framing should match the framing type of the data. // Valid values are: Bitstream, AX.25, Waterfall, IQ // (default: BITSTREAM) Framing string // Format specifices the format of the data // Valid values are: LengthPrefix // (default: LengthPrefix) Format string // Satellite should match the satellite ID provided // by the StellarStation platform. (optional) Satellite string // Channel should match the communications channel // ID provided by the StellarStation platform. // (optional) Channel string }
DataServerConfig represents the configuration for a single data server.
type GroundStationConfig ¶
type GroundStationConfig struct { // Name should be a descriptive name. Name string // ID should match the ground station ID // provided by StellarStation. ID string // Address is the URL of the ground station. Address string // Key should be the filename of the API key to use. Key string // PlanUpdateInterval is the time between plan update checks. PlanUpdateInterval time.Duration `yaml:"plan-update-inteval"` }
GroundStationConfig defines the configuration for the ground station.
type PlanEndFunction ¶
type PlanStartFunction ¶
type PlanWatcher ¶
type PlanWatcher struct {
// contains filtered or unexported fields
}
PlanWatcher periodically checks for plans for a ground station.
func NewPlanWatcher ¶
func NewPlanWatcher(client *Client) *PlanWatcher
NewPlanWatcher creates a new PlanWatcher instance
func (*PlanWatcher) CheckPlanState ¶
func (w *PlanWatcher) CheckPlanState(planStart PlanStartFunction, planEnd PlanEndFunction)
CheckPlanState checks for any plan state changes that occurred in the past second
func (*PlanWatcher) Start ¶
func (w *PlanWatcher) Start(planCheckInterval time.Duration, planStart PlanStartFunction, planEnd PlanEndFunction)
Start begins checking for plans.
func (*PlanWatcher) UpdatePlans ¶
func (w *PlanWatcher) UpdatePlans(planStart PlanStartFunction, planEnd PlanEndFunction)
UpdatePlans updates the plan list for the current ground station
func (*PlanWatcher) Wait ¶
func (w *PlanWatcher) Wait()
Wait will wait for the watcher to stop watching for plans
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner keeps track of whether or not something is running
func (*Runner) Done ¶
func (r *Runner) Done() chan struct{}
Done returns the current done channel for use in select statements
func (*Runner) Start ¶
func (r *Runner) Start(startFunction StartFunction, stopFunction StopFunction)
Start begins execution
type ScheduleServer ¶
type ScheduleServer struct {
// contains filtered or unexported fields
}
ScheduleServer provides a RESTful API for scheduling information
func NewScheduleServer ¶
func NewScheduleServer(gsConfig GroundStationConfig, config SchedulerConfig, client *Client) *ScheduleServer
NewScheduleServer creates a new ScheduleServer instance
func (*ScheduleServer) Stop ¶
func (s *ScheduleServer) Stop()
type SchedulerConfig ¶
type SchedulerConfig struct { // Name should be a descriptive name. // This is mainly used for logging purposes. (required) Name string // Address is the TCP address and port number to listen to. // (required) Address string // Format specifices the format of the data // Valid values are: Tab // (default: Tab) Format string // Satellite should match the satellite ID provided // by the StellarStation platform. (optional) Satellite string // Channel should match the communications channel // ID provided by the StellarStation platform. // (optional) Channel string }
type StartFunction ¶
type StopFunction ¶
type StopFunction func()