modulepackage
0.0.0-20200828211449-f970ec73ca16
Repository: https://github.com/mottaquikarim/go-airtable.git
Documentation: pkg.go.dev
# README
Go Airtable
Simple Airtable client written in go
Installation
go get github.com/mottaquikarim/go-airtable
Usage
Let's make a simple request to the pokédex. You can copy this base by clicking the top right "Copy" button and test against this data yourself 👍.
import (
"github.com/mottaquikarim/go-airtable"
)
acc := airtable.Account{
ApiKey: "XXXX",
BaseId: "XXXX",
}
pokédex := airtable.NewTable("pokémon", acc)
original_generation, err := pokédex.List(airtable.Options{
// Airtable has an API limit of 100 records per page
MaxRecords: 100,
// override the default "Grid view" name
View: "All",
})
if err != nil {
// handle error
log.Printf("Error! %v", err)
}
// returned is []Record struct, which contains a Field prop
// that is map[string]interface{} - this can be used anyway
// you like
for _, pokémon := range original_generation {
log.Printf("ID: %s Name: %s", pokémon.Fields["ID"], pokémon.Fields["Name"])
}
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
Run Tests
make test-dev
Format
make fmt
Lint
make lint
CLI
make build
Then,
make run arguments="-help"
Output:
Usage: ./airtbl [flags]
-api-key="XXXXX": Airtable API Key
-base-id="XXXXX": Airtable Base Id
License
# Packages
No description provided by the author
# Functions
NewTable returns a GenericTable struct that implements the Table interface.
# Variables
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Interfaces
No description provided by the author