Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/benpate/digit
Simple API for building WebFinger resource responses
https://github.com/benpate/digit
Last synced: 3 months ago
JSON representation
Simple API for building WebFinger resource responses
- Host: GitHub
- URL: https://github.com/benpate/digit
- Owner: benpate
- License: apache-2.0
- Created: 2019-04-14T19:09:41.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2024-08-29T17:21:03.000Z (5 months ago)
- Last Synced: 2024-08-29T19:05:40.125Z (5 months ago)
- Language: Go
- Size: 92.8 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# digit 👉
[![GoDoc](https://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](http://pkg.go.dev/github.com/benpate/digit)
[![Version](https://img.shields.io/github/v/release/benpate/digit?include_prereleases&style=flat-square&color=brightgreen)](https://github.com/benpate/digit/releases)
[![Build Status](https://img.shields.io/github/actions/workflow/status/benpate/digit/go.yml?style=flat-square)](https://github.com/benpate/digit/actions/workflows/go.yml)
[![Go Report Card](https://goreportcard.com/badge/github.com/benpate/digit?style=flat-square)](https://goreportcard.com/report/github.com/benpate/digit)
[![Codecov](https://img.shields.io/codecov/c/github/benpate/digit.svg?style=flat-square)](https://codecov.io/gh/benpate/digit)## WebFinger for Go
Digit implements the WebFinger protocol. It includes type definitions for WebFinger data structures, along with some utilities for sending and receiving WebFinger requests## Generating WebFinger Data
Digit provides data types with a simple, chainable API for creating new resources.
``` go
resource := digit.NewResource("acct:[email protected]").
Alias("http://sky.net/sarah").
Alias("http://other.website.com/sarah-connor").
Property("http://sky.net/ns/role", "employee").
Link(RelationTypeProfile, "text/html", "https://sky.net/sarah")result, err := json.Marshal(resource)
```## Retrieving WebFinger Data
Digit can look up WebFinger metadata using a variety of identifiers
``` go
resource, err := digit.Lookup("[email protected]") // Email construction
resource, err := digit.Lookup("[email protected]") // Fediverse "@username" construction
resource, err := digit.Lookup("http://sky.net/sarah") // Canonical URL construction
```## WebFinger Resources
* [https://webfinger.net](https://wefinger.net) - primary website for WebFinger protocol
* [https://tools.ietf.org/html/rfc7033](https://tools.ietf.org/html/rfc7033) - IETF specification## Pull Requests Welcome
Digit is relatively stable and is performing well in [Emissary](https://github.com/EmissarySocial/emissary). However, it is still a work in progress, and will benefit from your experience reports, use cases, and contributions. If you have an idea for making this library better, send in a pull request. We're all in this together! 👉