Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

link

Build Status

Parses "Link" headers used for pagination, as defined in rfc5988.

Installation

go get github.com/swhite24/link

Usage

r, _ := http.NewRequest("GET", "", nil)
r.Header.Add("Link", "<https://github.com/ghapi/search/code?q=addClass+user%3Amozilla&page=2>; rel=\"next\""+
	", <https://github.com/ghapi/search/code?q=addClass+user%3Amozilla&page=34>; rel=\"last\"")

group := Parse(r)

for rel, link := range group {
    fmt.Println("rel:", rel)
    fmt.Println("uri:", link.URI)
    fmt.Println("link title", link.Extra["title"])
}

License

See LICENSE.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages