sierraapi

package
v0.7.8 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2015 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (
	//API URL
	DefaultURL string = "https://sandbox.iii.com/iii/sierra-api/v1/"

	//API Endpoints
	TokenRequestEndpoint string = "token"
	BibRequestEndpoint   string = "bibs"
	ItemRequestEndpoint  string = "items"
)

Variables

This section is empty.

Functions

func SendRequestToAPI

func SendRequestToAPI(apiURL, token string, w http.ResponseWriter, r *http.Request) (*http.Response, error)

func SetAuthorizationHeaders

func SetAuthorizationHeaders(nr, or *http.Request, token string) error

Set the required Authorization headers. This includes the Bearer token, User-Agent, and X-Forwarded-For

Types

type BibRecordIn added in v0.7.0

type BibRecordIn struct {
	ID          int       `json:"id"`
	CreatedDate time.Time `json:"createdDate"`
	Marc        struct {
		Fields []struct {
			Data struct {
				Subfields []struct {
					Code string `json:"code"`
					Data string `json:"data"`
				} `json:"subfields"`
			} `json:"data"`
			Tag string `json:"tag"`
		} `json:"fields"`
		Leader string `json:"leader"`
	} `json:"marc"`
}

func (*BibRecordIn) Convert added in v0.7.0

func (in *BibRecordIn) Convert() *BibRecordOut

type BibRecordOut added in v0.7.0

type BibRecordOut struct {
	BibID          int
	TitleAndAuthor string
	ISBNs          []string
	CreatedDate    time.Time
}

type BibRecordsIn added in v0.7.0

type BibRecordsIn struct {
	Entries []BibRecordIn `json:"entries"`
}

func (*BibRecordsIn) Convert added in v0.7.0

func (in *BibRecordsIn) Convert() *BibRecordsOut

type BibRecordsOut added in v0.7.0

type BibRecordsOut []BibRecordOut

func (BibRecordsOut) Len added in v0.7.0

func (records BibRecordsOut) Len() int

func (BibRecordsOut) Less added in v0.7.0

func (records BibRecordsOut) Less(i, j int) bool

func (BibRecordsOut) Swap added in v0.7.0

func (records BibRecordsOut) Swap(i, j int)

type ItemRecordIn

type ItemRecordIn struct {
	CallNumber string `json:"callNumber"`
	Status     struct {
		DueDate time.Time `json:"duedate"`
	} `json:"status"`
	Location struct {
		Name string `json:"name"`
	} `json:"location"`
}

func (*ItemRecordIn) Convert

func (in *ItemRecordIn) Convert() *ItemRecordOut

type ItemRecordOut

type ItemRecordOut struct {
	CallNumber string
	Status     string
	Location   string
}

type ItemRecordsIn

type ItemRecordsIn struct {
	Entries []ItemRecordIn `json:"entries"`
}

func (*ItemRecordsIn) Convert

func (in *ItemRecordsIn) Convert() *ItemRecordsOut

type ItemRecordsOut

type ItemRecordsOut struct {
	Entries []ItemRecordOut
}

Jump to

Keyboard shortcuts

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