Documentation
¶
Index ¶
- Constants
- Variables
- func CreateFile(filename string, fi os.FileInfo) (*os.File, error)
- func Fileinfo(fi os.FileInfo) (uid, gid int)
- func Hexdump(data []byte) string
- func LimitReadCloser(r io.ReadCloser, n int64) io.ReadCloser
- func MkdirAll(path string, fi os.FileInfo) error
- func ReplaceAttr(groups []string, a slog.Attr) slog.Attr
- type LimitedReadCloser
- type ReadCloser
- type ReadCounter
Constants ¶
View Source
const LevelTrace = slog.LevelDebug - 4
Variables ¶
View Source
var ( OperationTotalCounterVec = promauto.NewCounterVec(prometheus.CounterOpts{ Name: "litestream_replica_operation_total", Help: "The number of replica operations performed", }, []string{"replica_type", "operation"}) OperationBytesCounterVec = promauto.NewCounterVec(prometheus.CounterOpts{ Name: "litestream_replica_operation_bytes", Help: "The number of bytes used by replica operations", }, []string{"replica_type", "operation"}) )
Shared replica metrics.
Functions ¶
func CreateFile ¶ added in v0.3.5
CreateFile creates the file and matches the mode & uid/gid of fi.
func LimitReadCloser ¶ added in v0.5.0
func LimitReadCloser(r io.ReadCloser, n int64) io.ReadCloser
Copied from the io package to implement io.Closer.
Types ¶
type LimitedReadCloser ¶ added in v0.5.0
type LimitedReadCloser struct {
R io.ReadCloser // underlying reader
N int64 // max bytes remaining
}
func (*LimitedReadCloser) Close ¶ added in v0.5.0
func (l *LimitedReadCloser) Close() error
type ReadCloser ¶
type ReadCloser struct {
// contains filtered or unexported fields
}
ReadCloser wraps a reader to also attach a separate closer.
func NewReadCloser ¶
func NewReadCloser(r io.Reader, c io.Closer) *ReadCloser
NewReadCloser returns a new instance of ReadCloser.
func (*ReadCloser) Close ¶
func (r *ReadCloser) Close() error
Close closes the reader (if implementing io.ReadCloser) and the Closer.
type ReadCounter ¶ added in v0.3.5
type ReadCounter struct {
// contains filtered or unexported fields
}
ReadCounter wraps an io.Reader and counts the total number of bytes read.
func NewReadCounter ¶ added in v0.3.5
func NewReadCounter(r io.Reader) *ReadCounter
NewReadCounter returns a new instance of ReadCounter that wraps r.
func (*ReadCounter) N ¶ added in v0.3.5
func (r *ReadCounter) N() int64
N returns the total number of bytes read.
Click to show internal directories.
Click to hide internal directories.