container

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package container contains interface and register used for torrent approval hash source

Index

Constants

View Source
const DefaultStorageCtxName = "MW_APPROVAL"

DefaultStorageCtxName default ctx name if value from configuration is not set

Variables

View Source
var (

	// ErrContainerDoesNotExist holds error about nonexistent container
	ErrContainerDoesNotExist = errors.New("torrent hash container with that name does not exist")
)

Functions

func Register

func Register(n string, c Builder)

Register used to register specific Builder in registry

Types

type Builder

type Builder func(conf.MapConfig, storage.DataStorage) (Container, error)

Builder function that creates and configures specific container

type Container

type Container interface {
	Approved(context.Context, bittorrent.InfoHash) bool
}

Container holds InfoHash and checks if value approved or not

func GetContainer

func GetContainer(name string, config conf.MapConfig, storage storage.DataStorage) (Container, error)

GetContainer creates Container by its name and provided confBytes

Directories

Path Synopsis
Package directory implements container which checks if hash present in any of torrent file placed in some directory.
Package directory implements container which checks if hash present in any of torrent file placed in some directory.
Package list implements container with pre-defined list of torrent hashes from config file
Package list implements container with pre-defined list of torrent hashes from config file

Jump to

Keyboard shortcuts

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