teleattr

package
v0.0.0-...-9799186 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidNumber = errors.New("invalid phone number")
View Source
var ErrNotFound = errors.New("phone number attribution not found")

Functions

This section is empty.

Types

type Index

type Index struct {
	Prefix      int
	RecordIndex int
	Record      *Record
	Vendor      VendorType
}

func (Index) String

func (idx Index) String() string

type PhoneData

type PhoneData struct {
	Version string
	Index   []Index
	Records []Record
}

func LoadBytes

func LoadBytes(b []byte) (*PhoneData, error)

func LoadFile

func LoadFile(f string) (*PhoneData, error)

func (*PhoneData) Search

func (p *PhoneData) Search(num string) (*Index, error)

type Record

type Record struct {
	Zip    string
	Zone   string
	Prov   string
	City   string
	Offset int
}

func (Record) String

func (r Record) String() string

type VendorType

type VendorType byte
const (
	CMCC  VendorType = iota + 0x01 // 中国移动
	CUCC                           // 中国联通
	CTCC                           // 中国电信
	CTCCV                          // 电信虚拟运营商
	CUCCV                          // 联通虚拟运营商
	CMCCV                          // 移动虚拟运营商
)

func (VendorType) String

func (b VendorType) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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