@@ -84,26 +84,30 @@ type Store interface {
84
84
// InstanceInfo returns the information of this store.
85
85
InstanceInfo (ctx context.Context ) (InstanceInfo , error )
86
86
87
- // Get returns an io.ReadCloser object for reading the file corresponding to the fullPath from this store.
88
- Get (ctx context.Context , fullPath string ) (io.ReadCloser , error )
89
- // Del removes the file corresponding to given path from this store
90
- Del (ctx context.Context , fullPath string ) error
91
- // Stat returns a Stat describing the file corresponding to given path
92
- Stat (ctx context.Context , fullPath string ) (Stat , error )
93
- // Put copies from src to dstPath until either EOF is reached
87
+ // Get returns an io.ReadCloser object for reading the file corresponding to the resourceName from this store.
88
+ // the resourceName value looks like this:
89
+ // - "cache/sc-02-data-tree-r-last.dat"
90
+ Get (ctx context.Context , resourceName string ) (io.ReadCloser , error )
91
+ // Del removes the file corresponding to given resourceName from this store
92
+ Del (ctx context.Context , resourceName string ) error
93
+ // Stat returns a Stat describing the file corresponding to given resourceName
94
+ Stat (ctx context.Context , resourceName string ) (Stat , error )
95
+ // Put copies from src to destResourceName until either EOF is reached
94
96
// on src or an error occurs.
95
97
// It returns the number of bytes copied.
96
- Put (ctx context.Context , dstFullPath string , src io.Reader ) (int64 , error )
98
+ Put (ctx context.Context , destResourceName string , src io.Reader ) (int64 , error )
97
99
98
- // FullPath returns the full path of the given relative path .
100
+ // Uri returns the uri corresponding to the given resourceName in this store .
99
101
//
102
+ // Example:
100
103
// ```go
101
- // assert(FullPath(context.TODO(), "cache/s-t04040-1001") == "depends_on_your_store/cache/s-t04040-1001")
104
+ // assert(Uri(context.TODO(), "cache/s-t04040-1001") == "/path/to/my_prefix/cache/s-t04040-1001")
105
+ // assert(Uri(context.TODO(), "cache/s-t04040-1001") == "/path/to/3777f34f2e99477b512a7a4507318f72")
106
+ // ...
102
107
// ```
103
- //
104
108
// Example(for filesystem):
105
109
// ```go
106
- // assert(FullPath (context.TODO(), "cache/s-t04040-1001") == "/path/to/your_store_dir /cache/s-t04040-1001")
110
+ // assert(Uri (context.TODO(), "cache/s-t04040-1001") == "/path/to/my_store_dir /cache/s-t04040-1001")
107
111
// ```
108
- FullPath (ctx context.Context , relPath string ) string
112
+ Uri (ctx context.Context , resourceName string ) ( string , error )
109
113
}
0 commit comments