base

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: May 26, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	COL_ID        = "ID"
	COL_AI_ID     = "AI_ID"
	COL_STATUS    = "Status"
	COL_DOI       = "DOI"
	COL_DOI_CONF  = "DOI_Confirmed"
	COL_OA_STATUS = "OA_status"
	COL_OA_LINK   = "OA_Link"
)

Variables

This section is empty.

Functions

func IndexAirtableRecords

func IndexAirtableRecords(recs []*airtable.Record, field string) (atIndex, error)

create

Types

type Config

type Config struct {
	Airtable struct {
		APIKey string
		Base   struct {
			Production string
			Test       string
		}
		TableName       string
		Tasks           string
		ActivityInsight string `yaml:"activity_insight"`
	}
	Unpaywall struct {
		Email string
	}
	OpenAccessButton struct {
		Key string
	}
	ScholarSphere struct {
		APIKey     string
		Production string
		Test       string
	} `yaml:"scholarsphere"`
	RMDB struct {
		APIKey     string
		Production string
		Test       string
	} `yaml:"rmdb"`
	ArticlePath string `yaml:"article_path"`
}

Config is the global configuration for command line utility

type Oats

type Oats struct {
	*Config
	Production bool // run in production mode or not
	// contains filtered or unexported fields
}

func NewOats

func NewOats(config string) (*Oats, error)

func (*Oats) AirtableBase

func (oats *Oats) AirtableBase() string

func (*Oats) GetRecord

func (cmd *Oats) GetRecord(tableName string, id string) (*airtable.Record, error)

func (*Oats) GetRecordsFilterFields

func (cmd *Oats) GetRecordsFilterFields(tableName string, filter string, fields []string) ([]*airtable.Record, error)

downloads all records in the Airtable

func (*Oats) PostRecords

func (cmd *Oats) PostRecords(tableName string, records []*airtable.Record) ([]*airtable.Record, error)

postRecords does POST for records in an Airtable. A POST request will create new rows for each record.

Jump to

Keyboard shortcuts

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