assetsdir

package
v0.0.0-...-bd88772 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package assetsdir contains code to cleanup the assets dir. We removed the assetsdir in the 3.9.0 development cycle.

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyDir = errors.New("empty assets directory")

ErrEmptyDir indicates that you passed to Cleanup an empty dir.

Functions

This section is empty.

Types

type Result

type Result struct {
	// ASNDatabaseErr is the error of deleting the
	// file containing the old ASN database.
	ASNDatabaseErr error

	// CABundleErr is the error of deleting the file
	// containing the old CA bundle.
	CABundleErr error

	// CountryDatabaseErr is the error of deleting the
	// file containing the old country database.
	CountryDatabaseErr error

	// RmdirErr is the error of deleting the supposedly
	// empty directory that contained assets.
	RmdirErr error
}

Result is the result of a Cleanup run.

func Cleanup

func Cleanup(dir string) (*Result, error)

Cleanup removes data from the assetsdir. This function will try to delete the known assets inside of dir. It then also tries to delete the directory. If the directory is not empty, this operation will fail. That means the user has put some extra data in there and we don't want to remove it.

Returns the Result of cleaning up the assets on success and an error on failure. The only cause of error is passing to this function an empty directory. The Result data structure contains the result of each individual remove operation.

Jump to

Keyboard shortcuts

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