common

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 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 {
	Name       string  `json:"name"`
	Freq       string  `json:"freq"`
	SampleRate string  `json:"sample_rate"`
	Latitude   float32 `json:"latitude"`
	Longitude  float32 `json:"longitude"`
}

func (*FMDevice) Device

func (*FMDevice) Device()

type IQDevice

type IQDevice struct {
	Name       string  `json:"name"`
	Freq       string  `json:"freq"`
	SampleRate string  `json:"sample_rate"`
	Latitude   float32 `json:"latitude"`
	Longitude  float32 `json:"longitude"`
}

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