Documentation ¶
Index ¶
- Variables
- func NewProviderRefreshModule(name string, settings RefreshSettings) kernel.ModuleFactory
- func NewReader(ctx context.Context, config cfg.Config, logger log.Logger, name string) (*reader, error)
- func ProvideMemoryProvider(name string) *memoryProvider
- func ProvideReader(ctx context.Context, config cfg.Config, logger log.Logger, name string) (*reader, error)
- func RefreshModuleFactory(ctx context.Context, config cfg.Config, logger log.Logger) (map[string]kernel.ModuleFactory, error)
- type GeoCity
- type MaxmindSettings
- type MemoryRecord
- type Provider
- type ProviderFactory
- type Reader
- type ReaderSettings
- type RefreshModule
- type RefreshSettings
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrIpParseFailed = errors.New("failed to parse geo ip") ErrIpNotFound = errors.New("ip not found") )
Functions ¶
func NewProviderRefreshModule ¶ added in v0.15.5
func NewProviderRefreshModule(name string, settings RefreshSettings) kernel.ModuleFactory
func ProvideMemoryProvider ¶
func ProvideMemoryProvider(name string) *memoryProvider
func ProvideReader ¶ added in v0.15.5
Types ¶
type MaxmindSettings ¶ added in v0.15.5
type MemoryRecord ¶
type Provider ¶
type Provider interface { City(ipAddress net.IP) (*geoip2.City, error) Refresh(ctx context.Context) error Close() error }
func NewMaxmindProvider ¶
type ProviderFactory ¶
type ReaderSettings ¶
type ReaderSettings struct { Provider string `cfg:"provider" default:"maxmind"` Refresh RefreshSettings `cfg:"refresh"` }
type RefreshModule ¶ added in v0.15.5
type RefreshModule struct { kernel.BackgroundModule kernel.ServiceStage kernel.HealthCheckedModule // contains filtered or unexported fields }
type RefreshSettings ¶ added in v0.15.5
Source Files ¶
Click to show internal directories.
Click to hide internal directories.