isbn

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2022 License: MIT Imports: 5 Imported by: 0

README

ISBN

Isbn is a package for generating and parsing Isbn values.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrValue  = fmt.Errorf("invalid ISBN value")
	ErrFormat = fmt.Errorf("invalid ISBN format")
)
View Source
var ErrTodo = errors.New("todo")

Functions

This section is empty.

Types

type ISBN

type ISBN [13]byte

func Parse

func Parse(s string) (isbn ISBN, err error)

Parse s into an ISBN 13 or returns an error. Supports the forms ISBN 13 XXXXXXXXXXXXX (XXX-X-XXXX-XXXX-X) and ISBN 10 XXXXXXXXXX (X-XXXX-XXXX-X)

func ParseBytes

func ParseBytes(b []byte) (isbn ISBN, err error)

ParseBytes is like Parse, except it parses a byte slice instead of a string.

func (ISBN) MarshalJSON

func (isbn ISBN) MarshalJSON() ([]byte, error)

func (*ISBN) Scan

func (isbn *ISBN) Scan(v any) (err error)

from SQL

func (ISBN) String

func (isbn ISBN) String() string

func (*ISBN) UnmarshalJSON

func (isbn *ISBN) UnmarshalJSON(b []byte) (err error)

func (ISBN) Value

func (isbn ISBN) Value() (driver.Value, error)

into SQL

Jump to

Keyboard shortcuts

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