Package carrier provides a way for carrier identification based on IP addresses.
binary.go carrier.go carrier_web.go tree.go
ApiVersion Public API versioning.
const ApiVersion string = "1.3.0"
func Detect(f *DaGo, headers map[string]string) (map[string]interface{}, error)
Detect returns a map of carrier properties from HTTP headers.
func DetectHttpRequest(f *DaGo, req *http.Request) (map[string]interface{}, error)
DetectHttpRequest returns a map of carrier properties using a DaGo and http.Request instances.
func DetectV(f *DaGo, params ...string) (map[string]interface{}, error)
DetectV returns a map of carrier properties from HTTP headers (variadic version).
func Free(f *DaGo)
Free releases the DaGo resource (compatibility layer for device api).
func LoadDataFromFile(f *DaGo, path string) (int, error)
LoadDataFromFile loads (and/or re-loads) the data file from a given path.
A DaError describes a custom error handled by the carrier API.
type DaError struct {
// contains filtered or unexported fields
}
func (a DaError) Error() string
A DaGo describes the main type for the API's lifetime.
type DaGo struct {
Cd *carrierData // Binary file data's holder place
}
func New() *DaGo
New creates a DaGo instance.
func (f *DaGo) Detect(headers map[string]string) (map[string]interface{}, error)
Detect returns a map of carrier properties from HTTP headers.
func (f *DaGo) DetectHttpRequest(req *http.Request) (map[string]interface{}, error)
DetectHttpRequest returns a map of carrier properties using a DaGo and http.Request instances.
func (f *DaGo) DetectV(params ...string) (map[string]interface{}, error)
DetectV returns a map of carrier properties from HTTP headers (variadic version).
func (f *DaGo) Free()
Free compatibility layer for device API.
func (f *DaGo) LoadDataFromFile(path string) (int, error)
LoadDataFromFile loads (and/or re-loads) the data file from a given path.