-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #215 from VictorAvelar/feature/idempotency-key-sup…
…port
- Loading branch information
Showing
20 changed files
with
377 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# connect | ||
|
||
-- | ||
import "github.com/VictorAvelar/mollie-api-go/v3/mollie/connect" | ||
|
||
## Usage | ||
|
||
#### func OauthEndpoint | ||
|
||
```go | ||
func OauthEndpoint() *oauth2.Endpoint | ||
``` | ||
|
||
OauthEndpoint is Mollies's OAuth 2.0 endpoint. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# tools | ||
|
||
-- | ||
import "github.com/VictorAvelar/mollie-api-go/v3/mollie/tools" | ||
|
||
package tools provides some common tools required by mollie's features in order | ||
to maximize the library utility. | ||
|
||
## Usage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# idempotency | ||
|
||
-- | ||
import "github.com/VictorAvelar/mollie-api-go/v3/mollie/tools/idempotency" | ||
|
||
package idempotency contains the services in charge of generating a unique keys | ||
to be passed in POST requests to ensure operation uniqueness. | ||
|
||
See: <https://docs.mollie.com/overview/api-idempotency> | ||
|
||
The std generator uses google's uuid library to return a new uuid as unique | ||
idempotency key. | ||
|
||
You can build your own generator and pass it to the library by implementing the | ||
KeyGenerator interface. | ||
|
||
## Usage | ||
|
||
```go | ||
const ( | ||
TestKeyExpected = "test_ikg_key" | ||
) | ||
``` | ||
|
||
#### type KeyGenerator | ||
|
||
```go | ||
type KeyGenerator interface { | ||
// Generate encapsulates the logic to return a string representation of | ||
// a unique idempotency key. | ||
Generate() string | ||
} | ||
``` | ||
|
||
KeyGenerator describes the service in charge of generating a unique idempotency | ||
key to be passed in POST requests to ensure operation uniqueness. | ||
|
||
See: <https://docs.mollie.com/overview/api-idempotency> | ||
|
||
#### func NewNopGenerator | ||
|
||
```go | ||
func NewNopGenerator(exp string) KeyGenerator | ||
``` | ||
|
||
NewNopGenerator returns a dummy implementation of the IdempotencyKeyGenerator | ||
interface. | ||
|
||
Good for testing or when a predictable result is required. | ||
|
||
If exp is an empty string, then TestKeyExpected is used as default value for the | ||
NOpGenerator. | ||
|
||
#### func NewStdGenerator | ||
|
||
```go | ||
func NewStdGenerator() KeyGenerator | ||
``` | ||
|
||
NewStdGenerator returns an standard and common way of generating idempotency | ||
unique keys. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.