Skip to content

Commit

Permalink
Merge pull request #81 from Henry-Sarabia/iss-76
Browse files Browse the repository at this point in the history
Add support for Go modules
  • Loading branch information
Henry Sarabia authored Feb 11, 2020
2 parents 48f27f1 + 2027906 commit 4b65495
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@

# Custom
temp.go
test.go
test.go
.vscode
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Manage your [Kanka](https://kanka.io/en-US) campaign or build tools for other
creators with the thoroughly tested and documented **kanka** package.

The **kanka** package provides a client to handle communication with the
The **kanka** package provides a client to handle all communication with the
[Kanka API](https://kanka.io/en-US/docs/1.0).

The package is structured into convenient and discoverable services for
Expand Down Expand Up @@ -69,7 +69,7 @@ cmps, err := c.Campaigns.Index()
```
You now have access to a list of the user's campaigns via `cmps`.

### Retrieving an entity
### Retrieving An Entity

To retrieve a specific entity from a campaign, use the `Get` function.

Expand All @@ -78,12 +78,12 @@ Take the `Quests` service for example.
For this service, `Get` requires a campaign ID and quest ID.

```go
qst, err := c.Quests.Get(cmpID, qstID))
qst, err := c.Quests.Get(cmpID, qstID)
```

The result is stored in `qst` of type `Quest`.

### Retrieving a list of entities
### Retrieving A List Of Entities

To retrieve a list of a campaign's entities of a certain type, use the `Index` function.

Expand All @@ -106,7 +106,7 @@ locs, err := c.Locations.Index(cmpID, t)
The result is stored in `locs` of type `[]Location`.


### Creating an entity
### Creating An Entity

To create a new entity, use the `Create` function.

Expand All @@ -128,9 +128,9 @@ The `Create` functions return the newly created entity back to the caller.

This example simply discards the value.

### Updating an entity
### Updating An Entity

To update an entity, use the `Update` function.
To update an existing entity, use the `Update` function.

Take `Items` for example.

Expand All @@ -148,10 +148,10 @@ _, err := c.Items.Update(cmpID, item)
```
The `Update` functions return the updated entity back to the caller.

This example simply discard the value.
This example simply discards the value.


### Deleting an entity
### Deleting An Entity

To delete an entity, use the `Delete` function.

Expand All @@ -163,9 +163,9 @@ For this service, `Delete` requires a campaign ID and a journal ID.
err := c.Journals.Delete(cmpID, jrnID)
```

### Rate limits, errors, and you
### Rate Limits, Errors, And You

The Kanka API is rate limited. For the most recent and accurate information,
The Kanka API is rate limited. For the most accurate and updated information,
please visit the Kanka [documentation](https://kanka.io/en-US/docs/1.0/setup#endpoints).

If one of your requests to the Kanka API fails due to the rate limit or other temporary reason,
Expand Down
8 changes: 8 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module github.com/Henry-Sarabia/kanka

go 1.13

require (
github.com/Henry-Sarabia/blank v3.0.0+incompatible
github.com/google/go-cmp v0.4.0
)
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
github.com/Henry-Sarabia/blank v3.0.0+incompatible h1:3JfHWx7YVr1bA+9aK1J2w9TrFpwAHfPibHOq4qwicSc=
github.com/Henry-Sarabia/blank v3.0.0+incompatible/go.mod h1:EKLnM7Lq0E08WmivZuJoo099i07THd4ISgOBs3wOKTw=
github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

0 comments on commit 4b65495

Please sign in to comment.