You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gotosocial/vendor/github.com/tomnomnom/linkheader
kim 7293d6029b
[feature] add paging to account follows, followers and follow requests endpoints (#2186)
1 year ago
..
.gitignore [feature] add paging to account follows, followers and follow requests endpoints (#2186) 1 year ago
.travis.yml [feature] add paging to account follows, followers and follow requests endpoints (#2186) 1 year ago
CONTRIBUTING.mkd [feature] add paging to account follows, followers and follow requests endpoints (#2186) 1 year ago
LICENSE [feature] add paging to account follows, followers and follow requests endpoints (#2186) 1 year ago
README.mkd [feature] add paging to account follows, followers and follow requests endpoints (#2186) 1 year ago
main.go [feature] add paging to account follows, followers and follow requests endpoints (#2186) 1 year ago

README.mkd

Golang Link Header Parser

Library for parsing HTTP Link headers. Requires Go 1.6 or higher.

Docs can be found on the GoDoc page.

Build Status

Basic Example

package main

import (
	"fmt"

	"github.com/tomnomnom/linkheader"
)

func main() {
	header := "<https://api.github.com/user/58276/repos?page=2>; rel=\"next\"," +
		"<https://api.github.com/user/58276/repos?page=2>; rel=\"last\""
	links := linkheader.Parse(header)

	for _, link := range links {
		fmt.Printf("URL: %s; Rel: %s\n", link.URL, link.Rel)
	}
}

// Output:
// URL: https://api.github.com/user/58276/repos?page=2; Rel: next
// URL: https://api.github.com/user/58276/repos?page=2; Rel: last