publisher

package
v0.0.0-...-1f0e2f3 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeInt32Array

func DecodeInt32Array(val any) ([]int32, error)

func EncodeInt32Array

func EncodeInt32Array(data []int32) string

func Initialize

func Initialize(config *config.Conf, status *Status)

func Subscribe

func Subscribe(gp *Geophone, enable *bool, onMessage func(gp *Geophone) error)

Types

type ChannelSegmentBuffer

type ChannelSegmentBuffer struct {
	DataBuffer []int32
	Samples    int32
	SeqNum     int64
}

type Geophone

type Geophone struct {
	TS  int64      `json:"ts" gorm:"ts;index;not null"`
	EHZ Int32Array `json:"ehz" gorm:"ehz;type:text;not null"`
	EHE Int32Array `json:"ehe" gorm:"ehe;type:text;not null"`
	EHN Int32Array `json:"ehn" gorm:"ehn;type:text;not null"`
}

type Int32Array

type Int32Array []int32

func (*Int32Array) Scan

func (i *Int32Array) Scan(val any) error

func (Int32Array) Value

func (i Int32Array) Value() (driver.Value, error)

type SegmentBuffer

type SegmentBuffer struct {
	TimeStamp     time.Time
	ChannelBuffer map[string]*ChannelSegmentBuffer
}

type Status

type Status struct {
	LastRecvTime time.Time // Timestamp of last received packet
	ReadyTime    time.Time // If is zero, app will stuck to wait for time syncing
	Geophone     Geophone  // Geophone data of nearest 1 second
	Buffer       *Geophone // Buffer area, should not be externally accessed
	System       *System
}

type System

type System struct {
	Messages int64   `json:"messages"`
	Errors   int64   `json:"errors"`
	Offset   float64 `json:"offset"`
}

Jump to

Keyboard shortcuts

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