Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix documentation links and automate with lychee #392

Merged
merged 7 commits into from
Sep 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/documentation-links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: "Check docs links"

on:
workflow_dispatch:
push:
branches:
- master
paths:
- "docs/**"
- ".github/workflows/documentation-links.yml"
pull_request:
paths:
- "docs/**"
- ".github/workflows/documentation-links.yml"

jobs:
linkChecker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332

- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@2b973e86fc7b1f6b36a93795fe2c9c6ae1118621

- name: Create Issue From File
if: env.lychee_exit_code != 0
uses: peter-evans/create-issue-from-file@24452a72d85239eacf1468b0f1982a9f3fec4c94
with:
title: Link Checker Report
content-filepath: ./lychee/out.md
labels: |
report
automated-issue
help-wanted
assignees: VictorAvelar
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
fetch-depth: '0'
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32
with:
go-version: 1.22.X
go-version: 1.23.X
- uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86
with:
version: latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
contents: read
strategy:
matrix:
go: [1.20.x, 1.21.x, 1.22.x]
go: [1.20.x, 1.21.x, 1.22.x, 1.23.x]
name: Go ${{ matrix.go }} check
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32
with:
go-version: 1.22.x
go-version: 1.23.x
- uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200
with:
distribution: goreleaser
Expand Down
1 change: 1 addition & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ declared inside the `.github/workflows/main.yml` file.
| 1.20.x | :white_check_mark: |
| 1.21.x | :white_check_mark: |
| 1.22.x | :white_check_mark: |
| 1.23.x | :white_check_mark: |
| master | :x: |

## Reporting a Vulnerability
Expand Down
194 changes: 97 additions & 97 deletions docs/README.md

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions lychee.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
exclude_path = [".github", ".devcontainer", "wiki", "mollie", "testdata"]
exclude = ['^https://github\.com']
cache = true
max_redirects = 3
require_https = true
timeout = 10
retry_wait_time = 15
verbose = "error"
no_progress = true
16 changes: 8 additions & 8 deletions mollie/balances.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,20 +219,20 @@ type ListBalanceTransactionsOptions struct {
//
// Works with Organization access tokens and App access tokens.
//
// See: https://docs.mollie.com/reference/v2/balances-api/overview
// See: https://docs.mollie.com/reference/balances-api
type BalancesService service

// GetBalance retrieves a balance by its id.
//
// See: https://docs.mollie.com/reference/v2/balances-api/get-balance
// See: https://docs.mollie.com/reference/get-balance
func (bs *BalancesService) Get(ctx context.Context, balance string) (res *Response, b *Balance, err error) {
return bs.get(ctx, balance)
}

// Primary retrieves the primary balance. This is the balance of your account’s
// primary currency, where all payments are settled to by default.
//
// See: https://docs.mollie.com/reference/v2/balances-api/get-primary-balance
// See: https://docs.mollie.com/reference/get-primary-balance
func (bs *BalancesService) Primary(ctx context.Context) (res *Response, b *Balance, err error) {
const id = "primary"

Expand All @@ -242,7 +242,7 @@ func (bs *BalancesService) Primary(ctx context.Context) (res *Response, b *Balan
// List retrieves all the organization’s balances, including the primary
// balance, ordered from newest to oldest.
//
// See: https://docs.mollie.com/reference/v2/balances-api/list-balances
// See: https://docs.mollie.com/reference/list-balances
func (bs *BalancesService) List(ctx context.Context, options *ListBalancesOptions) (
res *Response,
bl *BalancesList,
Expand All @@ -253,7 +253,7 @@ func (bs *BalancesService) List(ctx context.Context, options *ListBalancesOption

// GetReport returns the balance report for the specified balance id.
//
// See: https://docs.mollie.com/reference/v2/balances-api/get-balance-report
// See: https://docs.mollie.com/reference/get-balance-report
func (bs *BalancesService) GetReport(ctx context.Context, balance string, options *BalanceReportOptions) (
res *Response,
br *BalanceReport,
Expand All @@ -264,7 +264,7 @@ func (bs *BalancesService) GetReport(ctx context.Context, balance string, option

// GetPrimaryReport returns the report for the primary balance.
//
// See: https://docs.mollie.com/reference/v2/balances-api/get-primary-balance-report
// See: https://docs.mollie.com/reference/get-primary-balance-report
func (bs *BalancesService) GetPrimaryReport(ctx context.Context, options *BalanceReportOptions) (
res *Response,
br *BalanceReport,
Expand All @@ -276,7 +276,7 @@ func (bs *BalancesService) GetPrimaryReport(ctx context.Context, options *Balanc
// GetTransactionsList retrieves a list of movements (transactions) for the
// specified balance.
//
// See: https://docs.mollie.com/reference/v2/balances-api/list-balance-transactions
// See: https://docs.mollie.com/reference/list-balance-transactions
func (bs *BalancesService) GetTransactionsList(
ctx context.Context,
balance string,
Expand All @@ -292,7 +292,7 @@ func (bs *BalancesService) GetTransactionsList(
// GetPrimaryTransactionsList retrieves the list of movements (transactions) for the
// primary balance of the account.
//
// See: https://docs.mollie.com/reference/v2/balances-api/list-primary-balance-transactions
// See: https://docs.mollie.com/reference/list-primary-balance-transactions
func (bs *BalancesService) GetPrimaryTransactionsList(ctx context.Context, options *ListBalanceTransactionsOptions) (
res *Response,
btl *BalanceTransactionsList,
Expand Down
8 changes: 4 additions & 4 deletions mollie/captures.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ type CaptureLinks struct {

// CaptureOptions describes the query params available to use when retrieving captures.
//
// See: https://docs.mollie.com/reference/v2/captures-api/get-capture#embedding-of-related-resources
// See: https://docs.mollie.com/reference/get-capture#embedding-of-related-resources
type CaptureOptions struct {
Embed []EmbedValue `url:"embed,omitempty"`
}
Expand All @@ -88,7 +88,7 @@ type CapturesService service
// Get retrieves a single capture by its ID.
// Note the original payment’s ID is needed as well.
//
// See: https://docs.mollie.com/reference/v2/captures-api/get-capture
// See: https://docs.mollie.com/reference/get-capture
func (cs *CapturesService) Get(ctx context.Context, payment, capture string, options *CaptureOptions) (
res *Response,
c *Capture,
Expand All @@ -110,7 +110,7 @@ func (cs *CapturesService) Get(ctx context.Context, payment, capture string, opt

// Create creates a new capture for a payment.
//
// See: https://docs.mollie.com/reference/v2/captures-api/create-capture
// See: https://docs.mollie.com/reference/create-capture
func (cs *CapturesService) Create(ctx context.Context, payment string, capture CreateCapture) (
res *Response,
c *Capture,
Expand All @@ -136,7 +136,7 @@ func (cs *CapturesService) Create(ctx context.Context, payment string, capture C

// List retrieves all captures for a certain payment.
//
// See: https://docs.mollie.com/reference/v2/captures-api/list-captures
// See: https://docs.mollie.com/reference/list-captures
func (cs *CapturesService) List(ctx context.Context, payment string, options *CaptureOptions) (
res *Response,
cl *CapturesList,
Expand Down
6 changes: 3 additions & 3 deletions mollie/chargebacks.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ type ChargebacksService service
// Get retrieves a single chargeback by its ID.
// Note the original payment’s ID is needed as well.
//
// See: https://docs.mollie.com/reference/v2/chargebacks-api/get-chargeback
// See: https://docs.mollie.com/reference/get-chargeback
func (cs *ChargebacksService) Get(ctx context.Context, payment, chargeback string, opts *ChargebackOptions) (
res *Response,
p *Chargeback,
Expand All @@ -94,7 +94,7 @@ func (cs *ChargebacksService) Get(ctx context.Context, payment, chargeback strin

// List retrieves a list of chargebacks associated with your account/organization.
//
// See: https://docs.mollie.com/reference/v2/chargebacks-api/list-chargebacks
// See: https://docs.mollie.com/reference/list-chargebacks
func (cs *ChargebacksService) List(ctx context.Context, options *ListChargebacksOptions) (
res *Response,
cl *ChargebacksList,
Expand All @@ -105,7 +105,7 @@ func (cs *ChargebacksService) List(ctx context.Context, options *ListChargebacks

// ListForPayment retrieves a list of chargebacks associated with a single payment.
//
// See: https://docs.mollie.com/reference/v2/chargebacks-api/list-chargebacks
// See: https://docs.mollie.com/reference/list-chargebacks
func (cs *ChargebacksService) ListForPayment(ctx context.Context, payment string, options *ListChargebacksOptions) (
res *Response,
cl *ChargebacksList,
Expand Down
2 changes: 1 addition & 1 deletion mollie/client_links.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type ClientLinksService service

// Create a client link based on the provided CreateClientLink values.
//
// See: https://docs.mollie.com/reference/v2/client-links-api/create-client-link
// See: https://docs.mollie.com/reference/create-client-link
func (cls *ClientLinksService) Create(ctx context.Context, cd CreateClientLink) (
res *Response,
cl *ClientLink,
Expand Down
4 changes: 2 additions & 2 deletions mollie/clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type ClientsService service

// List retrieves all clients.
//
// See: https://docs.mollie.com/reference/v2/partners-api/list-clients
// See: https://docs.mollie.com/reference/list-clients
func (ps *ClientsService) List(ctx context.Context, opts *ListLinkedClientsOptions) (
res *Response,
pc *LinkedClientList,
Expand All @@ -69,7 +69,7 @@ func (ps *ClientsService) List(ctx context.Context, opts *ListLinkedClientsOptio

// Get retrieves a single client, linked to your partner account, by its ID.
//
// See: https://docs.mollie.com/reference/v2/partners-api/get-client
// See: https://docs.mollie.com/reference/get-client
func (ps *ClientsService) Get(ctx context.Context, id string, opts *GetLinkedClientOptions) (
res *Response,
pc *LinkedClient,
Expand Down
14 changes: 7 additions & 7 deletions mollie/customers.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ type CustomersService service

// Get finds a customer by its ID.
//
// See: https://docs.mollie.com/reference/v2/customers-api/get-customer
// See: https://docs.mollie.com/reference/get-customer
func (cs *CustomersService) Get(ctx context.Context, id string) (res *Response, c *Customer, err error) {
u := fmt.Sprintf("v2/customers/%s", id)

Expand All @@ -89,7 +89,7 @@ func (cs *CustomersService) Get(ctx context.Context, id string) (res *Response,
// Create creates a simple minimal representation of a customer in the Mollie API
// to use for the Mollie Checkout and Recurring features.
//
// See: https://docs.mollie.com/reference/v2/customers-api/create-customer
// See: https://docs.mollie.com/reference/create-customer
func (cs *CustomersService) Create(ctx context.Context, c CreateCustomer) (res *Response, cc *Customer, err error) {
res, err = cs.client.post(ctx, "v2/customers", c, nil)
if err != nil {
Expand All @@ -105,7 +105,7 @@ func (cs *CustomersService) Create(ctx context.Context, c CreateCustomer) (res *

// Update an existing customer.
//
// See: https://docs.mollie.com/reference/v2/customers-api/update-customer
// See: https://docs.mollie.com/reference/update-customer
func (cs *CustomersService) Update(ctx context.Context, id string, c UpdateCustomer) (
res *Response,
cc *Customer,
Expand All @@ -129,7 +129,7 @@ func (cs *CustomersService) Update(ctx context.Context, id string, c UpdateCusto
//
// All mandates and subscriptions created for this customer will be canceled as well.
//
// See: https://docs.mollie.com/reference/v2/customers-api/delete-customer
// See: https://docs.mollie.com/reference/delete-customer
func (cs *CustomersService) Delete(ctx context.Context, id string) (res *Response, err error) {
u := fmt.Sprintf("v2/customers/%s", id)

Expand All @@ -143,7 +143,7 @@ func (cs *CustomersService) Delete(ctx context.Context, id string) (res *Respons

// List retrieves all customers created.
//
// See: https://docs.mollie.com/reference/v2/customers-api/list-customers
// See: https://docs.mollie.com/reference/list-customers
func (cs *CustomersService) List(ctx context.Context, options *ListCustomersOptions) (
res *Response,
cl *CustomersList,
Expand All @@ -163,7 +163,7 @@ func (cs *CustomersService) List(ctx context.Context, options *ListCustomersOpti

// GetPayments retrieves all payments linked to the customer.
//
// See: https://docs.mollie.com/reference/v2/customers-api/list-customer-payments
// See: https://docs.mollie.com/reference/list-customer-payments
func (cs *CustomersService) GetPayments(ctx context.Context, id string, options *ListCustomersOptions) (
res *Response,
pl *PaymentList,
Expand All @@ -185,7 +185,7 @@ func (cs *CustomersService) GetPayments(ctx context.Context, id string, options

// CreatePayment creates a payment for the customer.
//
// See: https://docs.mollie.com/reference/v2/customers-api/create-customer-payment
// See: https://docs.mollie.com/reference/create-customer-payment
func (cs *CustomersService) CreatePayment(ctx context.Context, id string, p CreatePayment) (
res *Response,
pp *Payment,
Expand Down
8 changes: 4 additions & 4 deletions mollie/mandates.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ type MandatesList struct {
//
// Mandates allow you to charge a customer’s credit card or bank account recurrently.
//
// See: https://docs.mollie.com/reference/v2/mandates-api/create-mandate
// See: https://docs.mollie.com/reference/create-mandate
func (ms *MandatesService) Create(ctx context.Context, customer string, mandate CreateMandate) (
res *Response,
mr *Mandate,
Expand Down Expand Up @@ -145,7 +145,7 @@ func (ms *MandatesService) Create(ctx context.Context, customer string, mandate
// The mandate will either contain IBAN or credit card details,
// depending on the type of mandate.
//
// See: https://docs.mollie.com/reference/v2/mandates-api/get-mandate
// See: https://docs.mollie.com/reference/get-mandate
func (ms *MandatesService) Get(ctx context.Context, customer, mandate string) (res *Response, mr *Mandate, err error) {
u := fmt.Sprintf("v2/customers/%s/mandates/%s", customer, mandate)

Expand All @@ -166,7 +166,7 @@ func (ms *MandatesService) Get(ctx context.Context, customer, mandate string) (r
// You will no longer be able to charge the consumer’s bank account
// or credit card with this mandate and all connected subscriptions will be canceled.
//
// See: https://docs.mollie.com/reference/v2/mandates-api/revoke-mandate
// See: https://docs.mollie.com/reference/revoke-mandate
func (ms *MandatesService) Revoke(ctx context.Context, customer, mandate string) (res *Response, err error) {
u := fmt.Sprintf("v2/customers/%s/mandates/%s", customer, mandate)

Expand All @@ -181,7 +181,7 @@ func (ms *MandatesService) Revoke(ctx context.Context, customer, mandate string)
// List retrieves all mandates for the given customerId,
// ordered from newest to oldest.
//
// See: https://docs.mollie.com/reference/v2/mandates-api/list-mandates
// See: https://docs.mollie.com/reference/list-mandates
func (ms *MandatesService) List(ctx context.Context, customer string, options *ListMandatesOptions) (
res *Response,
ml *MandatesList,
Expand Down
4 changes: 2 additions & 2 deletions mollie/onboarding.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ type OnboardingService service

// GetOnboardingStatus gets the status of onboarding of the authenticated organization.
//
// See: https://docs.mollie.com/reference/v2/onboarding-api/get-onboarding-status
// See: https://docs.mollie.com/reference/get-onboarding-status
func (os *OnboardingService) GetOnboardingStatus(ctx context.Context) (res *Response, o *Onboarding, err error) {
res, err = os.client.get(ctx, onboardingURLPath, nil)
if err != nil {
Expand All @@ -94,7 +94,7 @@ func (os *OnboardingService) GetOnboardingStatus(ctx context.Context) (res *Resp
// This endpoint has been deprecated. It will be supported for the foreseeable future, but new implementations should
// use the Create client link endpoint to create new clients and submit their organization’s details in one go.
//
// See: https://docs.mollie.com/reference/v2/onboarding-api/submit-onboarding-data
// See: https://docs.mollie.com/reference/submit-onboarding-data
func (os *OnboardingService) SubmitOnboardingData(ctx context.Context, d *OnboardingData) (res *Response, err error) {
res, err = os.client.post(ctx, onboardingURLPath, d, nil)
if err != nil {
Expand Down
Loading
Loading