cmd

package
v0.0.0-...-f26095a Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Db *gorm.DB

Db - shared DB connection

View Source
var RootCmd = &cobra.Command{
	Use:   "extract-blocks",
	Short: "Extracts Cell Formula Blocks from Excel file and writes to MySQL",
	Long: `Extracts Cell Formula Blocks from Excel file and writes to MySQL.

Conditions that define Cell Formula Block -
    (i) Any contiguous (unbroken) range of excel cells containing cell formula
   (ii) Contiguous cells could be either in a row or in a column or in row+column cell block.
  (iii) The formula in the range of cells should be the same except the changes due to relative cell references.

Connection should be defined using connection URL notation: DRIVER://CONNECIONT_PARAMETERS,
where DRIVER is either "mysql" or "sqlite", e.g., mysql://user:password@tcp(SERVER:PORT)/dbname?charset=utf8&parseTime=True&loc=Local.
More examples on connection parameter you can find at: https://github.com/go-sql-driver/mysql#examples.`,
}

RootCmd represents the base command when called without any subcommands

Functions

func AddComments

func AddComments(fileNames ...string)

AddComments addes comments to the given file from the DB and stores file with the given name

func AddCommentsInBatch

func AddCommentsInBatch(manager s3.FileManager) error

AddCommentsInBatch addes comments to the answer files.

func AddCommentsToFile

func AddCommentsToFile(answerID int, fileName, outputName string, deleteComments bool) error

AddCommentsToFile addes chart properties and comments to the answer files.

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func HandleAnswers

func HandleAnswers(manager s3.FileManager) error

HandleAnswers - iterates through student answers and retrievs answer workbooks it thaks the funcion that actuatualy performs file download from S3 bucket and returns the downloades file name or an error.

func HandleProblems

func HandleProblems(manager s3.FileManager) (err error)

HandleProblems - iterates through questions, downloads the all files and inport all cells into DB

func HandleQuestions

func HandleQuestions(manager s3.FileManager) error

HandleQuestions - iterates through questions, downloads the all files and inport all cells into DB

Types

This section is empty.

Jump to

Keyboard shortcuts

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