Documentation ¶
Index ¶
- Constants
- Variables
- func DownloadUI() error
- func GeoAutoUpdate() bool
- func GeoUpdateInterval() int
- func LimitReader(r io.Reader, n int64) (limited io.Reader, err error)
- func Min[T constraints.Integer | ~string](x, y T) (res T)
- func RegisterGeoUpdater()
- func SetGeoAutoUpdate(newAutoUpdate bool)
- func SetGeoUpdateInterval(newGeoUpdateInterval int)
- func UpdateASN() (err error)
- func UpdateCore(execPath string) (err error)
- func UpdateGeoDatabases() error
- func UpdateGeoIp() (err error)
- func UpdateGeoSite() (err error)
- func UpdateMMDB() (err error)
- type LimitReachedError
Constants ¶
View Source
const MaxPackageFileSize = 32 * 1024 * 1024
MaxPackageFileSize is a maximum package file length in bytes. The largest package whose size is limited by this constant currently has the size of approximately 32 MiB.
Variables ¶
View Source
var ( ExternalUIURL string ExternalUIPath string AutoDownloadUI bool )
View Source
var ErrGetDatabaseUpdateSkip = errors.New("GEO database is updating, skip")
Functions ¶
func DownloadUI ¶ added in v1.18.9
func DownloadUI() error
func GeoAutoUpdate ¶ added in v1.18.9
func GeoAutoUpdate() bool
func GeoUpdateInterval ¶ added in v1.18.9
func GeoUpdateInterval() int
func LimitReader ¶
LimitReader wraps Reader to make it's Reader stop with ErrLimitReached after n bytes read.
func Min ¶
func Min[T constraints.Integer | ~string](x, y T) (res T)
Min returns the smaller of x or y.
func RegisterGeoUpdater ¶
func RegisterGeoUpdater()
func SetGeoAutoUpdate ¶ added in v1.18.9
func SetGeoAutoUpdate(newAutoUpdate bool)
func SetGeoUpdateInterval ¶ added in v1.18.9
func SetGeoUpdateInterval(newGeoUpdateInterval int)
func UpdateCore ¶
Update performs the auto-updater. It returns an error if the updater failed. If firstRun is true, it assumes the configuration file doesn't exist.
func UpdateGeoDatabases ¶
func UpdateGeoDatabases() error
func UpdateGeoIp ¶ added in v1.18.9
func UpdateGeoIp() (err error)
func UpdateGeoSite ¶ added in v1.18.9
func UpdateGeoSite() (err error)
func UpdateMMDB ¶ added in v1.18.9
func UpdateMMDB() (err error)
Types ¶
type LimitReachedError ¶
type LimitReachedError struct {
Limit int64
}
LimitReachedError records the limit and the operation that caused it.
func (*LimitReachedError) Error ¶
func (lre *LimitReachedError) Error() string
Error implements the [error] interface for *LimitReachedError.
TODO(a.garipov): Think about error string format.
Click to show internal directories.
Click to hide internal directories.