Documentation ¶
Overview ¶
Package blockdigest stores a Block Locator Digest compactly. Can be used as a map key.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var LocatorPattern = regexp.MustCompile(
"^[0-9a-fA-F]{32}\\+[0-9]+(\\+[A-Z][A-Za-z0-9@_-]*)*$")
Functions ¶
Types ¶
type BlockDigest ¶
BlockDigest stores a Block Locator Digest compactly, up to 128 bits. Can be used as a map key.
func FromString ¶
func FromString(s string) (dig BlockDigest, err error)
FromString creates a new BlockDigest unless an error is encountered.
func MakeTestBlockDigest ¶
func MakeTestBlockDigest(i int) BlockDigest
MakeTestBlockDigest is used for testing with distinct BlockDigests
func (BlockDigest) String ¶
func (d BlockDigest) String() string
type BlockLocator ¶
type BlockLocator struct { Digest BlockDigest Size int Hints []string }
func ParseBlockLocator ¶
func ParseBlockLocator(s string) (BlockLocator, error)
type DigestWithSize ¶
type DigestWithSize struct { Digest BlockDigest Size uint32 }
func MakeTestDigestSpecifySize ¶
func MakeTestDigestSpecifySize(i int, s int) DigestWithSize
func MakeTestDigestWithSize ¶
func MakeTestDigestWithSize(i int) DigestWithSize
func (DigestWithSize) String ¶
func (w DigestWithSize) String() string
Click to show internal directories.
Click to hide internal directories.