Skip to content

Commit c6b661a

Browse files
committed
Initial release v0.1.0
An async NTRIP client library for Rust with v1/v2 protocol support, TLS encryption, sourcetable discovery, and automatic reconnection.
0 parents  commit c6b661a

26 files changed

Lines changed: 3635 additions & 0 deletions

.gitattributes

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Auto-detect text files and normalize line endings
2+
* text=auto
3+
4+
# Rust source files
5+
*.rs text eol=lf
6+
*.toml text eol=lf
7+
8+
# Shell scripts
9+
*.sh text eol=lf
10+
11+
# Documentation
12+
*.md text eol=lf
13+
14+
# Lock file - don't diff
15+
Cargo.lock binary
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
name: Bug Report
3+
about: Report a bug in ntrip-core
4+
title: '[BUG] '
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
## Description
10+
A clear description of the bug.
11+
12+
## To Reproduce
13+
```rust
14+
// Minimal code to reproduce
15+
```
16+
17+
## Expected Behavior
18+
What you expected to happen.
19+
20+
## Actual Behavior
21+
What actually happened.
22+
23+
## Environment
24+
- ntrip-core version:
25+
- Rust version:
26+
- OS:
27+
28+
## Additional Context
29+
Any other relevant information.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: Feature Request
3+
about: Suggest a new feature
4+
title: '[FEATURE] '
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
## Problem
10+
What problem would this feature solve?
11+
12+
## Proposed Solution
13+
How do you think this should work?
14+
15+
## Alternatives Considered
16+
Any alternative solutions you've thought about.
17+
18+
## Additional Context
19+
Any other relevant information.

.github/pull_request_template.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## Description
2+
Brief description of the changes.
3+
4+
## Type of Change
5+
- [ ] Bug fix
6+
- [ ] New feature
7+
- [ ] Documentation update
8+
- [ ] Refactoring
9+
- [ ] Other (please describe)
10+
11+
## Checklist
12+
- [ ] I have run `just check` and all checks pass
13+
- [ ] I have added tests for new functionality
14+
- [ ] I have updated documentation if needed
15+
- [ ] I have updated CHANGELOG.md
16+
17+
## Related Issues
18+
Closes #

.github/workflows/ci.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
RUST_BACKTRACE: 1
12+
13+
jobs:
14+
check:
15+
name: Check
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: dtolnay/rust-toolchain@stable
20+
- uses: Swatinem/rust-cache@v2
21+
- run: cargo check --all-features
22+
23+
test:
24+
name: Test
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: dtolnay/rust-toolchain@stable
29+
- uses: Swatinem/rust-cache@v2
30+
- run: cargo test --all-features
31+
32+
fmt:
33+
name: Format
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v4
37+
- uses: dtolnay/rust-toolchain@stable
38+
with:
39+
components: rustfmt
40+
- run: cargo fmt --all -- --check
41+
42+
clippy:
43+
name: Clippy
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: actions/checkout@v4
47+
- uses: dtolnay/rust-toolchain@stable
48+
with:
49+
components: clippy
50+
- uses: Swatinem/rust-cache@v2
51+
- run: cargo clippy --all-features -- -D warnings
52+
53+
docs:
54+
name: Docs
55+
runs-on: ubuntu-latest
56+
steps:
57+
- uses: actions/checkout@v4
58+
- uses: dtolnay/rust-toolchain@stable
59+
- uses: Swatinem/rust-cache@v2
60+
- run: cargo doc --no-deps --all-features
61+
env:
62+
RUSTDOCFLAGS: -D warnings
63+
64+
# Test on multiple Rust versions
65+
msrv:
66+
name: MSRV (1.75)
67+
runs-on: ubuntu-latest
68+
steps:
69+
- uses: actions/checkout@v4
70+
- uses: dtolnay/rust-toolchain@master
71+
with:
72+
toolchain: "1.75"
73+
- uses: Swatinem/rust-cache@v2
74+
- run: cargo check --all-features
75+
76+
# Code coverage
77+
coverage:
78+
name: Coverage
79+
runs-on: ubuntu-latest
80+
steps:
81+
- uses: actions/checkout@v4
82+
- uses: dtolnay/rust-toolchain@stable
83+
with:
84+
components: llvm-tools-preview
85+
- uses: Swatinem/rust-cache@v2
86+
- uses: taiki-e/install-action@cargo-llvm-cov
87+
- run: cargo llvm-cov --all-features --lcov --output-path lcov.info
88+
- uses: codecov/codecov-action@v4
89+
with:
90+
files: lcov.info
91+
fail_ci_if_error: false

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/target
2+
Cargo.lock
3+
4+
# Credentials (never commit)
5+
scripts/credentials.env

CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
## [0.1.0] - 2025-12-20
11+
12+
### Added
13+
14+
- Initial release of ntrip-core
15+
- NTRIP v1 (ICY) protocol support
16+
- NTRIP v2 (HTTP/1.1 chunked) protocol support
17+
- Auto-detection of protocol version from server response
18+
- TLS/HTTPS support via rustls (no OpenSSL dependency)
19+
- Basic authentication support
20+
- Sourcetable retrieval and parsing
21+
- Nearest mountpoint selection (Haversine distance)
22+
- GGA position reporting with `Ntrip-GGA` header support for v2
23+
- Read timeouts with configurable duration
24+
- Automatic reconnection on disconnect/timeout (configurable)
25+
- Comprehensive error handling
26+
- Examples: connect, sourcetable, nearest
27+
- Integration tests against public casters
28+
- GitHub Actions CI workflow
29+
30+
[Unreleased]: https://github.com/greenforge-labs/ntrip-core/compare/v0.1.0...HEAD
31+
[0.1.0]: https://github.com/greenforge-labs/ntrip-core/releases/tag/v0.1.0

CONTRIBUTING.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Contributing to ntrip-core
2+
3+
Thank you for your interest in contributing to ntrip-core!
4+
5+
## Getting Started
6+
7+
1. Fork the repository
8+
2. Clone your fork: `git clone https://github.com/YOUR_USERNAME/ntrip-core.git`
9+
3. Create a branch: `git checkout -b my-feature`
10+
11+
## Development Setup
12+
13+
We use [Just](https://github.com/casey/just) as a command runner. Install it and run:
14+
15+
```bash
16+
just check # Run all checks (fmt, clippy, test)
17+
just test # Run tests only
18+
just fmt # Format code
19+
just clippy # Run lints
20+
```
21+
22+
## Making Changes
23+
24+
1. **Write tests** for new functionality
25+
2. **Run `just check`** before committing
26+
3. **Update documentation** if you change public APIs
27+
4. **Follow Rust conventions** and existing code style
28+
29+
## Pull Request Process
30+
31+
1. Ensure CI passes
32+
2. Update CHANGELOG.md with your changes
33+
3. Request a review from maintainers
34+
35+
## Testing Against Real Casters
36+
37+
Integration tests are ignored by default. To run them:
38+
39+
```bash
40+
cargo test --test integration -- --ignored
41+
```
42+
43+
**Note:** These require network access and may fail if casters are unavailable.
44+
45+
## Code of Conduct
46+
47+
Be respectful and constructive. We're all here to build great software.
48+
49+
## Questions?
50+
51+
Open an issue or discussion on GitHub.

Cargo.toml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[package]
2+
name = "ntrip-core"
3+
version = "0.1.0"
4+
edition = "2021"
5+
rust-version = "1.75"
6+
authors = ["GreenForge Labs"]
7+
description = "An async NTRIP client library for Rust with v1/v2 protocol support, TLS, and sourcetable discovery"
8+
license = "MIT"
9+
repository = "https://github.com/greenforge-labs/ntrip-core"
10+
keywords = ["ntrip", "gnss", "rtk", "rtcm", "gps"]
11+
categories = ["network-programming", "science::geo"]
12+
readme = "README.md"
13+
14+
[dependencies]
15+
# Async runtime
16+
tokio = { version = "1", features = ["net", "io-util", "time", "sync"] }
17+
18+
# TLS support
19+
tokio-rustls = "0.26"
20+
webpki-roots = "0.26"
21+
rustls-pki-types = "1"
22+
23+
# Utilities
24+
base64 = "0.22"
25+
chrono = { version = "0.4", default-features = false, features = ["std", "clock"] }
26+
thiserror = "1"
27+
tracing = "0.1"
28+
29+
[dev-dependencies]
30+
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
31+
tracing-subscriber = "0.3"
32+
33+
# Note: TLS is always enabled. The tokio-rustls dependency is not optional.
34+
# A future version may make TLS optional via feature flags if there's demand.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 GreenForge Labs
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)