Documentation ¶
Overview ¶
xlquery - a package for quering Caltech library API (and others) and integrating results into an Excel Workbook.
@author R. S. Doiel, <rsdoiel@caltech.edu>
Copyright (c) 2016, Caltech All rights not granted herein are expressly reserved by Caltech.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Index ¶
- Constants
- func ColumnNameToIndex(colName string) (int, error)
- func GetCell(sheet *xlsx.Sheet, row int, col int) string
- func Request(api *url.URL, headers map[string]string) ([]byte, error)
- func UpdateCell(sheet *xlsx.Sheet, row int, col int, value string, overwrite bool) error
- func UpdateParameters(api *url.URL, queryTerms map[string]string) *url.URL
Constants ¶
const (
// Version of this package
Version = "v0.0.1"
)
Variables ¶
This section is empty.
Functions ¶
func ColumnNameToIndex ¶
ColumnNameToIndex turns a column reference e.g. 'A', 'BF' into a zero-based array position
func Request ¶
Request executes an HTTP request to the service returning a Query structure and error value.
func UpdateCell ¶
UpdateCell given a Spreadsheeet, row and col, save the value respecting the overWrite flag or return an error
func UpdateParameters ¶
UpdateParameters adds/overwrites any mapped values to the URL object passed in.
URL attribute for EPrints advanced search (output is Atom):
Scheme: http Host: eprint-repository.example.org Path: /cgi/search/advanced Query parameters: title: Molecules in solutoin output: Atom
Example usage: api, _ := url.Parse("http://eprint-repository.example.org/cgi/search/advanced") xlquery.UpdateQuery(api, map[string]string{"title": title, "output":"Atom"}) data, err := http.Get(api.String()) ...
Types ¶
This section is empty.