Documentation ¶
Overview ¶
* Copyright (C) 2024 Puter Technologies Inc. * * This file is part of puter-fuse. * * puter-fuse is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>.
* Copyright (C) 2024 Puter Technologies Inc. * * This file is part of puter-fuse. * * puter-fuse is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>.
* Copyright (C) 2024 Puter Technologies Inc. * * This file is part of puter-fuse. * * puter-fuse is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>.
* Copyright (C) 2024 Puter Technologies Inc. * * This file is part of puter-fuse. * * puter-fuse is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>.
Index ¶
- func PathSplit(path string) []string
- type CacheStampedeMap
- type IMap
- type Map
- func (m *Map[TKey, TVal]) Del(key TKey)
- func (m *Map[TKey, TVal]) Get(key TKey) (TVal, bool)
- func (m *Map[TKey, TVal]) GetWithFactory(key TKey, factory func() (TVal, bool, error)) (TVal, bool, error)
- func (m *Map[TKey, TVal]) Has(key TKey) bool
- func (m *Map[TKey, TVal]) Keys() []TKey
- func (m *Map[TKey, TVal]) Set(key TKey, val TVal)
- func (m *Map[TKey, TVal]) Values() []TVal
- type ProxyMap
- func (m *ProxyMap[TKey, TVal]) Del(key TKey)
- func (m *ProxyMap[TKey, TVal]) Get(key TKey) (val TVal, ok bool)
- func (m *ProxyMap[TKey, TVal]) GetWithFactory(key TKey, factory func() (TVal, bool, error)) (TVal, bool, error)
- func (m *ProxyMap[TKey, TVal]) Has(key TKey) bool
- func (m *ProxyMap[TKey, TVal]) Keys() []TKey
- func (m *ProxyMap[TKey, TVal]) Set(key TKey, val TVal)
- func (m *ProxyMap[TKey, TVal]) Values() []TVal
- type SignalReader
- type SyncMap
- func (m *SyncMap[TKey, TVal]) Del(key TKey)
- func (m *SyncMap[TKey, TVal]) Get(key TKey) (TVal, bool)
- func (m *SyncMap[TKey, TVal]) GetWithFactory(key TKey, factory func() (TVal, bool, error)) (TVal, bool, error)
- func (m *SyncMap[TKey, TVal]) Has(key TKey) bool
- func (m *SyncMap[TKey, TVal]) Keys() []TKey
- func (m *SyncMap[TKey, TVal]) Set(key TKey, val TVal)
- func (m *SyncMap[TKey, TVal]) Values() []TVal
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CacheStampedeMap ¶
type CacheStampedeMap[TKey comparable] struct { // contains filtered or unexported fields }
func CreateCacheStampedeMap ¶
func CreateCacheStampedeMap[TKey comparable]() *CacheStampedeMap[TKey]
func (*CacheStampedeMap[TKey]) Lock ¶
func (m *CacheStampedeMap[TKey]) Lock(key TKey) *sync.Mutex
type Map ¶
type Map[TKey comparable, TVal any] struct { Items map[TKey]TVal }
func CreateMap ¶
func CreateMap[TKey comparable, TVal any]() *Map[TKey, TVal]
func (*Map[TKey, TVal]) GetWithFactory ¶
type SignalReader ¶
func CreateSignalReader ¶
func CreateSignalReader(delegate io.Reader) *SignalReader
type SyncMap ¶
type SyncMap[TKey comparable, TVal any] struct { ProxyMap[TKey, TVal] // contains filtered or unexported fields }
func CreateSyncMap ¶
func CreateSyncMap[TKey comparable, TVal any](delegate IMap[TKey, TVal]) *SyncMap[TKey, TVal]