https://github.com/motdotla/cartelogic
Logic for saving carte data to the redis database.
https://github.com/motdotla/cartelogic
Last synced: 3 months ago
JSON representation
Logic for saving carte data to the redis database.
- Host: GitHub
- URL: https://github.com/motdotla/cartelogic
- Owner: motdotla
- Created: 2014-07-06T22:34:52.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-07-13T23:24:07.000Z (about 11 years ago)
- Last Synced: 2025-03-17T17:50:30.235Z (7 months ago)
- Language: Go
- Size: 184 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cartelogic
[](https://travis-ci.org/scottmotte/cartelogic)
Logic for saving carte data to the redis database.
This library is part of the larger [Carte ecosystem](https://github.com/scottmotte/carte).
## Usage
```go
package mainimport (
"fmt"
"github.com/scottmotte/cartelogic"
)func main() {
cartelogic.Setup("your-orchestrate-api-key")account := map[string]interface{}{"email": "email@myapp.com"}
result, logic_error := cartelogic.AccountsCreate(account)
if logic_error != nil {
fmt.Println(logic_error)
}
fmt.Println(result)
}
```### Setup
Connect to [Orchestrate.io](http://orchestrate.io/).
```go
cartelogic.Setup("your-orchestrate-api-key")
```### AccountsCreate
```go
account := map[string]interface{}{"email": "email@myapp.com"}
result, logic_error := cartelogic.AccountsCreate(account)
```### CardsCreate
```go
card := map[string]interface{}{"front": "", "back": "John Doe", "api_key": "your_api_key_you_got_when_creating_an_account"}
result, logic_error := cartelogic.CardsCreate(card)
```## Installation
```
go get github.com/scottmotte/cartelogic
```## Running Tests
```
cp .env.example .env
```Edit the contents of `.env.`
```
go test -v
```