Reduced exposed interfaces
This commit is contained in:
parent
47ec84e8ba
commit
f006f0c407
4
File.go
4
File.go
@ -18,12 +18,12 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type File[T any] struct {
|
type File[T any] struct {
|
||||||
collection StorageData
|
collection storageData
|
||||||
dirty atomic.Uint32
|
dirty atomic.Uint32
|
||||||
sync chan struct{}
|
sync chan struct{}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fs *File[T]) Init(c StorageData) error {
|
func (fs *File[T]) Init(c storageData) error {
|
||||||
fs.collection = c
|
fs.collection = c
|
||||||
fs.sync = make(chan struct{})
|
fs.sync = make(chan struct{})
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package ocean
|
package ocean
|
||||||
|
|
||||||
type Storage[T any] interface {
|
type Storage[T any] interface {
|
||||||
Init(data StorageData) error
|
Init(data storageData) error
|
||||||
Delete(key string) error
|
Delete(key string) error
|
||||||
Set(key string, value *T) error
|
Set(key string, value *T) error
|
||||||
Sync()
|
Sync()
|
||||||
|
@ -2,7 +2,7 @@ package ocean
|
|||||||
|
|
||||||
import "sync"
|
import "sync"
|
||||||
|
|
||||||
type StorageData interface {
|
type storageData interface {
|
||||||
Data() *sync.Map
|
Data() *sync.Map
|
||||||
Name() string
|
Name() string
|
||||||
Root() string
|
Root() string
|
Loading…
Reference in New Issue
Block a user