MCPcopy Index your code
hub / github.com/CodisLabs/codis / Write

Method Write

pkg/utils/log/rolling.go:85–103  ·  view source on GitHub ↗
(b []byte)

Source from the content-addressed store, hash-verified

83}
84
85func (r *rollingFile) Write(b []byte) (int, error) {
86 r.mu.Lock()
87 defer r.mu.Unlock()
88
89 if r.closed {
90 return 0, errors.Trace(ErrClosedRollingFile)
91 }
92
93 if err := r.roll(); err != nil {
94 return 0, err
95 }
96
97 n, err := r.file.Write(b)
98 if err != nil {
99 return n, errors.Trace(err)
100 } else {
101 return n, nil
102 }
103}
104
105func NewRollingFile(basePath string, rolling RollingFormat) (io.WriteCloser, error) {
106 if _, file := filepath.Split(basePath); file == "" {

Callers

nothing calls this directly

Calls 1

rollMethod · 0.95

Tested by

no test coverage detected