Skip to content

Commit 6c4ab6a

Browse files
committed
feat: add bandwidth struct
1 parent 7a97622 commit 6c4ab6a

15 files changed

Lines changed: 1732 additions & 0 deletions
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: "[bug]"
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
## Describe the bug
11+
12+
A clear and concise description of what the bug is.
13+
14+
## To Reproduce
15+
16+
> **NOTE**:Self-contained, minimal reproducing samples are extremely helpful and will expedite addressing your issue
17+
18+
Steps to reproduce the behavior:
19+
20+
1. Go to '...'
21+
2. Click on '....'
22+
3. Scroll down to '....'
23+
4. See error
24+
25+
## Expected behavior
26+
27+
A clear and concise description of what you expected to happen.
28+
29+
## Screenshots
30+
31+
If applicable, add screenshots to help explain your problem.
32+
33+
## Environment
34+
<!--- Please provide the necessary environment information -->
35+
36+
- Device: \[e.g. iPhone6]
37+
- OS: \[e.g. Ubuntu 18.04LTS]
38+
- Browser \[e.g. chrome, safari]
39+
- Version \[e.g. 22]
40+
41+
## Additional context
42+
43+
Add any other context about the problem here.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: "[enhancement]"
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
## Is your feature request related to a problem? Please describe
11+
12+
A clear and concise description of what the problem is. Ex. I'm always frustrated when \[...]
13+
14+
## Description of the new feature/enhancement
15+
16+
A clear and concise description of what you want to happen.
17+
18+
## Proposed technical implementation details (optional)
19+
<!--- If you don't have any idea, you can just left a blank section -->
20+
A clear and concise description of any solutions you've considered.
21+
22+
## Additional context
23+
24+
Add any other context or screenshots about the feature request here.

.github/ISSUE_TEMPLATE/question.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
name: Question
3+
about: Ask a question about this project
4+
title: "[question]"
5+
labels: question
6+
assignees: ''
7+
8+
---

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!--- Provide a general summary of your changes in the Title above -->
2+
<!--- Please do remember to follow the contributing guidelines -->
3+
4+
## Description
5+
<!--- Why is this change required: What problem does it solve? -->
6+
<!--- Describe your changes in detail here to communicate to the maintainers why this pull request should be accepted -->
7+
<!--- Describe your technology stack here if not a documentation update -->
8+
<!--- Tasklist format is recommended for all pull requests and is required for all draft pull requests. You can couple your description with the tasklist -->
9+
<!--- If it fixes an open issue, please link to the issue here in the last line. -->
10+
11+
## How Has This Been Tested
12+
<!--- Please describe in detail how you tested your changes locally -->
13+
<!--- Include details of your testing environment, and the tests you ran to -->
14+
<!--- See how your change affects other areas of the code, etc. -->
15+
16+
## Screenshots(optional)
17+
<!--- If Screenshots is not necessary or not available in this pull request, you can delete this section -->
18+
<!--- Changes including html and css are required to have screenshots -->
19+
20+
## Types of changes
21+
<!--- What types of changes does your code introduce? -->
22+
<!--- Only left the line that best describes this pull request -->
23+
<!-- -->
24+
<!-- - Bug fix (non-breaking change which fixes an issue) -->
25+
<!-- - New feature (non-breaking change which adds functionality) -->
26+
<!-- - Documentation (non-breaking change which updates documentation) -->
27+
<!-- - Breaking change (fix or feature that would cause existing functionality to change) -->
28+
<!-- - Code style (formatting, renaming) -->
29+
<!-- - Refactoring (no functional changes, no api changes) -->
30+
<!-- - Other (please describe here): -->
31+
32+
## Checklist
33+
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
34+
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
35+
- [ ] Code follows the code style of this project.
36+
- [ ] Changes follow the **CONTRIBUTING** guidelines.
37+
- [ ] Update necessary documentation accordingly.
38+
- [ ] Lint and tests pass locally with the changes.
39+
- [ ] Check issues and pull requests first. You don't want to duplicate effort.
40+
41+
## Other information

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "cargo" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
reviewers:
11+
- BobAnkh
12+
schedule:
13+
interval: "daily"

.github/workflows/cargo-lint.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: Cargo Lint
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- dev
8+
pull_request:
9+
types: [ready_for_review, opened, synchronize, reopened]
10+
paths:
11+
- '**.rs'
12+
- '**/Cargo.toml'
13+
workflow_dispatch:
14+
15+
jobs:
16+
cargo-check:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v2
22+
23+
- name: Install latest nightly
24+
uses: actions-rs/toolchain@v1
25+
with:
26+
toolchain: stable
27+
override: true
28+
components: rustfmt, clippy
29+
30+
# `cargo check` command here will use installed `nightly`
31+
# as it is set as an "override" for current directory
32+
- name: deal with rust cache
33+
uses: Swatinem/rust-cache@v1
34+
35+
- name: cargo check
36+
run: cargo check --all-targets --workspace
37+
38+
cargo-build:
39+
runs-on: ubuntu-latest
40+
41+
steps:
42+
- name: Checkout
43+
uses: actions/checkout@v2
44+
45+
- name: Install latest nightly
46+
uses: actions-rs/toolchain@v1
47+
with:
48+
toolchain: stable
49+
override: true
50+
components: rustfmt, clippy
51+
52+
# `cargo check` command here will use installed `nightly`
53+
# as it is set as an "override" for current directory
54+
- name: deal with rust cache
55+
uses: Swatinem/rust-cache@v1
56+
57+
- name: cargo build
58+
run: cargo build --workspace
59+
60+
cargo-clippy:
61+
runs-on: ubuntu-latest
62+
63+
steps:
64+
- name: Checkout
65+
uses: actions/checkout@v2
66+
67+
- name: Install latest nightly
68+
uses: actions-rs/toolchain@v1
69+
with:
70+
toolchain: stable
71+
override: true
72+
components: rustfmt, clippy
73+
74+
# `cargo check` command here will use installed `nightly`
75+
# as it is set as an "override" for current directory
76+
- name: deal with rust cache
77+
uses: Swatinem/rust-cache@v1
78+
79+
# temporarily change to a self-maintained workflow
80+
# see https://github.com/actions-rs/clippy-check/pull/158
81+
- name: cargo clippy
82+
uses: BobAnkh/clippy-check@master
83+
with:
84+
token: ${{ secrets.GITHUB_TOKEN }}
85+
args: --all-features --workspace
86+
87+
cargo-fmt:
88+
runs-on: ubuntu-latest
89+
90+
steps:
91+
- name: Checkout
92+
uses: actions/checkout@v2
93+
94+
- name: Install latest nightly
95+
uses: actions-rs/toolchain@v1
96+
with:
97+
toolchain: stable
98+
override: true
99+
components: rustfmt, clippy
100+
101+
# `cargo check` command here will use installed `nightly`
102+
# as it is set as an "override" for current directory
103+
- name: deal with rust cache
104+
uses: Swatinem/rust-cache@v1
105+
106+
- name: cargo fmt
107+
run: cargo fmt --all -- --check

.github/workflows/cargo-test.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Cargo Test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- dev
8+
pull_request:
9+
types: [ready_for_review, opened, synchronize, reopened]
10+
paths:
11+
- '**.rs'
12+
- '**/Cargo.toml'
13+
workflow_dispatch:
14+
15+
jobs:
16+
cargo-test:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v2
22+
23+
- name: Install latest nightly
24+
uses: actions-rs/toolchain@v1
25+
with:
26+
toolchain: stable
27+
override: true
28+
components: rustfmt, clippy
29+
- name: deal with rust cache
30+
uses: Swatinem/rust-cache@v1
31+
- name: cargo test
32+
run: |
33+
cargo test --no-fail-fast --verbose

.github/workflows/changelog.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Generate changelog
2+
on:
3+
release:
4+
types: [created, edited]
5+
push:
6+
branches:
7+
- main
8+
workflow_dispatch:
9+
10+
jobs:
11+
generate-changelog:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
with:
16+
fetch-depth: 0
17+
- uses: BobAnkh/auto-generate-changelog@master
18+
with:
19+
ACCESS_TOKEN: ${{secrets.GITHUB_TOKEN}}
20+
PATH: 'CHANGELOG.md'
21+
COMMIT_MESSAGE: 'docs(changelog): update release notes'
22+
TYPE: 'feat:Feature,fix:Bug Fixes,docs:Documentation,refactor:Refactor,perf:Performance Improvements'
23+
24+
add-contributors:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v2
28+
- uses: BobAnkh/add-contributors@master
29+
with:
30+
CONTRIBUTOR: '### Contributors'
31+
COLUMN_PER_ROW: '6'
32+
ACCESS_TOKEN: ${{secrets.GITHUB_TOKEN}}
33+
IMG_WIDTH: '100'
34+
FONT_SIZE: '14'
35+
PATH: 'README.md'
36+
COMMIT_MESSAGE: 'docs(readme): update contributors'
37+
AVATAR_SHAPE: 'round'

.github/workflows/publish.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Publish to Crates.io
2+
3+
# Controls when the action will run. Workflow runs when manually triggered using the UI
4+
# or API.
5+
on:
6+
release:
7+
types: [created]
8+
workflow_dispatch:
9+
# Inputs the workflow accepts.
10+
inputs:
11+
name:
12+
# Friendly description to be shown in the UI instead of 'name'
13+
description: 'Publish crate'
14+
# Default value if no value is explicitly provided
15+
default: 'bandwidth'
16+
# Input has to be provided for the workflow to run
17+
required: false
18+
19+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
20+
jobs:
21+
publish:
22+
# The type of runner that the job will run on
23+
runs-on: ubuntu-latest
24+
25+
# Steps represent a sequence of tasks that will be executed as part of the job
26+
steps:
27+
- uses: actions/checkout@v2
28+
- uses: actions-rs/toolchain@v1
29+
with:
30+
toolchain: stable
31+
override: true
32+
- uses: katyo/publish-crates@v1
33+
with:
34+
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/target
2+
/Cargo.lock

0 commit comments

Comments
 (0)