downloader

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package downloader is a package for downloading wnjpn db file.

Index

Constants

View Source
const (
	// WordNet Japan database archive file URL
	WNJPN_DB_ARCHIVE_FILE_URL = "https://github.com/bond-lab/wnja/releases/download/v1.1/wnjpn.db.gz"
	// WordNet Japan database archive file name
	WNJPN_DB_ARCHIVE_FILE_NAME = "wnjpn.db.gz"
	// WordNet Japan sqlite database file name
	WNJPN_DB_FILE_NAME = "wnjpn.db"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DownloadStatus

type DownloadStatus int

DownloadStatus is a type for download status

const (
	// DownloadedSuccessfully is a status for downloaded successfully
	DownloadedSuccessfully DownloadStatus = iota
	// DownloadedFailed is a status for downloaded failed
	DownloadedFailed
	// DownloadedAlready is a status for downloaded already
	DownloadedAlready
)

type Downloadable

type Downloadable interface {
	DownloadWNJpnDBFile(wnJpnDBFileDirPath string) (DownloadStatus, error)
}

Downloadable is an interface that provides a function to download wnjpn db file.

type Downloader

type Downloader struct {
	FilepathProxy filepathproxy.FilePath
	GzipProxy     gzipproxy.Gzip
	HttpProxy     httpproxy.Http
	IoProxy       ioproxy.Io
	OsProxy       osproxy.Os
	Utility       utility.UtilityInterface
}

Downloader is a struct that implements Downloadable interface.

func New

func New(
	filepathProxy filepathproxy.FilePath,
	gzipProxy gzipproxy.Gzip,
	httpProxy httpproxy.Http,
	ioProxy ioproxy.Io,
	osProxy osproxy.Os,
	utility utility.UtilityInterface,
) *Downloader

New is a constructor of Downloader.

func (*Downloader) DownloadWNJpnDBFile

func (d *Downloader) DownloadWNJpnDBFile(wnJpnDBFileDirPath string) (DownloadStatus, error)

DownloadWNJpnDBFile downloads wnjpn db file.

Jump to

Keyboard shortcuts

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