lib

package
v0.0.0-...-4702d67 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool_to_int

func Bool_to_int(input bool) int

func Build_DSN

func Build_DSN(cfg *config.Config) (string, string)

func Config_path

func Config_path(input string) string

func DB_AutoInc

func DB_AutoInc(dbtype string) string

func DB_Random

func DB_Random(dbtype string) string

func IPfamilies

func IPfamilies(host string) map[int]int

func IPversion

func IPversion(ip string) string

func InitDatabase

func InitDatabase(dbh *sqlx.DB) bool

func Load_config

func Load_config(path string) (*config.Config, bool)

func Name_to_ip

func Name_to_ip(host string) net.IP

func TableCount

func TableCount(dbh *sqlx.DB, database string) int

Types

type CacheStats

type CacheStats struct {
	Entries     int64
	HitCount    int64
	MissCount   int64
	LookupCount int64
}

type CheckResult

type CheckResult struct {
	MirrorID  int
	RepoID    int
	Timestamp int64
	Result    int
}

type CheckTask

type CheckTask struct {
	MirrorID int
	RepoID   int
	URL      string
	Iso      bool
	AltArch  bool
	Valid    bool
}

type Issue

type Issue struct {
	Name   string         `json:"name"`
	Errors map[string]int `json:"errors"`
}

type Location

type Location struct {
	Known     bool
	Continent string // One of: AF, AN, AS, EU, NA, OC, SA
	// https://dev.maxmind.com/geoip/geoip2/geoip2-city-country-csv-databases/
	Country   string  // ISO 3166-1 Code
	Region    string  // ISO 3166-2 Code Subdivision (US state, Canadian province, etc.)
	Longitude float64 // Currently unused
	Latitude  float64 // Currently unused
}

type Mirror

type Mirror struct {
	ID         int     `json:"id" db:"mirror_id"`
	Name       string  `json:"name"`
	Basedir    string  `json:"basedir"`
	BasedirAlt string  `json:"basedir_altarch" db:"basedir_altarch"`
	IPv4       int     `json:"ipv4" db:"ipv4"`
	IPv6       int     `json:"ipv6" db:"ipv6"`
	HTTP       int     `json:"http" db:"http"`
	HTTPS      int     `json:"https" db:"https"`
	Rsync      int     `json:"rsync" db:"rsync"`
	Continent  string  `json:"continent" db:"continent"`
	Country    string  `json:"country" db:"country"`
	Region     string  `json:"region" db:"region"`
	Latitude   float64 `json:"latitude" db:"latitude"`
	Longitude  float64 `json:"longitude" db:"longitude"`
	Enabled    bool    `json:"enabled" db:"enabled"`
}

type Repo

type Repo struct {
	ID       int    `json:"id" db:"repo_id"`
	MRelease int    `json:"release" db:"major_release"`
	Path     string `json:"path" db:"path"`
	Name     string `json:"name" db:"name"`
	Arch     string `json:"arch" db:"arch"`
	Altarch  bool   `json:"is_altarch" db:"is_altarch"`
	Enabled  bool   `json:"enabled" db:"enabled"`
}

Jump to

Keyboard shortcuts

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