Documentation ¶
Index ¶
- type Client
- type GetRecordsConfig
- func (grc *GetRecordsConfig) Do() (*Records, error)
- func (grc *GetRecordsConfig) FromView(viewNameOrID string) *GetRecordsConfig
- func (grc *GetRecordsConfig) InStringFormat(timeZone, userLocale string) *GetRecordsConfig
- func (grc *GetRecordsConfig) MaxRecords(maxRecords int) *GetRecordsConfig
- func (grc *GetRecordsConfig) PageSize(pageSize int) *GetRecordsConfig
- func (grc *GetRecordsConfig) ReturnFields(fieldNames ...string) *GetRecordsConfig
- func (grc *GetRecordsConfig) WithFilterFormula(filterFormula string) *GetRecordsConfig
- func (grc *GetRecordsConfig) WithOffset(offset string) *GetRecordsConfig
- func (grc *GetRecordsConfig) WithSort(sortQueries ...) *GetRecordsConfig
- type HTTPClientError
- type Record
- type Records
- type Table
- func (t *Table) AddRecords(records *Records) (*Records, error)
- func (t *Table) DeleteRecords(recordIDs []string) (*Records, error)
- func (t *Table) GetRecord(recordID string) (*Record, error)
- func (t *Table) GetRecords() *GetRecordsConfig
- func (t *Table) GetRecordsWithParams(params url.Values) (*Records, error)
- func (t *Table) UpdateRecords(records *Records) (*Records, error)
- func (t *Table) UpdateRecordsPartial(records *Records) (*Records, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client client for airtable api.
func NewClient ¶
NewClient airtable client constructor your API KEY you can get on your account page https://airtable.com/account
func (*Client) SetBaseURL ¶ added in v0.2.5
func (*Client) SetRateLimit ¶
SetRateLimit rate limit setter for custom usage Airtable limit is 5 requests per second (we use 4) https://airtable.com/{yourDatabaseID}/api/docs#curl/ratelimits
type GetRecordsConfig ¶
type GetRecordsConfig struct {
// contains filtered or unexported fields
}
GetRecordsConfig helper type to use in. step by step get records.
func (*GetRecordsConfig) Do ¶
func (grc *GetRecordsConfig) Do() (*Records, error)
Do send the prepared get records request.
func (*GetRecordsConfig) FromView ¶
func (grc *GetRecordsConfig) FromView(viewNameOrID string) *GetRecordsConfig
FromView add view parameter to get records.
func (*GetRecordsConfig) InStringFormat ¶
func (grc *GetRecordsConfig) InStringFormat(timeZone, userLocale string) *GetRecordsConfig
InStringFormat add parameter to get records in string format. it require timezone https://support.airtable.com/hc/en-us/articles/216141558-Supported-timezones-for-SET-TIMEZONE and user locale data https://support.airtable.com/hc/en-us/articles/220340268-Supported-locale-modifiers-for-SET-LOCALE
func (*GetRecordsConfig) MaxRecords ¶ added in v0.2.0
func (grc *GetRecordsConfig) MaxRecords(maxRecords int) *GetRecordsConfig
MaxRecords The maximum total number of records that will be returned in your requests. If this value is larger than pageSize (which is 100 by default), you may have to load multiple pages to reach this total. See the Pagination section below for more.
func (*GetRecordsConfig) PageSize ¶ added in v0.2.0
func (grc *GetRecordsConfig) PageSize(pageSize int) *GetRecordsConfig
PageSize The number of records returned in each request. Must be less than or equal to 100. Default is 100. See the Pagination section below for more.
func (*GetRecordsConfig) ReturnFields ¶
func (grc *GetRecordsConfig) ReturnFields(fieldNames ...string) *GetRecordsConfig
ReturnFields set returning field names.
func (*GetRecordsConfig) WithFilterFormula ¶
func (grc *GetRecordsConfig) WithFilterFormula(filterFormula string) *GetRecordsConfig
WithFilterFormula add filter to request.
func (*GetRecordsConfig) WithOffset ¶ added in v0.2.0
func (grc *GetRecordsConfig) WithOffset(offset string) *GetRecordsConfig
WithOffset Pagination will stop when you've reached the end of your table. If the maxRecords parameter is passed, pagination will stop once you've reached this maximum.
func (*GetRecordsConfig) WithSort ¶
func (grc *GetRecordsConfig) WithSort(sortQueries ...struct { FieldName string Direction string }) *GetRecordsConfig
WithSort add sorting to request.
type HTTPClientError ¶
HTTPClientError custom error to handle with response status.
func (*HTTPClientError) Error ¶
func (e *HTTPClientError) Error() string
type Record ¶
type Record struct { ID string `json:"id,omitempty"` Fields map[string]interface{} `json:"fields"` CreatedTime string `json:"createdTime,omitempty"` Deleted bool `json:"deleted,omitempty"` // The Airtable API will perform best-effort automatic data conversion // from string values if the typecast parameter is passed in. // Automatic conversion is disabled by default to ensure data integrity, // but it may be helpful for integrating with 3rd party data sources. Typecast bool `json:"typecast,omitempty"` // contains filtered or unexported fields }
Record base time of airtable record fields.
func (*Record) DeleteRecord ¶
DeleteRecord delete one record.
type Records ¶
type Records struct { Records []*Record `json:"records"` Offset string `json:"offset,omitempty"` // The Airtable API will perform best-effort automatic data conversion // from string values if the typecast parameter is passed in. // Automatic conversion is disabled by default to ensure data integrity, // but it may be helpful for integrating with 3rd party data sources. Typecast bool `json:"typecast,omitempty"` }
Records base type of airtable records.
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
Table represents table object.
func (*Table) AddRecords ¶
AddRecords method to add lines to table (up to 10 in one request) https://airtable.com/{yourDatabaseID}/api/docs#curl/table:{yourTableName}:create
func (*Table) DeleteRecords ¶
DeleteRecords delete records by recordID up to 10 ids in one request.
func (*Table) GetRecord ¶
GetRecord get record from table https://airtable.com/{yourDatabaseID}/api/docs#curl/table:{yourTableName}:retrieve
func (*Table) GetRecords ¶
func (t *Table) GetRecords() *GetRecordsConfig
GetRecords prepare step to get records.
func (*Table) GetRecordsWithParams ¶
GetRecordsWithParams get records with url values params https://airtable.com/{yourDatabaseID}/api/docs#curl/table:{yourTableName}:list
func (*Table) UpdateRecords ¶
UpdateRecords full update records.