Documentation
¶
Overview ¶
Package nfcfyi provides a Go client for the NFCFYI API.
NFCFYI is a comprehensive NFC reference covering chips, chip families, standards, operating modes, NDEF types, and use cases. This client requires no authentication and has zero external dependencies.
Usage:
client := nfcfyi.NewClient()
result, err := client.Search("ntag")
Index ¶
- Constants
- type ChipDetail
- type ChipFamilyDetail
- type Client
- func (c *Client) Chip(slug string) (*ChipDetail, error)
- func (c *Client) ChipFamily(slug string) (*ChipFamilyDetail, error)
- func (c *Client) Compare(slugA, slugB string) (*CompareResult, error)
- func (c *Client) GlossaryTerm(slug string) (*GlossaryTerm, error)
- func (c *Client) NdefType(slug string) (*NdefTypeDetail, error)
- func (c *Client) OperatingMode(slug string) (*OperatingModeDetail, error)
- func (c *Client) Random() (*ChipDetail, error)
- func (c *Client) Search(query string) (*SearchResult, error)
- func (c *Client) Standard(slug string) (*StandardDetail, error)
- func (c *Client) UseCase(slug string) (*UseCaseDetail, error)
- type CompareResult
- type GlossaryTerm
- type NdefTypeDetail
- type OperatingModeDetail
- type SearchItem
- type SearchResult
- type StandardDetail
- type UseCaseDetail
Constants ¶
const DefaultBaseURL = "https://nfcfyi.com/api"
DefaultBaseURL is the default base URL for the NFCFYI API.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChipDetail ¶
type ChipDetail struct {
Name string `json:"name"`
Slug string `json:"slug"`
Description string `json:"description"`
Family string `json:"family"`
URL string `json:"url"`
}
ChipDetail represents an NFC chip.
type ChipFamilyDetail ¶
type ChipFamilyDetail struct {
Name string `json:"name"`
Slug string `json:"slug"`
Description string `json:"description"`
URL string `json:"url"`
}
ChipFamilyDetail represents an NFC chip family.
type Client ¶
Client is an NFCFYI API client.
func NewClient ¶
func NewClient() *Client
NewClient creates a new NFCFYI API client with default settings.
func (*Client) Chip ¶
func (c *Client) Chip(slug string) (*ChipDetail, error)
Chip returns details for an NFC chip by slug.
func (*Client) ChipFamily ¶
func (c *Client) ChipFamily(slug string) (*ChipFamilyDetail, error)
ChipFamily returns details for an NFC chip family by slug.
func (*Client) Compare ¶
func (c *Client) Compare(slugA, slugB string) (*CompareResult, error)
Compare compares two NFC chips.
func (*Client) GlossaryTerm ¶
func (c *Client) GlossaryTerm(slug string) (*GlossaryTerm, error)
GlossaryTerm returns a glossary term by slug.
func (*Client) NdefType ¶
func (c *Client) NdefType(slug string) (*NdefTypeDetail, error)
NdefType returns details for an NDEF type by slug.
func (*Client) OperatingMode ¶
func (c *Client) OperatingMode(slug string) (*OperatingModeDetail, error)
OperatingMode returns details for an NFC operating mode by slug.
func (*Client) Random ¶
func (c *Client) Random() (*ChipDetail, error)
Random returns a random NFC chip.
func (*Client) Search ¶
func (c *Client) Search(query string) (*SearchResult, error)
Search searches across NFC chips, standards, and glossary terms.
type CompareResult ¶
type CompareResult struct {
ChipA interface{} `json:"chip_a"`
ChipB interface{} `json:"chip_b"`
URL string `json:"url"`
}
CompareResult represents a comparison between two NFC chips.
type GlossaryTerm ¶
type GlossaryTerm struct {
Term string `json:"term"`
Slug string `json:"slug"`
Definition string `json:"definition"`
URL string `json:"url"`
}
GlossaryTerm represents a glossary term.
type NdefTypeDetail ¶
type NdefTypeDetail struct {
Name string `json:"name"`
Slug string `json:"slug"`
Description string `json:"description"`
URL string `json:"url"`
}
NdefTypeDetail represents an NDEF type.
type OperatingModeDetail ¶
type OperatingModeDetail struct {
Name string `json:"name"`
Slug string `json:"slug"`
Description string `json:"description"`
URL string `json:"url"`
}
OperatingModeDetail represents an NFC operating mode.
type SearchItem ¶
type SearchItem struct {
Name string `json:"name"`
Slug string `json:"slug"`
Type string `json:"type"`
URL string `json:"url"`
}
SearchItem represents a single search result item.
type SearchResult ¶
type SearchResult struct {
Query string `json:"query"`
Results []SearchItem `json:"results"`
Total int `json:"total"`
}
SearchResult represents the API search response.