Documentation
¶
Index ¶
- Variables
- func CreateFile(filename string, fi os.FileInfo) (*os.File, error)
- func Fileinfo(fi os.FileInfo) (uid, gid int)
- func MkdirAll(path string, fi os.FileInfo) error
- func ParseSnapshotPath(s string) (index int, err error)
- func ParseWALSegmentPath(s string) (index int, offset int64, err error)
- type MultiReadCloser
- type ReadCloser
- type ReadCounter
Constants ¶
This section is empty.
Variables ¶
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 MkdirAll ¶ added in v0.3.5
MkdirAll is a copy of os.MkdirAll() except that it attempts to set the mode/uid/gid to match fi for each created directory.
func ParseSnapshotPath ¶
ParseSnapshotPath parses the index from a snapshot filename. Used by path-based replicas.
Types ¶
type MultiReadCloser ¶
type MultiReadCloser struct {
// contains filtered or unexported fields
}
MultiReadCloser is a logical concatenation of io.ReadCloser. It works like io.MultiReader except all objects are closed when Close() is called.
func NewMultiReadCloser ¶
func NewMultiReadCloser(a []io.ReadCloser) *MultiReadCloser
NewMultiReadCloser returns a new instance of MultiReadCloser.
func (*MultiReadCloser) Close ¶
func (mrc *MultiReadCloser) Close() (err error)
Close closes all underlying ReadClosers and returns first error encountered.
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.