disk

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package disk implements storage on disk.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Disk

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

Disk is the base disk type.

func NewStorage

func NewStorage(storPath string) (*Disk, error)

NewStorage returns new storage struct.

func (*Disk) Close

func (d *Disk) Close() error

Close closes storage and removes cached files.

func (*Disk) Delete

func (d *Disk) Delete(item entities.CacheItem) error

Delete deletes item in the storage.

func (*Disk) IsItemExist

func (d *Disk) IsItemExist(hash string) (bool, string)

IsItemExist checks if item in the storage.

func (*Disk) Load

func (d *Disk) Load(hash string) (entities.CacheItem, error)

Load loads item from the storage.

func (*Disk) Save

func (d *Disk) Save(item entities.CacheItem) (bool, error)

Save saves item in the storage.

Jump to

Keyboard shortcuts

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