upload

package
v0.0.0-...-b0b99f2 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateTableRequest

type CreateTableRequest struct {
	Definition interface{}
}

CreateTableRequest contains all information to create a database table. Definition is usually a struct with some sort of tagging.

For example, for Chrome, if the database is BigQuery:

type TestResult struct {
      ID     string `bigquery:"id"`
      Result string `bigquery:"result"`
}

type InsertRequest

type InsertRequest struct {
	Items interface{}
}

InsertRequest contains all information to upload.

type UploadClient

type UploadClient interface {
	// CreateTableFromStruct creates a table based on the provided struct definition.
	// The struct should define some tags that can be utilized for table definition.
	CreateTableFromStruct(ctx context.Context, req *CreateTableRequest) error

	// Insert uploads one or more rows.
	Insert(ctx context.Context, req *InsertRequest) error
}

UploadClient defines an interface for uploading data to some source.

func NewUploadClient

func NewUploadClient(ctx context.Context, cfg *UploadClientConfig) (UploadClient, error)

NewUploadClient returns, at the moment, a Chrome implementation for uploading data.

type UploadClientConfig

type UploadClientConfig struct {
	Project   string
	DatasetID string
	TableName string
}

UploadClientConfig contains configurations required for client setup.

Jump to

Keyboard shortcuts

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