db

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Path     string
	Username string
	Pwd      string
}

func NewDBConfig

func NewDBConfig(prefix string) *Config

NewConfig creates a Config with values from environment variables.

type CsvDb

type CsvDb struct {
	// contains filtered or unexported fields
}

func (*CsvDb) GetLocation

func (db *CsvDb) GetLocation(Ip string) Location

Implement db interface

type DB

type DB interface {
	GetLocation(ip string) Location
}

func NewCsvDb

func NewCsvDb() DB

Initialize new instance of CSV database

type Location

type Location struct {
	Country, City string
}

Jump to

Keyboard shortcuts

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