api

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseJson added in v0.2.0

func ParseJson(body []byte, job interface{}) error

func Request

func Request(method string, path string, c *cli.Context) ([]byte, bool, error)

func Upload

func Upload(file *os.File, direction string, format string, fields string, c *cli.Context) ([]byte, error)

func ValidateSpreadsheetJobId added in v0.2.0

func ValidateSpreadsheetJobId(c *cli.Context) (int, error)

Types

type FileItem

type FileItem struct {
	EstimatedRowsCount int      `json:"estimated_rows_count"`
	Filename           string   `json:"filename"`
	Headers            []string `json:"headers,omitempty"`
}

type SpreadsheetJob

type SpreadsheetJob struct {
	Id          int        `json:"id"`
	Fields      []string   `json:"fields"`
	File        FileItem   `json:"file"`
	Status      StatusItem `json:"status"`
	DownloadUrl string     `json:"download_url"`
	ExpiresAt   time.Time  `json:"expires_at"`
	Message     string     `json:"message,omitempty"`
	Error       string     `json:"error,omitempty"`
}

type StatusItem

type StatusItem struct {
	State               string  `json:"state"`
	Progress            float32 `json:"progress"`
	Message             string  `json:"message"`
	TimeLeftDescription string  `json:"time_left_description,omitempty"`
	TimeLeftSeconds     int     `json:"time_left_seconds,omitempty"`
}

Jump to

Keyboard shortcuts

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