From 0d92f61d56ea992b5d6cbc679d22a3a0394cbb24 Mon Sep 17 00:00:00 2001 From: shaoyue Date: Wed, 1 Dec 2021 15:45:40 +0800 Subject: [PATCH] [skip ci] Add comment for storage.ChunManger methods (#12524) Signed-off-by: shaoyue.chen --- internal/storage/types.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/storage/types.go b/internal/storage/types.go index 2f560c898c..aaab253eaa 100644 --- a/internal/storage/types.go +++ b/internal/storage/types.go @@ -14,9 +14,16 @@ package storage // ChunkManager is to manager chunks. // Include Read, Write, Remove chunks. type ChunkManager interface { + // GetPath returns path of @key GetPath(key string) (string, error) + // Write writes @content to @key Write(key string, content []byte) error + // Exist returns true if @key exists Exist(key string) bool + // Read reads @key and returns content Read(key string) ([]byte, error) + // ReadAt reads @key by offset @off, content stored in @p, return @n as the number of bytes read + // if all bytes are read, @err is io.EOF + // return other error if read failed ReadAt(key string, p []byte, off int64) (n int, err error) }