Skip to content

Commit ceae00f

Browse files
committed
Initial commit
0 parents  commit ceae00f

40 files changed

+2883
-0
lines changed

.devcontainer/Dockerfile

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# See here for image contents:
2+
# https://github.com/microsoft/vscode-dev-containers/tree/v0.166.0/containers/go/.devcontainer/base.Dockerfile
3+
4+
# [Choice] Go version (use -bullseye variants on local arm64/Apple Silicon): 1.16, 1.17, 1.16-bullseye, 1.17-bullseye
5+
ARG VARIANT=1.17
6+
FROM mcr.microsoft.com/vscode/devcontainers/go:0-${VARIANT}
7+
8+
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
9+
ARG NODE_VERSION="none"
10+
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
11+
12+
# [Optional] Uncomment this line to install global node packages.
13+
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
14+
15+
# ==== Install additional tools ====
16+
17+
# os packages
18+
RUN \
19+
apt-get update && \
20+
DEBIAN_FRONTEND=noninteractive apt-get -y install \
21+
icu-devtools
22+
23+
# Live share linux requirements
24+
# https://docs.microsoft.com/en-us/visualstudio/liveshare/use/install-live-share-visual-studio-code#install-linux-prerequisites
25+
RUN \
26+
wget -O ~/vsls-reqs https://aka.ms/vsls-linux-prereq-script && chmod +x ~/vsls-reqs && ~/vsls-reqs
27+
28+
# protoc and libraries
29+
ARG PROTOBUF_VERSION="3.19.4"
30+
RUN \
31+
mkdir -p /tmp/protoc && \
32+
curl -sSL \
33+
"https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VERSION}/protoc-${PROTOBUF_VERSION}-linux-x86_64.zip" \
34+
-o /tmp/protoc/protoc.zip && \
35+
cd /tmp/protoc && \
36+
unzip protoc.zip && \
37+
mv /tmp/protoc/include /usr/local/include && \
38+
mv /tmp/protoc/bin/protoc /usr/local/bin/protoc && \
39+
chmod +x /usr/local/bin/protoc && \
40+
rm -rf /tmp/protoc
41+
42+
# protoc plugins
43+
ARG PROTOC_GRPC_GATEWAY="2.7.3"
44+
ARG PROTOC_GEN_GO_GRPC="1.2.0"
45+
ARG PROTOC_GEN_VALIDATE="0.6.3"
46+
ARG PROTOC_GEN_GO="1.27.1"
47+
ARG PROTOC_GEN_DRPC="0.0.29"
48+
ARG PROTOC_GEN_ENT="0.2.0"
49+
RUN \
50+
su vscode -c "go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway@v${PROTOC_GRPC_GATEWAY}" && \
51+
su vscode -c "go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@v${PROTOC_GRPC_GATEWAY}" && \
52+
su vscode -c "go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v${PROTOC_GEN_GO_GRPC}" && \
53+
su vscode -c "go install github.com/envoyproxy/protoc-gen-validate@v${PROTOC_GEN_VALIDATE}" && \
54+
su vscode -c "go install google.golang.org/protobuf/cmd/protoc-gen-go@v${PROTOC_GEN_GO}" && \
55+
su vscode -c "go install storj.io/drpc/cmd/protoc-gen-go-drpc@v${PROTOC_GEN_DRPC}" && \
56+
su vscode -c "go install entgo.io/contrib/entproto/cmd/protoc-gen-ent@v${PROTOC_GEN_ENT}"
57+
58+
# buf
59+
ARG BUF_VERSION="1.1.0"
60+
RUN \
61+
curl -sSL \
62+
"https://github.com/bufbuild/buf/releases/download/v${BUF_VERSION}/buf-$(uname -s)-$(uname -m).tar.gz" | tar -xvzf - -C "/usr/local" --strip-components 1
63+
64+
# grpcurl
65+
ARG GRPCURL_VERSION="1.8.6"
66+
RUN \
67+
curl -sSL "https://github.com/fullstorydev/grpcurl/releases/download/v${GRPCURL_VERSION}/grpcurl_${GRPCURL_VERSION}_linux_x86_64.tar.gz" -o grpcurl.tgz && \
68+
tar -xvzf grpcurl.tgz && \
69+
chmod +x grpcurl && \
70+
mv grpcurl /usr/local/bin/. && \
71+
rm LICENSE grpcurl.tgz
72+
73+
# ghz
74+
ARG GHZ_VERSION="0.106.1"
75+
RUN \
76+
curl -sSL https://github.com/bojand/ghz/releases/download/v${GHZ_VERSION}/ghz-linux-x86_64.tar.gz -o ghz.tgz && \
77+
tar -xvzf ghz.tgz && \
78+
rm LICENSE ghz.tgz && \
79+
chmod +x ghz* && \
80+
mv ghz* /usr/local/bin/.
81+
82+
# helm
83+
ARG HELM_VERSION="3.8.0"
84+
RUN \
85+
# helm
86+
curl -sSL https://get.helm.sh/helm-v${HELM_VERSION}-linux-amd64.tar.gz -o helm.tgz && \
87+
tar -xvzf helm.tgz && \
88+
mv linux-amd64/helm /usr/local/bin/. && \
89+
rm -rf linux-amd64 helm.tgz
90+
91+
# kubectl
92+
ARG KUBECTL_VERSION="1.23.4"
93+
RUN \
94+
# kubectl
95+
curl -sSL https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl -o kubectl && \
96+
chmod +x kubectl && \
97+
mv kubectl /usr/local/bin/.
98+
99+
# additional tools
100+
ARG NANCY_VERSION="1.0.30"
101+
ARG GQLGEN_VERSION="0.16.0"
102+
RUN \
103+
# goimports
104+
su vscode -c "go get golang.org/x/tools/cmd/goimports" && \
105+
# nancy
106+
curl -sSL https://github.com/sonatype-nexus-community/nancy/releases/download/v${NANCY_VERSION}/nancy-v${NANCY_VERSION}-linux-amd64 -o /usr/local/bin/nancy && \
107+
chmod +x /usr/local/bin/nancy && \
108+
# gqlgen
109+
su vscode -c "go install github.com/99designs/gqlgen@v${GQLGEN_VERSION}"

.devcontainer/devcontainer.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"name": "Go 1.17",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"args": {
6+
// Update the VARIANT arg to pick a version of Go: 1.16, 1.17
7+
// Append -bullseye or -buster to pin to an OS version.
8+
// Use -bullseye variants on local arm64/Apple Silicon.
9+
"VARIANT": "1.17",
10+
"NODE_VERSION": "none"
11+
}
12+
},
13+
"runArgs": [
14+
"--cap-add=SYS_PTRACE",
15+
"--security-opt",
16+
"seccomp=unconfined"
17+
],
18+
"postCreateCommand": "./.devcontainer/post-create.sh",
19+
"remoteUser": "vscode",
20+
"settings": {
21+
"terminal.integrated.profiles.linux": {
22+
"default-shell": {
23+
"path": "/bin/zsh"
24+
}
25+
},
26+
"terminal.integrated.defaultProfile.linux": "default-shell",
27+
"workbench.iconTheme" : "eq-material-theme-icons-light",
28+
"go.toolsManagement.checkForUpdates": "local",
29+
"go.useLanguageServer": true,
30+
"go.gopath": "/go",
31+
"go.goroot": "/usr/local/go",
32+
"protoc" : {
33+
"options" : [
34+
"--proto_path=${workspaceRoot}\/proto"
35+
]
36+
}
37+
},
38+
"extensions": [
39+
// Custom fileicons theme
40+
// "equinusocio.vsc-material-theme-icons",
41+
// GoLang support
42+
"golang.Go",
43+
// API client tools (similar to Postman)
44+
"rangav.vscode-thunder-client",
45+
// Protobuf support
46+
"zxh404.vscode-proto3",
47+
// Task explorer panel
48+
"spmeesseman.vscode-taskexplorer",
49+
// Live share for remote collaboration
50+
"ms-vsliveshare.vsliveshare",
51+
// Live share extension pack; for audio call capabilities
52+
"ms-vsliveshare.vsliveshare-pack"
53+
],
54+
"forwardPorts": []
55+
}

.devcontainer/post-create.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
# This file is executed after the dev container is created.
3+
# Add any additional setup steps here.
4+
go version

.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.git
2+
.cache
3+
vendor
4+

.exclude-secrets-scan.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Exclude elements from secret scanning.
2+
# More information: https://github.com/trufflesecurity/truffleHog
3+
4+
# ignore module hashes
5+
go.sum
6+
7+
# ignore documentation files
8+
.*\.md$
9+
(.*/)doc.go$
10+
11+
# ignore test files and related assets
12+
.*\_test.go$
13+
(.*/)testdata(.*/)
14+
15+
# ignore CI/CD workflow assets
16+
.github/workflows/assets

.github/CODE_OF_CONDUCT.md

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, religion, or sexual identity
10+
and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
* Demonstrating empathy and kindness toward other people
21+
* Being respectful of differing opinions, viewpoints, and experiences
22+
* Giving and gracefully accepting constructive feedback
23+
* Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
* Focusing on what is best not just for us as individuals, but for the
26+
overall community
27+
28+
Examples of unacceptable behavior include:
29+
30+
* The use of sexualized language or imagery, and sexual attention or
31+
advances of any kind
32+
* Trolling, insulting or derogatory comments, and personal or political attacks
33+
* Public or private harassment
34+
* Publishing others' private information, such as a physical or email
35+
address, without their explicit permission
36+
* Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official e-mail address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement at
63+
[info@bryk.io](mailto:info@bryk.io?subject=[GitHub]%20CoC%20Report).
64+
All complaints will be reviewed and investigated promptly and fairly.
65+
66+
All community leaders are obligated to respect the privacy and security of the
67+
reporter of any incident.
68+
69+
## Enforcement Guidelines
70+
71+
Community leaders will follow these Community Impact Guidelines in determining
72+
the consequences for any action they deem in violation of this Code of Conduct:
73+
74+
### 1. Correction
75+
76+
**Community Impact**: Use of inappropriate language or other behavior deemed
77+
unprofessional or unwelcome in the community.
78+
79+
**Consequence**: A private, written warning from community leaders, providing
80+
clarity around the nature of the violation and an explanation of why the
81+
behavior was inappropriate. A public apology may be requested.
82+
83+
### 2. Warning
84+
85+
**Community Impact**: A violation through a single incident or series
86+
of actions.
87+
88+
**Consequence**: A warning with consequences for continued behavior. No
89+
interaction with the people involved, including unsolicited interaction with
90+
those enforcing the Code of Conduct, for a specified period of time. This
91+
includes avoiding interactions in community spaces as well as external channels
92+
like social media. Violating these terms may lead to a temporary or
93+
permanent ban.
94+
95+
### 3. Temporary Ban
96+
97+
**Community Impact**: A serious violation of community standards, including
98+
sustained inappropriate behavior.
99+
100+
**Consequence**: A temporary ban from any sort of interaction or public
101+
communication with the community for a specified period of time. No public or
102+
private interaction with the people involved, including unsolicited interaction
103+
with those enforcing the Code of Conduct, is allowed during this period.
104+
Violating these terms may lead to a permanent ban.
105+
106+
### 4. Permanent Ban
107+
108+
**Community Impact**: Demonstrating a pattern of violation of community
109+
standards, including sustained inappropriate behavior, harassment of an
110+
individual, or aggression toward or disparagement of classes of individuals.
111+
112+
**Consequence**: A permanent ban from any sort of public interaction within
113+
the community.
114+
115+
## Attribution
116+
117+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org),
118+
version 2.0, available at <https://www.contributor-covenant.org/version/2/0/code_of_conduct.html>.
119+
120+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
121+
enforcement ladder](https://github.com/mozilla/diversity).

.github/CONTRIBUTING.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Contributing
2+
3+
A big welcome and thank you for considering contributing to this project!
4+
It’s people like you that make it a reality for users in our community.
5+
6+
Reading and following these guidelines will help us make the contribution
7+
process easy and effective for everyone involved. It also communicates that
8+
you agree to respect the time of the developers managing and developing
9+
these projects. In return, we will reciprocate that respect by addressing
10+
your issue, assessing changes, and helping you finalize your pull requests.
11+
12+
## Code of Conduct
13+
14+
We take our community seriously and hold ourselves and other contributors
15+
to high standards of communication. By participating and contributing to
16+
this project, you agree to uphold our [Code of Conduct](./CODE_OF_CONDUCT.md).
17+
18+
## Getting Started
19+
20+
Contributions are made to this repo via Issues and Pull Requests (PRs).
21+
A few general guidelines that cover both:
22+
23+
- To report security vulnerabilities, please use our [Responsible Disclosure Program](./SECURITY.md)
24+
which is monitored by our security team.
25+
- Search for existing Issues and PRs before creating your own.
26+
- We work hard to makes sure issues are handled in a timely manner but,
27+
depending on the impact, it could take a while to investigate the root cause.
28+
A friendly ping in the comment thread to the submitter or a contributor can
29+
help draw attention if your issue is blocking.
30+
31+
## Issues
32+
33+
Issues should be used to report problems with the project, request a new
34+
feature, or to discuss potential changes before a PR is created. When you
35+
create a new Issue, a template will be loaded that will guide you through
36+
collecting and providing the information we need to investigate and evaluate
37+
you request.
38+
39+
If you find an Issue that addresses the problem you're having, please add
40+
your own reproduction information to the existing issue rather than creating
41+
a new one. Adding a [reaction](https://github.blog/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/)
42+
can also help by indicating to our maintainers that a particular problem is affecting
43+
more than just the reporter.
44+
45+
## Pull Requests
46+
47+
PRs to our projects are always welcome and can be a quick way to get your
48+
fix or improvement slated for the next release. In general, PRs should:
49+
50+
- Only fix a known issue **OR** add the functionality in question, not both.
51+
- Add unit or integration tests for fixed or changed functionality.
52+
- Address a single concern in the least number of changed lines as possible.
53+
- Include any required and relevant documentation.
54+
- Be accompanied by a complete Pull Request template (loaded automatically
55+
when a PR is created).
56+
57+
For changes that address core functionality or would require breaking changes
58+
(e.g. a major release), it's best to open an Issue to discuss your proposal first.
59+
60+
In general, we follow the ["fork-and-pull" Git workflow](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork)
61+
62+
1. Fork the repository to your own Github account.
63+
2. Clone the project to your machine.
64+
3. Create a branch locally with a succinct but descriptive name.
65+
4. Commit changes to the branch.
66+
5. Following any formatting and testing guidelines specific to this repo.
67+
6. Push changes to your fork.
68+
7. Open a PR in our repository and follow the PR template so that we can efficiently
69+
review the changes.
70+
71+
## Getting Help
72+
73+
Join us in the **Discussions** section of this repository and post your question
74+
there in the correct category with a descriptive tag.

0 commit comments

Comments
 (0)