mapper

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInputNil = errors.New("expected input value but was nil")

ErrInputNil is used when a result was expected but was nil

Functions

This section is empty.

Types

type DatasetData

type DatasetData struct {
	DimensionLabel string
	Editions       DatasetEditions
}

DatasetData contains information specific to how this code is represented or present in a particular dataset

type DatasetEditions

type DatasetEditions map[string]Versions

DatasetEditinos maps edition labels to lists of version IDs

type Datasets

type Datasets map[string]DatasetData

Datasets maps datasetIDs to dataset data

type HierarchyElements

type HierarchyElements struct {
	List []*models.Element
}

HierarchyElements encases a list so a pointer to the list can more easily be passed into the mapper functions

type Result

type Result struct {
	Data  []interface{}
	Meta  map[string]interface{}
	Index int
}

Result contains data and metadata relating to a neo4j query response

type ResultMapper

type ResultMapper func(r *Result) error

ResultMapper defines the function signature all mappers will need to satisfy

func Code

func Code(codeModel *models.Code, codeListID string, edition string) ResultMapper

Code returns a dpbolt.ResultMapper which converts a dpbolt.Result to models.Code

func CodeList

func CodeList(codeList *models.CodeList, id string) ResultMapper

CodeList returns a dpbolt.ResultMapper which converts a dpbolt.Result to a model.CodeList

func CodeLists

func CodeLists(codeLists *models.CodeListResults) ResultMapper

CodeLists returns a dpbolt.ResultMapper which converts a dpbolt.Result to models.CodeLists

func Codes

func Codes(results *models.CodeResults, codeListID string, edition string) ResultMapper

Codes returns a dpbolt.ResultMapper mapper which converts dpbolt.Result to models.CodeResults

func CodesDatasets

func CodesDatasets(datasets Datasets) ResultMapper

CodesDatasets returns a dpbolt.ResultMapper which converts dpbolt.Result to Datasets

func Edition

func Edition(editionModel *models.Edition) ResultMapper

Edition returns a dpbolt.ResultMapper mapper which converts dpbolt.Result to models.Edition

func Editions

func Editions(editions *models.Editions) ResultMapper

Editions returns a dpbolt.ResultMapper mapper which converts dpbolt.Result to models.Editions

func GetCount

func GetCount() (*int64, ResultMapper)

GetCount returns dpbolt.ResultMapper for extracting an int64 value from a dpbolt.Result

func GetNodeID

func GetNodeID(id *string) ResultMapper

GetNodeID returns dpbolt.ResultMapper for extracting a node id from a dpbolt.Result

func Hierarchy

func Hierarchy(res *models.Response) ResultMapper

Hierarchy returns a dpbolt.ResultMapper mapper which converts dpbolt.Result to models.Response

func HierarchyCodelist

func HierarchyCodelist(codelistID *string) ResultMapper

HierarchyCodelist returns a dpbolt.ResultMapper which converts a dpbolt.Result to CodelistID string

func HierarchyElement

func HierarchyElement(list *HierarchyElements) ResultMapper

HierarchyElement returns a dpbolt.ResultMapper mapper which converts dpbolt.Result to HierarchyElements

type Versions

type Versions []int

Versions contains a list of version IDs

Jump to

Keyboard shortcuts

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