Documentation ¶
Index ¶
- Constants
- Variables
- func GetLootCredentialDir() string
- func GetLootDir() string
- func GetLootFileDir() string
- type LocalBackend
- func (l *LocalBackend) Add(loot *clientpb.Loot) (*clientpb.Loot, error)
- func (l *LocalBackend) All() *clientpb.AllLoot
- func (l *LocalBackend) AllOf(lootType clientpb.LootType) *clientpb.AllLoot
- func (l *LocalBackend) GetContent(lootID string, eager bool) (*clientpb.Loot, error)
- func (l *LocalBackend) Rm(lootID string) error
- func (l *LocalBackend) Update(lootReq *clientpb.Loot) (*clientpb.Loot, error)
- type LootBackend
- type LootStore
- func (l *LootStore) Add(lootReq *clientpb.Loot) (*clientpb.Loot, error)
- func (l *LootStore) All() *clientpb.AllLoot
- func (l *LootStore) AllOf(lootType clientpb.LootType) *clientpb.AllLoot
- func (l *LootStore) GetContent(lootID string, eager bool) (*clientpb.Loot, error)
- func (l *LootStore) Rm(lootID string) error
- func (l *LootStore) Update(lootReq *clientpb.Loot) (*clientpb.Loot, error)
Constants ¶
View Source
const ( // MaxLootSize - The maximum size of a loot file in bytes MaxLootSize = 2 * 1024 * 1024 * 1024 // 2Gb, shouldn't matter the gRPC message size limit is 2Gb )
Variables ¶
View Source
var ( // ErrInvalidLootID - Invalid Loot ID ErrInvalidLootID = errors.New("invalid loot id") // ErrLootNotFound - Loot not found ErrLootNotFound = errors.New("loot not found") )
Functions ¶
func GetLootCredentialDir ¶
func GetLootCredentialDir() string
GetLootCredentialDir - Get the subdirectory where loot credentials are stored
func GetLootFileDir ¶
func GetLootFileDir() string
GetLootFileDir - Get the subdirectory where loot files are stored
Types ¶
type LocalBackend ¶
LocalBackend - A loot backend that saves files locally to disk
func (*LocalBackend) AllOf ¶
func (l *LocalBackend) AllOf(lootType clientpb.LootType) *clientpb.AllLoot
AllOf - Get all loot of a particular loot type
func (*LocalBackend) GetContent ¶
GetContent - Get the content of a piece of loot
func (*LocalBackend) Rm ¶
func (l *LocalBackend) Rm(lootID string) error
Rm - Remove a piece of loot
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 }
LootBackend - The interface any loot backend must implement
type LootStore ¶
type LootStore struct {
// contains filtered or unexported fields
}
LootStore - The struct that represents the loot store
func GetLootStore ¶
func GetLootStore() *LootStore
GetLootStore - Get an instances of the core LootStore
func (*LootStore) GetContent ¶
GetContent - Get the content of a piece of loot from the loot store
Click to show internal directories.
Click to hide internal directories.