input

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Input

type Input struct {
	// ID is a unique identifier for the Input. It is optional and helps
	// to find Input data on the client side.
	ID string `json:"id"`

	// Name provides data about a scientific name. Information can be
	// provided by a name-string or be split into separate fields.
	Name `json:"name"`

	// Reference provides data about a reference where the name was
	// mentioned. Information can be provided by a reference-string or
	// be split into separate fields.
	Reference `json:"reference"`
}

@Description Input is used to pass data to the BHLnames API. It contains @Description infromation about a name and a reference where the name was @Description mentioned. Reference can point to a name usage or a @Description nomenclatural event.

func New

func New(gnp gnparser.GNparser, opts ...Option) Input

type Name

type Name struct {
	// NameString is a scientific name as a string. It might be enough to
	// provide only NameString without provided other fields.
	NameString string `json:"nameString,omitempty"`

	// Canonical is the canonical form of a name, meaning the name without
	// authorship or a year.
	Canonical string `json:"canonical,omitempty"`

	// NameAuthors is the authorship of a name.
	NameAuthors string `json:"authors,omitempty"`

	// NameYear is the year of publication for a name.
	NameYear int `json:"year,omitempty"`
}

@Description Name provides data about a scientific name.

type Option

type Option func(*Input)

func OptID

func OptID(s string) Option

func OptNameString

func OptNameString(s string) Option

func OptNameYear

func OptNameYear(i int) Option

func OptRefString

func OptRefString(s string) Option

type Reference

type Reference struct {
	// RefString is a reference as a string. It might be enough to
	// provide only RefString without provided other fields.
	RefString string `json:"refString,omitempty"`

	// RefYear is the year of publication for a reference.
	RefYearStart int `json:"yearStart,omitempty"`

	// RefYear is the year of publication for a reference.
	RefYearEnd int `json:"yearEnd,omitempty"`

	// RefAuthors is the authorship of a reference.
	RefAuthors string `json:"authors,omitempty"`

	// Journal is the title of the journal where the reference was
	// published.
	Journal string `json:"journal,omitempty"`

	// Volume is the volume of the journal where the reference was
	// published.
	Volume int `json:"volume,omitempty"`

	// PageStart is the first page of the reference.
	PageStart int `json:"pageStart,omitempty"`

	// PageEnd is the last page of the reference.
	PageEnd int `json:"pageEnd,omitempty"`
}

@Description Reference provides data about a reference where the name was @Description mentioned.

Jump to

Keyboard shortcuts

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