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 Options
- func (opt Options) WithBlockSize(val int64) 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(name string, data []byte) error
- func (sstore *SStore) AsyncAppend(name string, data []byte, cb func(err error))
- func (sstore *SStore) Begin(name string) (int64, bool)
- func (sstore *SStore) Close() error
- func (sstore *SStore) End(name string) (int64, bool)
- func (sstore *SStore) Exist(name string) bool
- func (sstore *SStore) GC() error
- func (sstore *SStore) Options() Options
- func (sstore *SStore) ReadSeeker(name string) io.ReadSeeker
- func (sstore *SStore) Watcher(name string) Watcher
- type Watcher
Constants ¶
const KB = 1024
const MB = 1024 * 1024
const (
WalExt = ".log"
)
Variables ¶
var (
ErrWal = errors.New("wal error")
)
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct { Path string `json:"path"` FilesDir string `json:"files_dir"` WalDir string `json:"wal_dir"` SegmentDir string `json:"segment_dir"` MaxSegmentCount int `json:"max_segment_count"` BlockSize int64 `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 ¶
AsyncAppend async append the data to end of the stream
func (*SStore) ReadSeeker ¶
func (sstore *SStore) ReadSeeker(name string) io.ReadSeeker
ReadSeeker create ReadSeeker of the stream