SeedLink protocol basic implementation in pure Go.
slgo implements a lightweight SeedLink server/provider/consumer stack suitable for testing and simple deployments. It includes example provider and consumer implementations that demonstrate how to publish seismic-like sample data into the SeedLink pipeline and serve it to SeedLink clients (for example the Swarm client).
- SeedLink server: minimal SeedLink server implementation.
- Provider interface: implement
GetStations(),GetStreams(),QueryHistory()to supply station/stream metadata and historical data. - Consumer interface: subscribe/unsubscribe to live data published by your data source.
- Example: runnable example in the
example/directory showing a simple provider, consumer and a message bus generating sample waveforms.
Requires Go 1.20 or later.
To fetch the module for use in other projects:
$ go get github.com/bclswl0827/slgoTo run the included example server locally:
$ go run ./exampleThe example launches a SeedLink server on 0.0.0.0:18000 by default and publishes synthetic data into the message bus. Test it with a SeedLink client such as Swarm (https://volcanoes.usgs.gov/software/swarm/download.shtml).
Create a server by providing implementations of the provider, consumer and hooks interfaces and call Start:
server := slgo.New(myProvider, myConsumer, myHooks)
err := server.Start(ctx, "0.0.0.0", 18000, true)myProvidershould implement methods likeGetStations(),GetStreams(),QueryHistory(start,end,channels).myConsumershould implementSubscribe(clientId, channels, handler)andUnsubscribe(clientId).
See the reference implementations in the example directory: example/provider.go and example/consumer.go.
example/— runnable example server, provider and consumer.handlers/— SeedLink protocol handlers and data types.*.go— core implementation and tests.
Contributions, issues and feature requests are welcome. Please open an issue or pull request on the upstream repository.
This project is licensed under the MIT License.
