🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

github.com/tomnomnom/linkheader

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
l

github.com/tomnomnom/linkheader

v0.0.0-20180905144013-02ca5825eb80
100

Supply Chain Security

100

Vulnerability

100

Quality

100

Maintenance

100

License

Version published
Created
Issues
2

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

FAQs

Package last updated on 05 Sep 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts