Documentation ¶
Overview ¶
Copyright 2020-2026 The sstore Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- type JournalMeta
- type Options
- func (opt Options) WithBlockSize(val int) Options
- func (opt Options) WithEntryQueueCap(val int) Options
- func (opt Options) WithFilesDir(val string) Options
- func (opt Options) WithMaxImmutableMStreamTableCount(val int) Options
- func (opt Options) WithMaxMStreamTableSize(val int64) Options
- func (opt Options) WithMaxSegmentCount(val int) Options
- func (opt Options) WithMaxWalSize(val int64) Options
- func (opt Options) WithSegmentDir(val string) Options
- func (opt Options) WithWalPath(val string) Options
- type SStore
- func (sstore *SStore) Append(streamID int64, data []byte, offset int64) (int64, error)
- func (sstore *SStore) AsyncAppend(streamID int64, data []byte, offset int64, cb func(offset int64, err error))
- func (sstore *SStore) Begin(streamID int64) (int64, bool)
- func (sstore *SStore) Close() error
- func (sstore *SStore) End(streamID int64) (int64, bool)
- func (sstore *SStore) Exist(streamID int64) bool
- func (sstore *SStore) GC() error
- func (sstore *SStore) GetSnapshot() Snapshot
- func (sstore *SStore) Options() Options
- func (sstore *SStore) Reader(streamID int64) (io.ReadSeeker, error)
- func (sstore *SStore) Watcher(streamID int64) Watcher
- type Snapshot
- type Version
- type Watcher
Constants ¶
const KB = 1024
const MB = 1024 * 1024
Variables ¶
var ( ErrOffset = errors.New("offset error") ErrNoFindStream = errors.New("no find stream") ErrNoFindIndexInfo = errors.New("no find index info") ErrNoFindOffsetIndex = errors.New("no find offset index") ErrNoFindSegment = errors.New("no find segment") ErrWhence = errors.New("whence error") ErrWal = errors.New("journal error") ErrClose = errors.New("SStore close") )
Functions ¶
This section is empty.
Types ¶
type JournalMeta ¶
type Options ¶
type Options struct { Path string `json:"path"` ManifestDir string `json:"manifest_dir"` WalDir string `json:"wal_dir"` SegmentDir string `json:"segment_dir"` MaxSegmentCount int `json:"max_segment_count"` BlockSize int `json:"block_size"` MaxMStreamTableSize int64 `json:"max_mStream_table_size"` MaxImmutableMStreamTableCount int `json:"max_immutable_mStream_table_count"` EntryQueueCap int `json:"entry_queue_cap"` MaxWalSize int64 `json:"max_wal_size"` }
func DefaultOptions ¶
func (Options) WithEntryQueueCap ¶
EntryQueueCap
func (Options) WithMaxImmutableMStreamTableCount ¶
MaxImmutableMStreamTableCount
func (Options) WithMaxMStreamTableSize ¶
WithMaxMStreamTableSize
func (Options) WithMaxSegmentCount ¶
WithMaxSegmentCount
func (Options) WithSegmentDir ¶
WithSegmentDir
type SStore ¶
type SStore struct {
// contains filtered or unexported fields
}
func (*SStore) AsyncAppend ¶
func (sstore *SStore) AsyncAppend(streamID int64, data []byte, offset int64, cb func(offset int64, err error))
AsyncAppend async append the data to end of the stream