Documentation
¶
Overview ¶
Package blefyi provides a Go client for the BLEFYI API.
BLEFYI is a comprehensive Bluetooth Low Energy reference covering chips, profiles, versions, beacons, use cases, and manufacturers. This client requires no authentication and has zero external dependencies.
Usage:
client := blefyi.NewClient()
result, err := client.Search("heart rate")
Index ¶
- Constants
- type BeaconDetail
- type ChipDetail
- type Client
- func (c *Client) Beacon(slug string) (*BeaconDetail, error)
- func (c *Client) Chip(slug string) (*ChipDetail, error)
- func (c *Client) Compare(slugA, slugB string) (*CompareResult, error)
- func (c *Client) GlossaryTerm(slug string) (*GlossaryTerm, error)
- func (c *Client) Manufacturer(slug string) (*ManufacturerDetail, error)
- func (c *Client) Profile(slug string) (*ProfileDetail, error)
- func (c *Client) Random() (*ChipDetail, error)
- func (c *Client) Search(query string) (*SearchResult, error)
- func (c *Client) Usecase(slug string) (*UsecaseDetail, error)
- func (c *Client) Version(slug string) (*VersionDetail, error)
- type CompareResult
- type GlossaryTerm
- type ManufacturerDetail
- type ProfileDetail
- type SearchItem
- type SearchResult
- type UsecaseDetail
- type VersionDetail
Constants ¶
const DefaultBaseURL = "https://blefyi.com/api"
DefaultBaseURL is the default base URL for the BLEFYI API.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BeaconDetail ¶
type BeaconDetail struct {
Name string `json:"name"`
Slug string `json:"slug"`
Description string `json:"description"`
URL string `json:"url"`
}
BeaconDetail represents a BLE beacon type.
type ChipDetail ¶
type ChipDetail struct {
Name string `json:"name"`
Slug string `json:"slug"`
Description string `json:"description"`
Manufacturer string `json:"manufacturer"`
URL string `json:"url"`
}
ChipDetail represents a BLE chip.
type Client ¶
Client is a BLEFYI API client.
func NewClient ¶
func NewClient() *Client
NewClient creates a new BLEFYI API client with default settings.
func (*Client) Beacon ¶
func (c *Client) Beacon(slug string) (*BeaconDetail, error)
Beacon returns details for a BLE beacon type by slug.
func (*Client) Chip ¶
func (c *Client) Chip(slug string) (*ChipDetail, error)
Chip returns details for a BLE chip by slug.
func (*Client) Compare ¶
func (c *Client) Compare(slugA, slugB string) (*CompareResult, error)
Compare compares two BLE chips.
func (*Client) GlossaryTerm ¶
func (c *Client) GlossaryTerm(slug string) (*GlossaryTerm, error)
GlossaryTerm returns a glossary term by slug.
func (*Client) Manufacturer ¶
func (c *Client) Manufacturer(slug string) (*ManufacturerDetail, error)
Manufacturer returns details for a BLE manufacturer by slug.
func (*Client) Profile ¶
func (c *Client) Profile(slug string) (*ProfileDetail, error)
Profile returns details for a BLE profile by slug.
func (*Client) Random ¶
func (c *Client) Random() (*ChipDetail, error)
Random returns a random BLE chip.
func (*Client) Search ¶
func (c *Client) Search(query string) (*SearchResult, error)
Search searches across BLE chips, profiles, 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 BLE 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 ManufacturerDetail ¶
type ManufacturerDetail struct {
Name string `json:"name"`
Slug string `json:"slug"`
Description string `json:"description"`
URL string `json:"url"`
}
ManufacturerDetail represents a BLE manufacturer.
type ProfileDetail ¶
type ProfileDetail struct {
Name string `json:"name"`
Slug string `json:"slug"`
Description string `json:"description"`
URL string `json:"url"`
}
ProfileDetail represents a BLE profile.
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.