Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = Config{ UseTrafficTLSAddress: false, WSPingInterval: 30 * time.Second, MissedPongThreshold: 2, TimeSyncInterval: 200 * time.Second, AllowUnauthenticated: false, }
DefaultConfig contains the default configuration.
Functions ¶
Types ¶
type Config ¶
type Config struct { UseTrafficTLSAddress bool `name:"use-traffic-tls-address" description:"Use WSS for the traffic address regardless of the TLS setting"` WSPingInterval time.Duration `name:"ws-ping-interval" description:"Interval to send WS ping messages"` MissedPongThreshold int `` /* 163-byte string literal not displayed */ TimeSyncInterval time.Duration `name:"time-sync-interval" description:"Interval to send time transfer messages"` AllowUnauthenticated bool `name:"allow-unauthenticated" description:"Allow unauthenticated connections"` }
Config defines the LoRa Basics Station configuration of the Gateway Server.
type Formatter ¶
type Formatter interface { // Endpoints fetches the connection endpoints for the protocol. Endpoints() Endpoints // HandleConnectionInfo handles connection information requests from web socket based protocols. // This function returns a byte stream that contains connection information (ex: scheme, host, port etc) or an error if applicable. HandleConnectionInfo(ctx context.Context, raw []byte, server io.Server, serverInfo ServerInfo, receivedAt time.Time) []byte // HandleUp handles upstream messages from web socket based gateways. // This function optionally returns a byte stream to be sent as response to the upstream message. HandleUp(ctx context.Context, raw []byte, ids *ttnpb.GatewayIdentifiers, conn *io.Connection, receivedAt time.Time) ([]byte, error) // FromDownlink generates a downlink byte stream that can be sent over the WS connection. FromDownlink(ctx context.Context, down *ttnpb.DownlinkMessage, bandID string, concentratorTime scheduling.ConcentratorTime, dlTime time.Time) ([]byte, error) // TransferTime generates a spurious time transfer message for a particular server time. TransferTime(ctx context.Context, serverTime time.Time, gpsTime *time.Time, concentratorTime *scheduling.ConcentratorTime) ([]byte, error) }
Formatter abstracts messages to/from websocket based gateways.
type ServerInfo ¶
ServerInfo contains information on the WebSocket server.
type Session ¶
Session contains the session state for a single gateway.
func SessionFromContext ¶
SessionFromContext returns a new session from the context. The session value can be modified by the caller.
Click to show internal directories.
Click to hide internal directories.