airtable

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

README

airtable

PkgGoDev Go Report Card License

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

CreateRecords creates records in the given table

func (*Client) DeleteRecords

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

DeleteRecords deletes records in the given table with given record ids

func (*Client) GetRecord

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

GetRecord gets a record in the given table with the given id

func (*Client) ListRecords

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

ListRecords lists records in the given table

func (*Client) PatchRecords

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

PatchRecords patches records in the given table

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"`
}

Jump to

Keyboard shortcuts

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