Documentation ¶
Index ¶
Constants ¶
View Source
const ( KNumBytes = "NumBytes" KCrc32 = "Crc32" )
Variables ¶
This section is empty.
Functions ¶
func AddItemExtensions ¶
func AddItemExtensions( ctx context.Context, rc io.ReadCloser, info details.ItemInfo, factories []CreateItemExtensioner, ) (io.ReadCloser, *details.ExtensionData, error)
AddItemExtensions wraps provided readcloser with extensions supplied via factory, with the first extension in slice being the innermost one. If no extensions are provided, the original readcloser is returned.
Types ¶
type CreateItemExtensioner ¶
type CreateItemExtensioner interface { CreateItemExtension( context.Context, io.ReadCloser, details.ItemInfo, *details.ExtensionData, ) (io.ReadCloser, error) }
type MockExtension ¶
type MockExtension struct { NumBytes int64 Crc32 uint32 Info details.ItemInfo ExtData *details.ExtensionData InnerRc io.ReadCloser Ctx context.Context FailOnRead bool FailOnClose bool }
func (*MockExtension) Close ¶
func (me *MockExtension) Close() error
type MockItemExtensionFactory ¶
type MockItemExtensionFactory struct { FailOnFactoryCreation bool FailOnRead bool FailOnClose bool }
func (*MockItemExtensionFactory) CreateItemExtension ¶
func (m *MockItemExtensionFactory) CreateItemExtension( ctx context.Context, rc io.ReadCloser, info details.ItemInfo, extData *details.ExtensionData, ) (io.ReadCloser, error)
Click to show internal directories.
Click to hide internal directories.