Documentation
¶
Index ¶
- Constants
- Variables
- func DebugCompareBlobs(ctx errors.Context, blobStore interfaces.BlobStore, expectedSha interfaces.Sha, ...)
- func GetPool() interfaces.Pool[Sha, *Sha]
- func MakeErrIsNull(s *Sha) error
- func MakeHashWriter() (h hash.Hash)
- func MakeReadCloser(r io.Reader) (src readCloser)
- func MakeReadCloserTee(r io.Reader, w io.Writer) (src readCloser)
- func MakeWriter(in io.Writer) (out *writer)
- func PageIndexForSha(width uint8, s interfaces.Sha) (n uint8, err error)
- func PageIndexForString(width uint8, s string) (n uint8, err error)
- type Bytes
- type ErrNotEqual
- type PageId
- type PathComponents
- type ReadCloser
- type Sha
- func FromFormatString(f string, vs ...interface{}) *Sha
- func FromHash(h hash.Hash) (s *Sha)
- func FromStringContent(s string) *Sha
- func FromStringer(v interfaces.Stringer) *Sha
- func Make(getter interfaces.ShaGetter) *Sha
- func MakeSha(v string) (s *Sha, err error)
- func MakeShaFromPath(p string) (s *Sha, err error)
- func Must(v string) (s *Sha)
- func (a *Sha) AssertEqualsShaLike(b interfaces.Sha) error
- func (a *Sha) Equals(b *Sha) bool
- func (a *Sha) EqualsAny(b any) bool
- func (a *Sha) EqualsSha(b interfaces.Sha) bool
- func (s *Sha) GetBytes() Bytes
- func (s *Sha) GetHead() string
- func (s *Sha) GetShaBytes() []byte
- func (s *Sha) GetShaLike() interfaces.Sha
- func (s *Sha) GetShaString() string
- func (s *Sha) GetTail() string
- func (s *Sha) IsNull() bool
- func (s *Sha) MarshalBinary() (text []byte, err error)
- func (s *Sha) MarshalText() (text []byte, err error)
- func (s *Sha) Path(pc ...string) string
- func (s *Sha) ReadAtFrom(r io.ReaderAt, start int64) (n int64, err error)
- func (s *Sha) ReadFrom(r io.Reader) (n int64, err error)
- func (s *Sha) Reset()
- func (a *Sha) ResetWith(b *Sha)
- func (a *Sha) ResetWithShaLike(b interfaces.Sha)
- func (s *Sha) Set(v string) (err error)
- func (dst *Sha) SetFromHash(h hash.Hash) (err error)
- func (s *Sha) SetFromPath(p string) (err error)
- func (s *Sha) SetHexBytes(b []byte) (err error)
- func (s *Sha) SetParts(a, b string) (err error)
- func (dst *Sha) SetShaLike(src ShaLike) (err error)
- func (s *Sha) Sha() *Sha
- func (s *Sha) Size() int
- func (s *Sha) String() string
- func (s *Sha) UnmarshalBinary(text []byte) (err error)
- func (s *Sha) UnmarshalText(text []byte) (err error)
- func (src *Sha) WriteTo(w io.Writer) (n int64, err error)
- type ShaLike
- type Slice
- type WriteCloser
Constants ¶
View Source
const ( ByteSize = 32 ShaNullString = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" Null = ShaNullString )
Variables ¶
View Source
var Equaler equaler
View Source
var ErrIsNull = errors.New("sha is null")
View Source
var Lessor lessor
View Source
var Resetter resetter
Functions ¶
func DebugCompareBlobs ¶
func DebugCompareBlobs( ctx errors.Context, blobStore interfaces.BlobStore, expectedSha interfaces.Sha, actual *strings.Builder, )
func MakeErrIsNull ¶
func MakeHashWriter ¶
func MakeReadCloser ¶
func MakeWriter ¶
func PageIndexForSha ¶
func PageIndexForSha(width uint8, s interfaces.Sha) (n uint8, err error)
Types ¶
type ErrNotEqual ¶
type ErrNotEqual struct {
Expected, Actual interfaces.Sha
}
func MakeErrNotEqual ¶
func MakeErrNotEqual(expected, actual interfaces.Sha) *ErrNotEqual
func (*ErrNotEqual) Error ¶
func (e *ErrNotEqual) Error() string
func (*ErrNotEqual) Is ¶
func (e *ErrNotEqual) Is(target error) bool
type PageId ¶
func PageIdFromPath ¶
type PathComponents ¶
type PathComponents interface {
PathComponents() []string
}
type ReadCloser ¶
type ReadCloser = interfaces.ShaReadCloser
TODO-P4 remove
func MakeNopReadCloser ¶
func MakeNopReadCloser(rc io.ReadCloser) ReadCloser
type Sha ¶
type Sha struct {
// contains filtered or unexported fields
}
func FromFormatString ¶
func FromStringContent ¶
func FromStringer ¶
func FromStringer(v interfaces.Stringer) *Sha
func Make ¶
func Make(getter interfaces.ShaGetter) *Sha
func MakeShaFromPath ¶
func (*Sha) AssertEqualsShaLike ¶
func (a *Sha) AssertEqualsShaLike(b interfaces.Sha) error
func (*Sha) GetShaBytes ¶
func (*Sha) GetShaLike ¶
func (s *Sha) GetShaLike() interfaces.Sha
func (*Sha) GetShaString ¶
func (*Sha) MarshalBinary ¶
func (*Sha) MarshalText ¶
func (*Sha) ResetWithShaLike ¶
func (a *Sha) ResetWithShaLike(b interfaces.Sha)
func (*Sha) SetFromPath ¶
func (*Sha) SetHexBytes ¶
func (*Sha) SetShaLike ¶
func (*Sha) UnmarshalBinary ¶
func (*Sha) UnmarshalText ¶
type ShaLike ¶
type ShaLike = interfaces.ShaGetter
Click to show internal directories.
Click to hide internal directories.