bhlindex

package module
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2019 License: MIT Imports: 7 Imported by: 0

README

Biodiversity Heritage Library Scientific Names Index

Creates an index of scientific names occurring in the collection of literature in Biodiversity Heritage Library

Usage

Linux

Database Migrations

Install migrate
go get -u -d github.com/golang-migrate/migrate/cli github.com/lib/pq
go build -tags 'postgres' -o $GOPATH/bin/migrate github.com/golang-migrate/migrate/cli
Create migration
migrate create -ext pgsql -D db NAME
Run commands
migrate -database postgres://localhost:5432/database up 2
Commands

create [-ext E] [-dir D] NAME : Create a set of timestamped up/down migrations titled NAME, in directory D with extension E

version : current migration version

up [N] : up N migrations

down [N] : down N migrations

drop : nuke database

Testing
docker-compose build
docker-compose up

To update all dependencies change LAST_FULL_REBUILD line in Docker file and return docker-compose build

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(err error)

Check handles error checking, and panicks if error is not nil.

func DbInit

func DbInit() (*sql.DB, error)

DbInit returns a connection to bhlindex database.

func UUID4

func UUID4() string

UUID4 returns random (version 4) UUID as a string.

Types

type Env

type Env struct {
	DbHost      string
	DbUser      string
	Db          string
	BHLDir      string
	PrefSources []int
}

Env is a collection of environment variables.

func EnvVars

func EnvVars() Env

EnvVars imports all environment variables relevant for the data conversion.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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