update GeoIP -> GeoIp
This commit is contained in:
parent
f729ea3540
commit
61bd6c6b90
4 changed files with 7 additions and 7 deletions
|
|
@ -16,7 +16,7 @@ pub const HandleWeatherOptions = struct {
|
||||||
cache: *Cache,
|
cache: *Cache,
|
||||||
provider: WeatherProvider,
|
provider: WeatherProvider,
|
||||||
resolver: *Resolver,
|
resolver: *Resolver,
|
||||||
geoip: *@import("../location/GeoIP.zig"),
|
geoip: *@import("../location/GeoIp.zig"),
|
||||||
};
|
};
|
||||||
|
|
||||||
pub fn handleWeather(
|
pub fn handleWeather(
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
const GeoIP = @import("GeoIP.zig");
|
const GeoIp = @import("GeoIp.zig");
|
||||||
const GeoCache = @import("GeoCache.zig");
|
const GeoCache = @import("GeoCache.zig");
|
||||||
const Airports = @import("Airports.zig");
|
const Airports = @import("Airports.zig");
|
||||||
|
|
||||||
|
|
@ -19,11 +19,11 @@ pub const LocationType = enum {
|
||||||
|
|
||||||
pub const Resolver = struct {
|
pub const Resolver = struct {
|
||||||
allocator: std.mem.Allocator,
|
allocator: std.mem.Allocator,
|
||||||
geoip: ?*GeoIP,
|
geoip: ?*GeoIp,
|
||||||
geocache: *GeoCache,
|
geocache: *GeoCache,
|
||||||
airports: ?*Airports,
|
airports: ?*Airports,
|
||||||
|
|
||||||
pub fn init(allocator: std.mem.Allocator, geoip: ?*GeoIP, geocache: *GeoCache, airports: ?*Airports) Resolver {
|
pub fn init(allocator: std.mem.Allocator, geoip: ?*GeoIp, geocache: *GeoCache, airports: ?*Airports) Resolver {
|
||||||
return .{
|
return .{
|
||||||
.allocator = allocator,
|
.allocator = allocator,
|
||||||
.geoip = geoip,
|
.geoip = geoip,
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ const MetNo = @import("weather/MetNo.zig");
|
||||||
const types = @import("weather/types.zig");
|
const types = @import("weather/types.zig");
|
||||||
const Server = @import("http/Server.zig");
|
const Server = @import("http/Server.zig");
|
||||||
const RateLimiter = @import("http/RateLimiter.zig");
|
const RateLimiter = @import("http/RateLimiter.zig");
|
||||||
const GeoIP = @import("location/GeoIP.zig");
|
const GeoIp = @import("location/GeoIp.zig");
|
||||||
const GeoCache = @import("location/GeoCache.zig");
|
const GeoCache = @import("location/GeoCache.zig");
|
||||||
const Airports = @import("location/Airports.zig");
|
const Airports = @import("location/Airports.zig");
|
||||||
const Resolver = @import("location/resolver.zig").Resolver;
|
const Resolver = @import("location/resolver.zig").Resolver;
|
||||||
|
|
@ -45,7 +45,7 @@ pub fn main() !void {
|
||||||
try geolite_downloader.ensureDatabase(allocator, cfg.geolite_path);
|
try geolite_downloader.ensureDatabase(allocator, cfg.geolite_path);
|
||||||
|
|
||||||
// Initialize GeoIP database
|
// Initialize GeoIP database
|
||||||
var geoip = GeoIP.init(cfg.geolite_path) catch |err| {
|
var geoip = GeoIp.init(cfg.geolite_path) catch |err| {
|
||||||
std.log.warn("Failed to load GeoIP database: {}", .{err});
|
std.log.warn("Failed to load GeoIP database: {}", .{err});
|
||||||
std.log.warn("IP-based location resolution will be unavailable", .{});
|
std.log.warn("IP-based location resolution will be unavailable", .{});
|
||||||
return err;
|
return err;
|
||||||
|
|
@ -109,7 +109,7 @@ test {
|
||||||
_ = @import("render/json.zig");
|
_ = @import("render/json.zig");
|
||||||
_ = @import("render/v2.zig");
|
_ = @import("render/v2.zig");
|
||||||
_ = @import("render/custom.zig");
|
_ = @import("render/custom.zig");
|
||||||
_ = @import("location/GeoIP.zig");
|
_ = @import("location/GeoIp.zig");
|
||||||
_ = @import("location/GeoCache.zig");
|
_ = @import("location/GeoCache.zig");
|
||||||
_ = @import("location/Airports.zig");
|
_ = @import("location/Airports.zig");
|
||||||
_ = @import("location/resolver.zig");
|
_ = @import("location/resolver.zig");
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue