Documentation
¶
Overview ¶
Common defines a series of data types and functions used through the nds meta data server
Index ¶
- Constants
- func FilterOutEmpty(sequence []string) []string
- func FindFramesUnderPath(path string) map[string][]FrameInfo
- func FindRange(n int, lowerBoundPred RangePredicate, upperBoundPred RangePredicate) (int, int)
- func LocalFrameServerUri(root string) string
- func MaxInt(a int, b int) int
- func MaxInt32(a int32, b int32) int32
- func MaxInt64(a int64, b int64) int64
- func MinInt(a int, b int) int
- func MinInt32(a int32, b int32) int32
- func MinInt64(a int64, b int64) int64
- func ProcessStreamWithComments(reader io.Reader, callback ProcessStreamHandler)
- func RegisterFrameServer(name string, generator func(string) (FrameServer, error))
- func TimeSpanAsRangeString(ts TimeSpan) string
- func TimeSpansOverlap(t1 TimeSpan, t2 TimeSpan) bool
- type AUID
- type BasicChannel
- type ClassType
- type DataType
- type FrameInfo
- type FrameServer
- type GpsSecond
- type LocalFrameServer
- type ProcessStreamHandler
- type RangePredicate
- type TimeSpan
- func (ts TimeSpan) Contains(second GpsSecond) bool
- func (ts TimeSpan) End() GpsSecond
- func (ts *TimeSpan) Extend(new_end GpsSecond) GpsSecond
- func (ts TimeSpan) MarshalJSON() ([]byte, error)
- func (ts TimeSpan) Start() GpsSecond
- func (ts *TimeSpan) UnmarshalJSON(data []byte) error
- func (ts TimeSpan) WideOpen() bool
Constants ¶
const ( DataTypeUnknown = 0xff DataTypeInt16 = 0x1 DataTypeInt32 = 0x2 DataTypeInt64 = 0x4 DataTypeFloat32 = 0x8 DataTypeFloat64 = 0x10 DataTypeComplex32 = 0x20 DataTypeUint32 = 0x40 )
const ( ClassTypeUnknown = 0xff ClassTypeOnline = 0x01 ClassTypeRaw = 0x02 ClassTypeReduced = 0x04 ClassTypeSTrend = 0x08 ClassTypeMTrend = 0x10 ClassTypeTestPt = 0x20 ClassTypeStatic = 0x40 )
const UnassignedAuid = 0
Variables ¶
This section is empty.
Functions ¶
func FindRange ¶
func FindRange(n int, lowerBoundPred RangePredicate, upperBoundPred RangePredicate) (int, int)
Find the indexes for a sub-range that is bounded by lowerBoundPred an upperBoundPred
n is the total number of elements in the range The lower bound of the returned indexes is the first entry where lowerBoundPred(i) == true The upper bound of the returned indexes is the first entry where upperBoundPred(i) == true
This is implemented as calls to sort.Search with controlled ranges of entries.
It may be helpful to think of identifying a range by passing in a gte(x) as a lower bound, to identify the first entry >= x, and gt(x) to identify the end of the sequence.
func ProcessStreamWithComments ¶
func ProcessStreamWithComments(reader io.Reader, callback ProcessStreamHandler)
func RegisterFrameServer ¶
func RegisterFrameServer(name string, generator func(string) (FrameServer, error))
Types ¶
type BasicChannel ¶
type BasicChannel struct { Name string `json:"n"` Type DataType `json:"dt"` Class ClassType `json:"ct"` Rate float64 `json:"r"` }
A basic channel structure
type FrameInfo ¶
type FrameServer ¶
type FrameServer interface { FrameIntervals(frameType string, timeSpan TimeSpan) ([]TimeSpan, error) FrameFilePaths(frameType string, timeSpan TimeSpan) ([]string, error) ConnectionString() string }
func GetFrameServer ¶
func GetFrameServer(name string) (FrameServer, error)
func NewNullFrameServer ¶
func NewNullFrameServer() FrameServer
type LocalFrameServer ¶
type LocalFrameServer struct { Root string // contains filtered or unexported fields }
func NewLocalFrameServer ¶
func NewLocalFrameServer(path string) *LocalFrameServer
func (*LocalFrameServer) ConnectionString ¶
func (lf *LocalFrameServer) ConnectionString() string
type TimeSpan ¶
type TimeSpan struct {
// contains filtered or unexported fields
}
func CombineTimeSpans ¶
Return a timespan that is the combination of t1 + t2 the largest span possible taking the given endpoints.
func ConstrainTimeSpans ¶
Return a TimeSpan that is the intersection of t1, t2 ie the overlapping portions
Undefined if t1 and t2 do not overlap