Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
vifer committed May 7, 2024
0 parents commit e98d5cb
Show file tree
Hide file tree
Showing 72 changed files with 11,951 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @PaddleHQ/developer-experience
45 changes: 45 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Bug report
description: Report a problem.
title: "[Bug]: "
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
Use this form to report a bug or problem with the Paddle Go SDK.
Remember to remove sensitive information from screenshots, videos, or code samples before submitting.
**Do not create issues for potential security vulnerabilities.** Please see the [Paddle Vulnerability Disclosure Policy](https://www.paddle.com/vulnerability-disclosure-policy) and report any vulnerabilities [using our form](https://vdp.paddle.com/p/Report-a-Vulnerability).
Thanks for helping to make the Paddle platform better for everyone!
- type: textarea
id: description
attributes:
label: What happened?
description: Describe the bug in a sentence or two. Feel free to add screenshots or a video to better explain!
validations:
required: true
- type: textarea
id: reproduce
attributes:
label: Steps to reproduce
description: Explain how to reproduce this issue. We prefer a step-by-step walkthrough, where possible.
value: |
1.
2.
3.
...
validations:
required: true
- type: textarea
id: expected-behavior
attributes:
label: What did you expect to happen?
description: Tell us what should happen when you encounter this bug.
- type: textarea
id: logs
attributes:
label: Logs
description: Copy and paste any relevant logs. This is automatically formatted into code, so no need for backticks.
render: shell
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Get help
url: https://developer.paddle.com/
about: For help with the Paddle Go SDK or building your integration, contact our support team at [[email protected]](mailto:[email protected]).
- name: Report a vulnerability
url: https://vdp.paddle.com/p/Report-a-Vulnerability
about: Please see the [Paddle Vulnerability Disclosure Policy](https://www.paddle.com/vulnerability-disclosure-policy) and report any vulnerabilities using https://vdp.paddle.com/p/Report-a-Vulnerability.
44 changes: 44 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Feature request
description: Suggest an idea.
title: "[Feature]: "
labels: ["feature"]
body:
- type: markdown
attributes:
value: |
Use this form to send us suggestions for improvements to the Paddle Go SDK.
For general feedback about the Paddle API or developer platform, contact our DX team directly
at [[email protected]](mailto:[email protected]).
Thanks for helping to make the Paddle platform better for everyone!
- type: textarea
id: request
attributes:
label: Tell us about your feature request
description: Describe what you'd like to see added or improved.
validations:
required: true
- type: textarea
id: problem
attributes:
label: What problem are you looking to solve?
description: Tell us how and why would implementing your suggestion would help.
validations:
required: true
- type: textarea
id: additional-information
attributes:
label: Additional context
description: Add any other context, screenshots, or illustrations about your suggestion here.
- type: dropdown
id: priority
attributes:
label: How important is this suggestion to you?
options:
- Nice to have
- Important
- Critical
default: 0
validations:
required: true
22 changes: 22 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: /
schedule:
interval: "weekly"
day: "wednesday"
time: "03:00"
labels:
- "release:patch"
groups:
go.mod:
patterns:
- "*"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "wednesday"
time: "03:00"
labels:
- "release:none"
20 changes: 20 additions & 0 deletions .github/workflows/check-semver.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Label Checker

on:
pull_request:
types:
- opened
- synchronize
- reopened
- labeled
- unlabeled

jobs:
check_labels:
name: Check labels
runs-on: ubuntu-latest
steps:
- uses: docker://agilepathway/pull-request-label-checker:v1.6.13
with:
one_of: norelease,release:major,release:minor,release:patch
repo_token: ${{ secrets.GITHUB_TOKEN }}
49 changes: 49 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: go

on:
- push

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'

- name: Install dependencies
run: go mod download

- name: Verify dependencies
run: go mod verify

- name: Build
run: go build -v ./...

- name: Go Format
run: gofmt -s -w . && git diff --exit-code

- name: Go Generate
run: go generate ./... && git diff --exit-code

- name: Install `govulncheck`
run: go install golang.org/x/vuln/cmd/govulncheck@latest

- name: Run `govulncheck`
run: govulncheck ./...

- name: Vet
run: go vet ./...

- name: Test
run: go test ./... -v -coverprofile=./cover.out -covermode atomic -coverpkg ./... -race

- name: Check coverage
uses: vladopajic/go-test-coverage@v2
with:
profile: cover.out
threshold-total: 30
27 changes: 27 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Linting

on:
pull_request:
push:
branches:
- master

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4

- name: golangci-lint
uses: reviewdog/action-golangci-lint@v2
with:
reporter: github-pr-review
fail_on_error: true
filter_mode: nofilter

- name: eclint
uses: reviewdog/action-eclint@v1
with:
github_token: ${{ secrets.github_token }}
17 changes: 17 additions & 0 deletions .github/workflows/release-on-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Release on Push

on:
push:
branches:
- main

jobs:
release_on_push:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: rymndhng/[email protected]
with:
bump_version_scheme: norelease
use_github_release_notes: true
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.DS_Store
.env
*.test
*.coverprofile
/.idea
136 changes: 136 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
run:
tests: false
issues:
exclude-use-default: false

# Override the defaults for each linter specified.
linters-settings:
gocritic:
# https://golangci-lint.run/usage/linters/#gocritic
enabled-tags:
- diagnostic
- opinionated
- performance
- style
disabled-checks:
# causes a crash with some libraries
- hugeParam
# causes a crash with some libraries
- paramTypeCombine
exhaustive:
default-signifies-exhaustive: true
lll:
line-length: 140
# misspell is not enabled by default, but can be for specific projects with --enable "misspell"
misspell:
locale: US
ignore-words:
- localised
- catalogue
godot:
exclude:
- "@(Given|When|Then|And|But) (.*)" # go-relish uses comments to auto-generate code, these lines should not end with a `.`
gci:
custom-order: true
sections:
- standard
- prefix(github.com/PaddleHQ/paddle-go-sdk)
- prefix(github.com/PaddleHQ)
- default
wsl:
allow-assign-and-call: false
force-case-trailing-whitespace: 0
force-err-cuddling: true
allow-cuddle-with-calls: ["Lock", "RLock"]
allow-cuddle-with-rhs: ["Unlock", "RUnlock"]
error-variable-names: ["err"]

linters:
disable-all: true
enable:
# Checks for unclosed HTTP response body: https://github.com/timakin/bodyclose
- bodyclose
# Checks for struct contained context.Context field: https://github.com/sivchari/containedctx
- containedctx
# Checks function and package cyclomatic complexity: https://github.com/bkielbasa/cyclop
- cyclop
# Checks for assignments with too many blank identifiers (e.g. x, , , _, := f()): https://github.com/alexkohler/dogsled
- dogsled
# Checks for two durations multiplied together: https://github.com/charithe/durationcheck
- durationcheck
# Checks for unchecked errors: https://github.com/kisielk/errcheck
- errcheck
# Checks for pointers to enclosing loop variables: https://github.com/kyoh86/exportloopref
- exportloopref
# Checks that sentinel errors are prefixed with the `Err` and error types are suffixed with the `Error`: https://github.com/Antonboom/errname
- errname
# Check exhaustiveness of enum switch statements: https://github.com/nishanths/exhaustive
- exhaustive
# Checks for forced type assertions: https://github.com/gostaticanalysis/forcetypeassert
- forcetypeassert
# Checks for long functions: https://github.com/ultraware/funlen
- funlen
# Check the errors handling expressions: https://github.com/Djarvur/go-err113
- goerr113
# Checks the cognitive complexity of functions: https://github.com/uudashr/gocognit
- gocognit
# Checks for repeated strings that could be replaced by a constant: https://github.com/jgautheron/goconst
- goconst
# Checks for bugs, performance and style issues: https://github.com/go-critic/go-critic
- gocritic
# Checks the cyclomatic complexity of functions: https://github.com/fzipp/gocyclo
- gocyclo
# Checks if comments end in a period: https://github.com/tetafro/godot
- godot
# Checks whether code was gofumpt-ed: https://github.com/mvdan/gofumpt
- gofumpt
# Checks for security problems: https://github.com/securego/gosec
- gosec
# Checks if code could be simplified: https://github.com/dominikh/go-tools/tree/master/simple
- gosimple
# Checks for suspicious constructs, such as Printf calls whose arguments do not align with the format string: https://golang.org/cmd/vet/
- govet
# Checks for import ordering
- gci
# Checks for assignments to existing variables are unused: https://github.com/gordonklaus/ineffassign
- ineffassign
# Checks for long lines: https://golangci-lint.run/usage/linters/#lll
- lll
# Checks for slice declarations with non-zero initial length: https://github.com/ashanbrown/makezero
- makezero
# Checks for incorrect spellings: https://github.com/client9/misspell:
- misspell
# Checks for code that returns nil even if it checks that the error is not nil: https://github.com/gostaticanalysis/nilerr
- nilerr
# Checks for deeply nested if statements: https://github.com/nakabonne/nestif
- nestif
# Checks for sending http request without context.Context: https://github.com/sonatard/noctx
- noctx
# Checks for slice declarations that could potentially be pre-allocated: https://github.com/alexkohler/prealloc
- prealloc
# Checks for code that shadows one of Go's predeclared identifiers: https://github.com/nishanths/predeclared
- predeclared
# Fast, configurable, extensible, flexible, and beautiful linter for Go: https://github.com/mgechev/revive
- revive
# Checks for whether Err of rows is checked successfully: https://github.com/jingyugao/rowserrcheck
- rowserrcheck
# https://staticcheck.io/
- staticcheck
# a replacement for golint: https://github.com/dominikh/go-tools/tree/master/stylecheck
- stylecheck
# Checks that sql.Rows and sql.Stmt are closed: https://github.com/ryanrolds/sqlclosecheck
- sqlclosecheck
# linter that makes you use a separate _test package: https://github.com/maratori/testpackage
- testpackage
# Checks for unnecessary type conversions: https://github.com/mdempsky/unconvert
- unconvert
# Checks for unused function parameters: https://github.com/mvdan/unparam
- unparam
# Checks for unused constants, variables, functions and types: https://github.com/dominikh/go-tools/tree/master/unused
- unused
# Checks for wasted assignment statements: https://github.com/sanposhiho/wastedassign
- wastedassign
# Checks for detection of leading and trailing whitespace: https://github.com/ultraware/whitespace
- whitespace
# Whitespace Linter - Forces you to use empty lines!
- wsl
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

Check our main [developer changelog](https://developer.paddle.com/?utm_source=dx&utm_medium=paddle-go-sdk) for information about changes to the Paddle Billing platform, the Paddle API, and other developer tools.

## 0.1.0 - 2024-05-07

### Added

- Initial early access release. Added support for the most frequently used Paddle Billing entities and API operations. Check the [README](./README.md) for more information.
Loading

0 comments on commit e98d5cb

Please sign in to comment.