Documentation
¶
Index ¶
- type SQL
- func (s *SQL) AddBlob(hash string, length int, isStored bool) error
- func (s *SQL) AddSDBlob(sdHash string, sdBlobLength int, sdBlob SdBlob) error
- func (s *SQL) Block(hash string) error
- func (s *SQL) Connect(dsn string) error
- func (s *SQL) Delete(hash string) error
- func (s *SQL) GetBlocked() (map[string]bool, error)
- func (s *SQL) GetHashRange() (string, string, error)
- func (s *SQL) GetStoredHashesInRange(ctx context.Context, start, end bits.Bitmap) (ch chan bits.Bitmap, ech chan error)
- func (s *SQL) HasBlob(hash string) (bool, error)
- func (s *SQL) HasBlobs(hashes []string) (map[string]bool, error)
- func (s *SQL) MissingBlobsForKnownStream(sdHash string) ([]string, error)
- type SdBlob
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SQL ¶
type SQL struct {
// contains filtered or unexported fields
}
SQL implements the DB interface
func (*SQL) AddSDBlob ¶
AddSDBlob insert the SD blob and all the content blobs. The content blobs are marked as "not stored", but they are tracked so reflector knows what it is missing.
func (*SQL) GetBlocked ¶ added in v1.1.0
GetBlocked will return a list of blocked hashes
func (*SQL) GetHashRange ¶
GetHashRange gets the smallest and biggest hashes in the db
func (*SQL) GetStoredHashesInRange ¶
func (s *SQL) GetStoredHashesInRange(ctx context.Context, start, end bits.Bitmap) (ch chan bits.Bitmap, ech chan error)
GetStoredHashesInRange gets stored blobs with hashes in a given range, and sends the hashes into a channel
func (*SQL) HasBlobs ¶
HasBlobs checks if the database contains the set of blobs and returns a bool map.
func (*SQL) MissingBlobsForKnownStream ¶ added in v1.0.3
MissingBlobsForKnownStream returns missing blobs for an existing stream WARNING: if the stream does NOT exist, no blob hashes will be returned, which looks like no blobs are missing
type SdBlob ¶ added in v0.1.2
type SdBlob struct { StreamName string `json:"stream_name"` Blobs []struct { Length int `json:"length"` BlobNum int `json:"blob_num"` BlobHash string `json:"blob_hash,omitempty"` IV string `json:"iv"` } `json:"blobs"` StreamType string `json:"stream_type"` Key string `json:"key"` SuggestedFileName string `json:"suggested_file_name"` StreamHash string `json:"stream_hash"` }
SdBlob is a special blob that contains information on the rest of the blobs in the stream