airtable

package module
Version: v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

README

airtable

PkgGoDev Go Report Card

A simple airtable client.

Usage

Go to your account page to get an api token and go to API page and select the database to get the base ID.

Then create the client.

c := airtable.NewClient("your_api_token","your_base_ID")

Call the client's ListRecords, GetRecord, CreateRecords, DeleteRecords and PatchRecords methods to access the API.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	APIKey string
	BaseID string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(apiKey string, baseID string) *Client

func (*Client) CreateRecords

func (c *Client) CreateRecords(table string, records Records) error

func (*Client) DeleteRecords

func (c *Client) DeleteRecords(table string, ids []string) error

func (*Client) GetRecord

func (c *Client) GetRecord(table string, id string) (Record, error)

func (*Client) ListRecords

func (c *Client) ListRecords(table string, params map[string]string) (Records, error)

func (*Client) PatchRecords

func (c *Client) PatchRecords(table string, records Records) error

type Record

type Record struct {
	ID          string      `json:"id,omitempty"`
	Fields      interface{} `json:"fields"`
	CreatedTime string      `json:"createdTime,omitempty"`
}

type Records

type Records struct {
	Records []Record `json:"records"`
	Offset  string   `json:"offset,omitempty"`
}

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL