Documentation
¶
Index ¶
- Constants
- Variables
- type ErrInvalidFile
- type LocationInfo
- type Locator
- type Number2Ip
- func (g *Number2Ip) ConfigOptions() []Option
- func (g *Number2Ip) Description() string
- func (g *Number2Ip) RawTransform(datas []string) ([]string, error)
- func (g *Number2Ip) SampleConfig() string
- func (g *Number2Ip) Stage() string
- func (g *Number2Ip) Stats() StatsInfo
- func (g *Number2Ip) Transform(datas []Data) ([]Data, error)
- func (g *Number2Ip) Type() string
- type Transformer
- func (_ *Transformer) ConfigOptions() []Option
- func (_ *Transformer) Description() string
- func (_ *Transformer) RawTransform(datas []string) ([]string, error)
- func (_ *Transformer) SampleConfig() string
- func (t *Transformer) Stage() string
- func (t *Transformer) Stats() StatsInfo
- func (t *Transformer) Transform(datas []Data) ([]Data, error)
- func (_ *Transformer) Type() string
Constants ¶
View Source
const ( Region = "Region" City = "City" Country = "Country" Isp = "Isp" CountryCode = "CountryCode" Latitude = "Latitude" Longitude = "Longitude" DistrictCode = "DistrictCode" )
View Source
const Name = "IP"
View Source
const Null = "N/A"
Variables ¶
View Source
var ErrInvalidIP = errors.New("invalid IP format")
Functions ¶
This section is empty.
Types ¶
type ErrInvalidFile ¶ added in v1.5.0
func (ErrInvalidFile) Error ¶ added in v1.5.0
func (e ErrInvalidFile) Error() string
type LocationInfo ¶ added in v1.5.0
type LocationInfo struct {
Country string
Region string
City string
Isp string
CountryCode string
Latitude string
Longitude string
DistrictCode string
}
LocationInfo stores IP location information.
type Locator ¶ added in v1.5.0
type Locator interface {
Find(string) (*LocationInfo, error)
}
Locator represents an IP information loc.
func NewLocator ¶ added in v1.5.0
NewLocator returns a new IP locator based on extension of given data file.
type Number2Ip ¶ added in v1.5.0
type Number2Ip struct {
Key string `json:"key"`
New string `json:"new"`
// contains filtered or unexported fields
}
func (*Number2Ip) ConfigOptions ¶ added in v1.5.0
func (g *Number2Ip) ConfigOptions() []Option
func (*Number2Ip) Description ¶ added in v1.5.0
func (*Number2Ip) RawTransform ¶ added in v1.5.0
func (*Number2Ip) SampleConfig ¶ added in v1.5.0
type Transformer ¶ added in v1.5.0
type Transformer struct {
StageTime string `json:"stage"`
Key string `json:"key"`
DataPath string `json:"data_path"`
KeyAsPrefix bool `json:"key_as_prefix"`
// contains filtered or unexported fields
}
func (*Transformer) ConfigOptions ¶ added in v1.5.0
func (_ *Transformer) ConfigOptions() []Option
func (*Transformer) Description ¶ added in v1.5.0
func (_ *Transformer) Description() string
func (*Transformer) RawTransform ¶ added in v1.5.0
func (_ *Transformer) RawTransform(datas []string) ([]string, error)
func (*Transformer) SampleConfig ¶ added in v1.5.0
func (_ *Transformer) SampleConfig() string
func (*Transformer) Stage ¶ added in v1.5.0
func (t *Transformer) Stage() string
func (*Transformer) Stats ¶ added in v1.5.0
func (t *Transformer) Stats() StatsInfo
func (*Transformer) Transform ¶ added in v1.5.0
func (t *Transformer) Transform(datas []Data) ([]Data, error)
func (*Transformer) Type ¶ added in v1.5.0
func (_ *Transformer) Type() string
Click to show internal directories.
Click to hide internal directories.