updater

package
v1.111.3 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: GPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

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 DefaultUiUpdater = &UIUpdater{}
View Source
var ErrGetDatabaseUpdateSkip = errors.New("GEO database is updating, skip")

Functions

func GeoAutoUpdate

func GeoAutoUpdate() bool

func GeoUpdateInterval

func GeoUpdateInterval() int

func LimitReader

func LimitReader(r io.Reader, n int64) (limited io.Reader, err error)

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

func SetGeoAutoUpdate(newAutoUpdate bool)

func SetGeoUpdateInterval

func SetGeoUpdateInterval(newGeoUpdateInterval int)

func UpdateASN

func UpdateASN() (err error)

func UpdateCore

func UpdateCore(execPath string) (err error)

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

func UpdateGeoIp() (err error)

func UpdateGeoSite

func UpdateGeoSite() (err error)

func UpdateMMDB

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.

type UIUpdater

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

func NewUiUpdater

func NewUiUpdater(externalUI, externalUIURL, externalUIName string) *UIUpdater

func (*UIUpdater) AutoDownloadUI

func (u *UIUpdater) AutoDownloadUI()

func (*UIUpdater) DownloadUI

func (u *UIUpdater) DownloadUI() error

Jump to

Keyboard shortcuts

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