doi

package module
Version: v0.0.0-...-1a5819c Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2017 License: MIT Imports: 1 Imported by: 0

README

doi

GoDoc

dealing with dois in go

Usage

d, err := doi.Parse("11.1038/123456")
if err != nil {
    println(d.ToString())
}
if d.IsValid() {
    println("We are happy!")
}

Documentation

Overview

Package doi is a library for parsing and dealing with digital object identifiers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DigitalObjectIdentifier

type DigitalObjectIdentifier struct {
	General            string
	DirectoryIndicator string
	RegistrantCode     string
}

DigitalObjectIdentifier is a struct that contains the three fields of a doi: https://www.doi.org/doi_handbook/2_Numbering.html#2.2

func Parse

func Parse(doi string) (DigitalObjectIdentifier, error)

Parse takes a string as input and attempts to parse a valid doi from it. The parsing is done to conform to the standard outlined in https://www.doi.org/doi_handbook/2_Numbering.html#2.2.

func (DigitalObjectIdentifier) IsValid

func (d DigitalObjectIdentifier) IsValid() bool

IsValid checks to see if a DigitalObjectIdentifier is valid or not.

func (DigitalObjectIdentifier) ToString

func (d DigitalObjectIdentifier) ToString() (string, error)

ToString creates a string representation of a DigitalObjectIdentifier.

Source Files

Jump to

Keyboard shortcuts

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