Documentation ¶
Overview ¶
Package uri provides support for NDEF Payloads of URI type. It follows the NFC Forum URI Record Type Definition specification (NFCForum-TS-RTD_URI_1.0).
The Payload type implements the RecordPayload interface from ndef, so it can be used as ndef.Record.Payload.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var URIProtocols = map[byte]string{
0: "",
1: "http://www.",
2: "https://www.",
3: "http://",
4: "https://",
5: "tel:",
6: "mailto:",
7: "ftp://anonymous:anonymous@",
8: "ftp://ftp.",
9: "ftps://",
10: "sftp://",
11: "smb://",
12: "nfs://",
13: "ftp://",
14: "dev://",
15: "news:",
16: "telnet://",
17: "imap:",
18: "rtsp://",
19: "urn:",
20: "pop:",
21: "sip:",
22: "sips:",
23: "tftp:",
24: "btspp://",
25: "btl2cap://",
26: "btgoep://",
27: "tcpobex://",
28: "irdaobex://",
29: "file://",
30: "urn:epc:id:",
31: "urn:epc:tag:",
32: "urn:epc:pat:",
33: "urn:epc:raw:",
34: "urn:epc:",
35: "urn:nfc:",
}
URIProtocols provides a mapping between the first byte if a NDEF Payload of type "U" (URI) and the string value for the protocol.
Functions ¶
This section is empty.
Types ¶
type Payload ¶
Payload represents a NDEF Record Payload of Type "U".
func New ¶
New returns a pointer to an Payload object. The Identifier code is automatically set based on the provided string.
func (*Payload) Marshal ¶
Marshal returns the bytes representing the payload of a Record of URI type.
Click to show internal directories.
Click to hide internal directories.