Documentation ¶
Overview ¶
The dl module has been writen as a lightweight replacement for the C libdali library. It is aimed at clients that need to connect to a datalink server, either requesting inforamtion or for uploading most likely miniseed records.
Index ¶
Constants ¶
const (
PreheaderSize = 3
)
Variables ¶
This section is empty.
Functions ¶
func MarshalPreheader ¶
func MarshalPreheader(r Preheader) (b [PreheaderSize]byte)
Types ¶
type DLConn ¶
DLConn provides connection information to a datalink service.
func NewDLConn ¶
NewDLConn makes a connection to a datalink service, the function SetId should be run after the connection is made and Close should be called when the link is no longer required.
func (*DLConn) SetId ¶
SetId sens an ID message to the remote connection and decodes the connection capabilities.
type DLink ¶
type DLink struct {
// contains filtered or unexported fields
}
DLink is a wrapper around a DLConn connection.
func NewDLink ¶
NewDLink returns a DLink pointer for the given server, optional settings can be passed as DLinkOpt functions.
func (*DLink) Connect ¶
Connect returns a DLConn pointer on a successful connection to a datalink server.
func (*DLink) SetProgram ¶
SetProgram sets the program name used for connection requests.
func (*DLink) SetTimeout ¶
SetTimeout sets the timeout value used for connection requests.
func (*DLink) SetUsername ¶
SetUsername sets the username used for connection requests.
type DLinkOpt ¶
type DLinkOpt func(*DLink)
DLinkOpt is a function for setting DLink internal parameters.
func SetDLProgram ¶
SetDLProgram sets the program name for datalink connections.
func SetDLTimeout ¶
SetDLTimeout sets the timeout for seedlink server commands and packet requests.
func SetDLUsername ¶
SetDLUsername sets the username for datalink connections.
type Preheader ¶
type Preheader struct { DL [2]byte //ASCII String == "DL" HeaderLength uint8 //1 byte describing the length of rest of the header }
func UnmarshalPreheader ¶
func UnmarshalPreheader(b [PreheaderSize]byte) (r Preheader)