common

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DataSubjectPrefix    string = "specpipe.data"    // stream subject
	IqDataSubjectPrefix  string = "specpipe-iq.data" // stream subject
	ClusterSubjectPrefix string = "specpipe-cluster" // simple subject

	KVStoreBucket string = "specpipe"
)
View Source
const OkMsg string = "ok"

Variables

View Source
var (
	TimestampHeader string = "ts"
)

Functions

func ClusterSubject

func ClusterSubject(sdrType SDRType, deviceName string, cmd ClusterCmd) string

func DataSubject

func DataSubject(sdrType SDRType, deviceName string) string

func DeviceNameFromKey

func DeviceNameFromKey(key string) string

func KVStoreKey

func KVStoreKey(sdrType SDRType, deviceName string) string

func NewNATSConn

func NewNATSConn(natsUrl string) (*nc.Conn, error)

func NewNatsPublisher

func NewNatsPublisher(natsUrl string) (message.Publisher, error)

Types

type ClusterCmd

type ClusterCmd string
const (
	HealthCheckCmd ClusterCmd = "health"
	WatchConfigCmd ClusterCmd = "watchcfg"
)

type Device

type Device interface {
	Device()
}

type EdgeLogrus

type EdgeLogrus struct {
	*log.Entry
}

func NewEdgeLogrus

func NewEdgeLogrus(level string) (EdgeLogrus, error)

type FMDevice

type FMDevice struct {
	RegisterTs      int64   `json:"register_ts"`
	SpecpipeVersion string  `json:"specpipe_version"`
	Name            string  `json:"name"`
	Freq            string  `json:"freq"`
	SampleRate      string  `json:"sample_rate"`
	ResampleRate    string  `json:"resample_rate"`
	Latitude        float32 `json:"latitude"`
	Longitude       float32 `json:"longitude"`
}

func (*FMDevice) Device

func (*FMDevice) Device()

type IQDevice

type IQDevice struct {
	RegisterTs      int64   `json:"register_ts"`
	SpecpipeVersion string  `json:"specpipe_version"`
	Name            string  `json:"name"`
	Freq            string  `json:"freq"`
	SampleRate      string  `json:"sample_rate"`
	Latitude        float32 `json:"latitude"`
	Longitude       float32 `json:"longitude"`
	Forward         bool    `json:"forward"`
}

func (*IQDevice) Device

func (*IQDevice) Device()

type SDRType

type SDRType string
const (
	FM SDRType = "fm"
	IQ SDRType = "iq"
)

type ServerLogrus

type ServerLogrus struct {
	*log.Entry
}

func NewServerLogrus

func NewServerLogrus(level string) (ServerLogrus, error)

Jump to

Keyboard shortcuts

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