writer

package
v0.0.0-...-9645bb5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package writer contains writer utilities for writing into a file

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFileWriterCouldNotSeek  = errors.New("package writer - could not seek")
	ErrFileWriterCouldNotWrite = errors.New("package writer - could not write data into file")
	ErrFileWriterCouldNotClose = errors.New("package writer - could not close")
	ErrFileWriterCouldNotSync  = errors.New("package writer - could not sync")
)

Functions

This section is empty.

Types

type FileWriter

type FileWriter interface {
	// Write will write or update raw data into file
	Write(rawData []byte, offset int64, seek int) error
	// Sync will sync data from in-memory to disk
	Sync() error
	// GetId return id of FileWriter
	GetId() uuid.UUID
	// Close func provides close writer instance
	Close() error
}

FileWriter interface gives you some options for writing into a file

func NewFileWriter

func NewFileWriter(file file.File) (FileWriter, uuid.UUID)

NewFileWriter func provides new instance of FileWriter interface with unique memory addresses of its objects

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL