epds

package
v0.0.0-...-8ef749c Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package epds has some utils for accessing the files and managing the data in this repo

Index

Constants

This section is empty.

Variables

View Source
var DatabasePath = "./epds/"

DatabasePath is the path to where the bull flat csv files are kept

Functions

func FindIconFor

func FindIconFor(root string) (string, error)

func ListDatabases

func ListDatabases(access users.Access) []string

ListDatabases returns a list of all the databases in this directory

Types

type Bull

type Bull struct {
	Values []string
	Score  float64
}

Bull holds the fields for a single bull

func (*Bull) Fields

func (b *Bull) Fields() []string

Fields returns a bull in string slice

type Database

type Database struct {
	Name        string
	Root        string
	Description string

	Xref map[string]Field
	// contains filtered or unexported fields
}

Database contains necessary fields for a bull database

func NewDatabase

func NewDatabase(root string) (*Database, error)

NewDatabase returns an object with actionable methods on it for comparing jobs

func (*Database) CompareJob

func (db *Database) CompareJob(job *users.Job, fieldNames []string) (*bytes.Buffer, error)

CompareJob will take in a job and run it against the database and return a reader which has a formatted CSV, which has the jobs output run against it

func (*Database) FieldSlice

func (db *Database) FieldSlice() []Field

FieldSlice returns a slice of the fields in the order that makes sense

func (*Database) Test

func (db *Database) Test() error

Test allows you to verify the database can access the files it needs to does not verify the CSV, just checks it exists

func (*Database) TraitKeys

func (db *Database) TraitKeys(set []string) []string

TraitKeys returns the trait keys this database has fields for

type Field

type Field struct {
	Key     string `json:"name"`
	Header  string `json:"header"`
	Comment string `json:"comment"`
	Select  bool   `json:"select"`
	// contains filtered or unexported fields
}

Field describes a field in the CSV file read in from the comp_fn_pair.hjson file

Jump to

Keyboard shortcuts

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