marc

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package marc transforms MARC records in JSON format into a tabular form.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Marc

type Marc struct {
	Line    int16
	Field   string
	Ind1    string
	Ind2    string
	Ord     int16
	SF      string
	Content string
}

Marc is a single "row" of data extracted from part of a MARC record.

func Transform

func Transform(marcjson *string, state string) ([]Marc, string, error)

Transform converts marcjson, a MARC record in JSON format, into a table. Only a MARC record considered to be current is transformed, where current is defined as having state == "ACTUAL" and some content present in 999 ff $i which is presumed to be the FOLIO instance identifer. Transform returns the resultant table as a slice of Marc structs and the instance identifer as a string. If the MARC record is not current, Transform returns an empty slice and the instance identifier as "".

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳