mirror of
https://github.com/imjasonh/gcsbuf
synced 2026-07-08 09:05:20 +00:00
14 lines
402 B
Go
14 lines
402 B
Go
package buf
|
|
|
|
import "time"
|
|
|
|
// OnOp is called after each GCS API operation completes.
|
|
// op identifies the operation (e.g. "upload", "attrs", "compose", "delete", "rewrite", "patch", "read").
|
|
// d is the wall-clock duration. err is nil on success.
|
|
type OnOp func(op string, d time.Duration, err error)
|
|
|
|
func (f OnOp) observe(op string, d time.Duration, err error) {
|
|
if f != nil {
|
|
f(op, d, err)
|
|
}
|
|
}
|