Documentation ¶
Index ¶
- func AssertNoError(err error)
- func CloneSliceFunc[T any](slice []T, copy func(T) T) (out []T)
- func FileExists(path string) (exists bool, _ error)
- func NewRandomUUIDBytes() (out [16]byte)
- func Ptr[T any](v T) *T
- func ReadUint64(reader io.Reader) (value uint64, n int, _ error)
- func ReadUint64s(reader io.Reader, vs ...*uint64) (n int, _ error)
- func Seq2At[U, V any](seq iter.Seq2[U, V], idx int) (out1 U, out2 V, exists bool)
- func SeqAt[T any](seq iter.Seq[T], idx int) (out T, exists bool)
- func SeqOf[T any](items ...T) iter.Seq[T]
- func ToBytes(writerTo io.WriterTo) ([]byte, error)
- func UUIDFromBytes(bytes [16]byte) uuid.UUID
- func Uint64FromWord64(v Word64) uint64
- func ValueFromBytes[T any, PT ReaderFromPtr[T]](b []byte) (T, error)
- func ValueToBytes[T any, PT WriterToPtr[T]](value T) ([]byte, error)
- func WriteUint64(writer io.Writer, v uint64) (n int, _ error)
- func WriteUint64s(writer io.Writer, vs ...uint64) (n int, _ error)
- type FileWrapper
- type IOSeeker
- type Optional
- type ReaderFromPtr
- type Word64
- type WriterToPtr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertNoError ¶
func AssertNoError(err error)
func CloneSliceFunc ¶
func CloneSliceFunc[T any](slice []T, copy func(T) T) (out []T)
func FileExists ¶
func NewRandomUUIDBytes ¶
func NewRandomUUIDBytes() (out [16]byte)
func UUIDFromBytes ¶
func Uint64FromWord64 ¶
func ValueFromBytes ¶
func ValueFromBytes[T any, PT ReaderFromPtr[T]](b []byte) (T, error)
func ValueToBytes ¶
func ValueToBytes[T any, PT WriterToPtr[T]](value T) ([]byte, error)
Types ¶
type FileWrapper ¶
type FileWrapper struct {
// contains filtered or unexported fields
}
FileWrapper is a utility class that can be used to read a file starting at an offset. More importantly, compared to a regular os.File, it uses `ReadAt` consistently, which does not mutate the underlying file descriptor state, allowing multiple readers to be safely created over a single file.
func NewFileWrapper ¶
func NewFileWrapper(file *os.File) FileWrapper
func NewFileWrapperAt ¶
func NewFileWrapperAt(file *os.File, offset uint64) FileWrapper
func (*FileWrapper) Copy ¶
func (me *FileWrapper) Copy() FileWrapper
func (*FileWrapper) Seek ¶
func (me *FileWrapper) Seek(offset int64, whence int) (ret int64, err error)
func (*FileWrapper) Sync ¶
func (me *FileWrapper) Sync() error
type ReaderFromPtr ¶
type ReaderFromPtr[M any] interface { *M io.ReaderFrom }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.