storage

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FilesystemProvider

type FilesystemProvider struct {
	Config config.StorageProvider
}

func (FilesystemProvider) DeleteRecords

func (fsp FilesystemProvider) DeleteRecords(subfolder string, hashes []string) error

func (FilesystemProvider) GetHashes

func (fsp FilesystemProvider) GetHashes(subfolder string) ([]string, error)

func (FilesystemProvider) GetHostsAndHashes

func (fsp FilesystemProvider) GetHostsAndHashes() ([]HostAndHashes, error)

func (FilesystemProvider) InsertRecords

func (fsp FilesystemProvider) InsertRecords(subfolder string, hashes []string, records [][]byte, isRegenerate bool) error

func (FilesystemProvider) ReadRecords

func (fsp FilesystemProvider) ReadRecords(subfolder string, hashes []string) ([][]byte, error)

type HostAndHashes

type HostAndHashes struct {
	Host      string   `json:"host"`
	HashCount int      `json:"hash_count"`
	Hashes    []string `json:"hashes"`
}

type Provider

type Provider interface {
	ReadRecords(subfolder string, hashes []string) ([][]byte, error)
	InsertRecords(subfolder string, hashes []string, records [][]byte, isRegenerate bool) error
	DeleteRecords(subfolder string, hashes []string) error
	GetHashes(subfolder string) ([]string, error)
	GetHostsAndHashes() ([]HostAndHashes, error)
}

func ProviderFactory

func ProviderFactory(config config.StorageProvider) (Provider, error)

Jump to

Keyboard shortcuts

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