Skip to content

Latest commit

 

History

History
38 lines (26 loc) · 591 Bytes

README.md

File metadata and controls

38 lines (26 loc) · 591 Bytes

webfinger

Webfinger server & client library for Go

Client

u := "https://example.com" + webfinger.DefaultPath

c, err := webfinger.NewClient(u)
if err != nil {
    panic(err)
}

q := webfinger.NewQuery("https://blog.example.com/article/id/314")

r, err := c.Query(q)
if err != nil {
    panic(err)
}

// do something with r

Server

// implement DB interface or use webfinger.MemDB
func getDB() webfinger.DB {
    ...
}

h := webfinger.NewHandler(getDB(), webfinger.WithAllowOrigin("*"))

http.Handle(webfinger.DefaultPath, h)

http.ListenAndServe(":8080", nil)