Categorygithub.com/faliam-inc/airtable-go
modulepackage
0.0.0-20240913233737-86ca39221f52
Repository: https://github.com/faliam-inc/airtable-go.git
Documentation: pkg.go.dev

# README

Airtable Go Client Library

Installation

Make sure you have Golang v1.6 or higher installed. If not, install it now.

Fetch airtable-go:

go get github.com/fabioberger/airtable-go

Import airtable-go into your project:

import "github.com/fabioberger/airtable-go"

Usage

Create an instance of the airtable-go client:

import (
	"os"
	"github.com/fabioberger/airtable-go"
)

airtableAPIKey := os.Getenv("AIRTABLE_API_KEY")
baseID := "apphllLCpWnySSF7q" // replace this with your airtable base's id

client, err := airtable.New(airtableAPIKey, baseID)
if err != nil {
	panic(err)
}

You can now call methods on the client instance. All client methods are documented in the project's GoDoc page. You can also check out the stubbed and integration tests included in this project for working examples of all the client methods and options.

For Airtable specific documentation, see the interactive documentation at https://airtable.com/api.

Tests

Execute the following to run the stubbed out unit tests:

go test -v ./tests/stubbed_tests

In order to run the integration tests, you will need to copy this test Airtable base into your own Airtable account using the "copy base" button in the top right.

Next, set two environment variables corresponding to your Airtable API key and the baseID of your copy of the test Airtable base.

export AIRTABLE_TEST_API_KEY=YOUR_API_KEY
export AIRTABLE_TEST_BASE_ID=YOUR_TEST_BASE_ID

Now you can run the integration tests with:

go test -v ./tests/integration_tests

Versioning

This library uses Semantic Versioning.

# Packages

No description provided by the author
No description provided by the author

# Functions

New creates a new instance of the Airtable client.

# Structs

Attachment models the response returned by the Airtable API for an attachment field type.
Client exposes the interface for sending requests to the Airtable API.
Error represents an error returned by the Airtable API.
ListParameters let's the caller describe the parameters he want's sent with a ListRecords request See the documentation at https://airtable.com/api for more information on how to use these parameters.
SortParameter is a sort object sent as part of the ListParameters that describes how the records should be sorted.