fdsn

package
v0.0.0-...-ff2e950 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

package fdsn is for Federation of Digital Seismic Networks web services.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenRegex

func GenRegex(input []string, emptyDash bool, allowSpace bool) ([]string, error)

func ParseDataSelectPost

func ParseDataSelectPost(r io.Reader, d *[]DataSelect) error

ParesDataSelectGet parses the FDSN dataselect parameters in r from a dataselect POST request.

func WillBeEmpty

func WillBeEmpty(s string) bool

Types

type DataSearch

type DataSearch struct {
	Start, End                          time.Time
	Network, Station, Location, Channel string
}

type DataSelect

type DataSelect struct {
	StartTime   Time     `schema:"starttime"` // limit to data on or after the specified start time.
	EndTime     Time     `schema:"endtime"`   // limit to data on or before the specified end time.
	Network     []string `schema:"network"`   // network name of data to query
	Station     []string `schema:"station"`   // station name of data to query
	Location    []string `schema:"location"`  // location name of data to query
	Channel     []string `schema:"channel"`   // channel number of data to query
	Format      string   `schema:"format"`
	LongestOnly bool     `schema:"longestonly"`
	NoData      int      `schema:"nodata"` // Select status code for “no data”, either ‘204’ (default) or ‘404’.
}

func ParseDataSelectGet

func ParseDataSelectGet(v url.Values) (DataSelect, error)

ParesDataSelectGet parses the FDSN dataselect parameters in v from a dataselect GET request.

func (*DataSelect) Regexp

func (d *DataSelect) Regexp() (DataSearch, error)

regexp returns DataSearch with regexp strings that represents the search parameters. It converts the '*', '?', ' ' and '--' characters to their regular expression equivalents for pattern matching with Postgres POSIX regexp.

type Time

type Time struct {
	time.Time
}

func (*Time) UnmarshalText

func (t *Time) UnmarshalText(text []byte) (err error)

parses the time in text as per the FDSN spec. Pads text for parsing with time.RFC3339Nano. Accepted formats are (UTC):

YYYY-MM-DDTHH:MM:SS.ssssss
YYYY-MM-DDTHH:MM:SS
YYYY-MM-DD

Implements the encoding.TextUnmarshaler interface.

Jump to

Keyboard shortcuts

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