Reduced exposed interfaces

This commit is contained in:
Eduard Urbach 2023-07-18 09:08:55 +02:00
parent 47ec84e8ba
commit f006f0c407
Signed by: akyoto
GPG Key ID: C874F672B1AF20C0
3 changed files with 4 additions and 4 deletions

View File

@ -18,12 +18,12 @@ const (
)
type File[T any] struct {
collection StorageData
collection storageData
dirty atomic.Uint32
sync chan struct{}
}
func (fs *File[T]) Init(c StorageData) error {
func (fs *File[T]) Init(c storageData) error {
fs.collection = c
fs.sync = make(chan struct{})

View File

@ -1,7 +1,7 @@
package ocean
type Storage[T any] interface {
Init(data StorageData) error
Init(data storageData) error
Delete(key string) error
Set(key string, value *T) error
Sync()

View File

@ -2,7 +2,7 @@ package ocean
import "sync"
type StorageData interface {
type storageData interface {
Data() *sync.Map
Name() string
Root() string