Documentation
¶
Index ¶
- Constants
- Variables
- type AccountRecord
- type Base
- type DB
- type IssueRecord
- type LabelRecord
- type MilestoneRecord
- type ProviderRecord
- type Record
- type RepositoryRecord
- type State
- type Table
- func (t Table) Append(record interface{})
- func (t Table) CopyFields(idx int, srcRecord interface{})
- func (t Table) Fetch(at airtable.Table) error
- func (t Table) FindByID(id string) string
- func (t Table) Get(idx int) interface{}
- func (t Table) GetFieldID(idx int) string
- func (t Table) GetID(idx int) string
- func (t Table) GetPtr(idx int) interface{}
- func (t Table) GetState(idx int) State
- func (t Table) Len() int
- func (t Table) RecordsEqual(idx int, b Record) bool
- func (t Table) SetState(idx int, state State)
- func (t Table) StringAt(idx int) string
Constants ¶
const ( ProviderIndex = iota LabelIndex AccountIndex RepositoryIndex MilestoneIndex IssueIndex NumTables )
Unfortunately, the order matters here. We must first compute Records which are referenced by other Records...
Variables ¶
var ( StateString = map[State]string{ StateUnknown: "unknown", StateUnchanged: "unchanged", StateChanged: "changed", StateNew: "new", } )
var ( TableNameToIndex = map[string]int{ "provider": ProviderIndex, "label": LabelIndex, "account": AccountIndex, "repository": RepositoryIndex, "milestone": MilestoneIndex, "issue": IssueIndex, } )
Functions ¶
This section is empty.
Types ¶
type AccountRecord ¶
type AccountRecord struct { State State `json:"-"` // internal airtable.Record // provides ID, CreatedTime Fields struct { // base Base // specific URL string `json:"url"` Login string `json:"login"` FullName string `json:"fullname"` Type string `json:"type"` Bio string `json:"bio"` Location string `json:"location"` Company string `json:"company"` Blog string `json:"blog"` Email string `json:"email"` AvatarURL string `json:"avatar-url"` // relationships Provider []string `json:"provider"` } `json:"fields,omitempty"` }
func (AccountRecord) String ¶
func (r AccountRecord) String() string
type IssueRecord ¶
type IssueRecord struct { State State `json:"-"` // internal airtable.Record // provides ID, CreatedTime Fields struct { // base Base // specific URL string `json:"url"` CompletedAt time.Time `json:"completed-at"` Title string `json:"title"` State string `json:"state"` Body string `json:"body"` IsPR bool `json:"is-pr"` IsLocked bool `json:"is-locked"` Comments int `json:"comments"` Upvotes int `json:"upvotes"` Downvotes int `json:"downvotes"` IsOrphan bool `json:"is-orphan"` IsHidden bool `json:"is-hidden"` Weight int `json:"weight"` IsEpic bool `json:"is-epic"` HasEpic bool `json:"has-epic"` // relationships Repository []string `json:"repository"` Milestone []string `json:"milestone"` Author []string `json:"author"` Labels []string `json:"labels"` Assignees []string `json:"assignees"` } `json:"fields,omitempty"` }
func (IssueRecord) String ¶
func (r IssueRecord) String() string
type LabelRecord ¶
type LabelRecord struct { State State `json:"-"` // internal airtable.Record // provides ID, CreatedTime Fields struct { // base Base // specific URL string `json:"url"` Name string `json:"name"` Color string `json:"color"` Description string `json:"description"` } `json:"fields,omitempty"` }
func (LabelRecord) String ¶
func (r LabelRecord) String() string
type MilestoneRecord ¶
type MilestoneRecord struct { State State `json:"-"` // internal airtable.Record // provides ID, CreatedTime Fields struct { // base Base // specific URL string `json:"url"` Title string `json:"title"` Description string `json:"description"` ClosedAt time.Time `json:"closed-at"` DueOn time.Time `json:"due-on"` // relationships Creator []string `json:"creator"` Repository []string `json:"repository"` } `json:"fields,omitempty"` }
func (MilestoneRecord) String ¶
func (r MilestoneRecord) String() string
type ProviderRecord ¶
type ProviderRecord struct { State State `json:"-"` // internal airtable.Record // provides ID, CreatedTime Fields struct { // base Base // specific URL string `json:"url"` Driver string `json:"driver"` } `json:"fields,omitempty"` }
func (ProviderRecord) String ¶
func (r ProviderRecord) String() string
type RepositoryRecord ¶
type RepositoryRecord struct { State State `json:"-"` // internal airtable.Record // provides ID, CreatedTime Fields struct { // base Base // specific URL string `json:"url"` Title string `json:"title"` Description string `json:"description"` Homepage string `json:"homepage"` PushedAt time.Time `json:"pushed-at"` IsFork bool `json:"is-fork"` // relationships Provider []string `json:"provider"` Owner []string `json:"owner"` } `json:"fields,omitempty"` }
func (RepositoryRecord) String ¶
func (r RepositoryRecord) String() string
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
func (Table) Append ¶
func (t Table) Append(record interface{})
Append appends the given record to the table. Will panic if the given record is not of the right type.
func (Table) CopyFields ¶
CopyFields copies the 'Fields' struct from srcRecord into the Record at idx in the Tabel t. Will panic necessary fields do not exist.
func (Table) Fetch ¶
Fetch retrieves the airtable table records from at over the network and inserts the records into the table.
func (Table) FindByID ¶
FindByID searches the table for a record with Fields.ID equal to id. Returns the record's ID if a match is found. Otherwise, returns the empty string.
func (Table) GetFieldID ¶
GetFieldID returns the ID field of the Fields struct of the record at idx in the Table t. Will panic necessary fields do not exist.