taguri

package module
v0.0.0-...-3ddc006 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2024 License: MIT Imports: 2 Imported by: 0

README

go-taguri

Package taguri provides tools for working with hex color codes, for the Go programming language. Package taguri provides tools to work with tag-URIs, as defined by IETF RFC 4151, for the Go programming language.

Documention

Online documentation, which includes examples, can be found at: http://godoc.org/github.com/reiver/go-taguri

GoDoc

Import

To import package taguri use import code like the follownig:

import "github.com/reiver/go-taguri"

Installation

To install package taguri do the following:

GOPROXY=direct go get https://github.com/reiver/go-taguri

Author

Package taguri was written by Charles Iliya Krempeaux

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(dst *TagURI, value string) error

Types

type TagURI

type TagURI struct {
	AuthorityName string
	Date          string
	Specific      string
	Fragment      string
}

TagURI represents a tag-URI.

Some example tag-URIs include:

tag:example.com,2024-03-01:note-q744cpgu2s3n7x3

tag:joeblow@,2024-03-01:0x8b52d56e53ca7a4fa86ae860888c6611

tag:blogger.com,1999:blog-555

tag:my-ids.com,2001-09-15:JaneDoe:presentations:UBath2004-05-19

Tag-URIs are a method of creating unique identifiers.

From IETF RFC-4151 —

“A tag is a type of Uniform Resource Identifier (URI) [1] designed to meet the following requirements:”

“1. Identifiers are likely to be unique across space and time, and come from a practically inexhaustible supply.”

“2. Identifiers are relatively convenient for humans to mint (create), read, type, remember etc.”

“3. No central registration is necessary, at least for holders of domain names or email addresses; and there is negligible cost to mint each new identifier.”

“4. The identifiers are independent of any particular resolution scheme.”

func (TagURI) String

func (receiver TagURI) String() string

String returns the (serialized) tag-URI, based on the data in the 'receiver'.

For example, this:

var tag taguri.TagURI = taguri.TagURI{
	AuthorityName: "example.com",
	Date:          "2024-03-08",
	Specific:      "note-EY7NjqnYtc",
}

// ...

fmt.Println(tag.String())

Would output:

tag:example.com,2024-03-08:note-EY7NjqnYtc

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL