loot

package
v1.4.18 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2021 License: GPL-3.0 Imports: 12 Imported by: 2

README

Loot

This packages implements the server's Loot interfaces and local storage backend.

Documentation

Index

Constants

View Source
const (
	MaxLootSize = 2 * 1024 * 1024 * 1024 // 2Gb, shouldn't matter the gRPC message size limit is 2Gb
)

Variables

View Source
var (
	ErrInvalidLootID = errors.New("invalid loot id")
	ErrLootNotFound  = errors.New("loot not found")
)

Functions

func GetLootCredentialDir

func GetLootCredentialDir() string

func GetLootDir

func GetLootDir() string

func GetLootFileDir

func GetLootFileDir() string

Types

type LocalBackend

type LocalBackend struct {
	LocalFileDir string
	LocalCredDir string
}

func (*LocalBackend) Add

func (l *LocalBackend) Add(loot *clientpb.Loot) (*clientpb.Loot, error)

func (*LocalBackend) All

func (l *LocalBackend) All() *clientpb.AllLoot

func (*LocalBackend) AllOf

func (l *LocalBackend) AllOf(lootType clientpb.LootType) *clientpb.AllLoot

func (*LocalBackend) GetContent

func (l *LocalBackend) GetContent(lootID string, eager bool) (*clientpb.Loot, error)

func (*LocalBackend) Rm

func (l *LocalBackend) Rm(lootID string) error

func (*LocalBackend) Update

func (l *LocalBackend) Update(lootReq *clientpb.Loot) (*clientpb.Loot, error)

type LootBackend

type LootBackend interface {
	Add(*clientpb.Loot) (*clientpb.Loot, error)
	Rm(string) error
	Update(*clientpb.Loot) (*clientpb.Loot, error)
	GetContent(string, bool) (*clientpb.Loot, error)
	All() *clientpb.AllLoot
	AllOf(clientpb.LootType) *clientpb.AllLoot
}

type LootStore

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

func GetLootStore

func GetLootStore() *LootStore

func (*LootStore) Add

func (l *LootStore) Add(lootReq *clientpb.Loot) (*clientpb.Loot, error)

func (*LootStore) All

func (l *LootStore) All() *clientpb.AllLoot

func (*LootStore) AllOf

func (l *LootStore) AllOf(lootType clientpb.LootType) *clientpb.AllLoot

func (*LootStore) GetContent

func (l *LootStore) GetContent(lootID string, eager bool) (*clientpb.Loot, error)

func (*LootStore) Rm

func (l *LootStore) Rm(lootID string) error

func (*LootStore) Update

func (l *LootStore) Update(lootReq *clientpb.Loot) (*clientpb.Loot, error)

Jump to

Keyboard shortcuts

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