Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileExists ¶ added in v1.26.0
func SanitizeFilePathJoin ¶ added in v1.30.20
SanitizeFilePathJoin joins a root path and a relative file path, ensuring that the resulting path is within the root path. It assumes that the relativeFilePath is attacker controlled.
Types ¶
type MeteredReader ¶
type MeteredReader struct {
// contains filtered or unexported fields
}
func NewMeteredReader ¶
func NewMeteredReader(file Reader, cb MeteredReaderCallback) *MeteredReader
func (*MeteredReader) Read ¶
func (m *MeteredReader) Read(p []byte) (n int, err error)
Read passes the read through to the underlying reader. On a successful read, it will trigger the attached callback and provide it with metrics. If no callback is set, it will ignore it.
func (*MeteredReader) ReadAt ¶ added in v1.30.8
func (m *MeteredReader) ReadAt(p []byte, off int64) (n int, err error)
ReadAt passes the read through to the underlying reader. On a successful read, it will trigger the attached callback and provide it with metrics. If no callback is set, it will ignore it.
type MeteredReaderCallback ¶
type MeteredWriter ¶ added in v1.27.23
type MeteredWriter struct {
// contains filtered or unexported fields
}
func NewMeteredWriter ¶ added in v1.27.23
func NewMeteredWriter(w WriterSeekerCloser, cb MeteredWriterCallback) *MeteredWriter
type MeteredWriterCallback ¶ added in v1.27.23
type MeteredWriterCallback func(written int64)
Click to show internal directories.
Click to hide internal directories.