Documentation
¶
Index ¶
- Constants
- Variables
- func LogInterceptor(s *Server) grpc.UnaryServerInterceptor
- func RequirePassInterceptor(s *Server) grpc.UnaryServerInterceptor
- type Logger
- type Options
- type Server
- func (s *Server) Close() error
- func (s *Server) Del(ctx context.Context, data *riverpb.RawData) (*riverpb.InfoResult, error)
- func (s *Server) DelInBatch(ctx context.Context, opt *riverpb.BatchDelOption) (*riverpb.BatchResult, error)
- func (s *Server) Exp(ctx context.Context, record *riverpb.ExpRecord) (*riverpb.InfoResult, error)
- func (s *Server) Get(ctx context.Context, data *riverpb.RawData) (*riverpb.DataResult, error)
- func (s *Server) Put(ctx context.Context, record *riverpb.Record) (*riverpb.InfoResult, error)
- func (s *Server) PutInBatch(ctx context.Context, opt *riverpb.BatchPutOption) (*riverpb.BatchResult, error)
- func (s *Server) Range(ctx context.Context, opt *riverpb.RangeOption) (*riverpb.RangeResult, error)
- func (s *Server) Run() error
- func (s *Server) Stat(context.Context, *emptypb.Empty) (*riverpb.Status, error)
- func (s *Server) TTL(ctx context.Context, data *riverpb.RawData) (*riverpb.TTLResult, error)
Constants ¶
View Source
const ( DefaultDir = "/var/lib/river/db" DefaultLogFile = "/var/lib/river/db.log" )
Variables ¶
View Source
var (
ErrClosed = errors.New("server is closed")
)
Functions ¶
func LogInterceptor ¶
func LogInterceptor(s *Server) grpc.UnaryServerInterceptor
func RequirePassInterceptor ¶
func RequirePassInterceptor(s *Server) grpc.UnaryServerInterceptor
Types ¶
type Options ¶
type Options struct {
Version string
// server listen address
Address string `toml:"address"`
// server password
Password string `toml:"password"`
// tls configuration
TlsKey string `toml:"tls_key"`
TlsPem string `toml:"tls_perm"`
// max bytes size of the single data file can hold
MaxSize int64 `toml:"max_file_size"`
// wal block cache size
BlockCache uint32 `toml:"block_cache"`
// call sync per write
Fsync bool `toml:"fsync"`
// call sync when reach the threshold
FsyncThreshold int64 `toml:"fsync_threshold"`
// transaction isolation level
TxnLevel uint8 `toml:"txn_level"`
// merge checkpoint
Checkpoint float64 `toml:"merge_checkpoint"`
LogFile string `toml:"log_file"`
LogLevel string `toml:"log_level"`
}
func ReadOption ¶
ReadOption Reads option from the specified path
type Server ¶
type Server struct {
riverpb.UnimplementedRiverServer
// contains filtered or unexported fields
}
func (*Server) DelInBatch ¶
func (s *Server) DelInBatch(ctx context.Context, opt *riverpb.BatchDelOption) (*riverpb.BatchResult, error)
func (*Server) PutInBatch ¶
func (s *Server) PutInBatch(ctx context.Context, opt *riverpb.BatchPutOption) (*riverpb.BatchResult, error)
func (*Server) Range ¶
func (s *Server) Range(ctx context.Context, opt *riverpb.RangeOption) (*riverpb.RangeResult, error)
Click to show internal directories.
Click to hide internal directories.