dsr

package module
v0.0.0-...-bd350d5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2019 License: MIT Imports: 12 Imported by: 0

README

dsr

Distributed key value storage

Documentation

Index

Constants

View Source
const (
	DefaultLRUSamples int            = 5
	LRUEviction       EvictionPolicy = "LRU"
)
View Source
const (
	DefaultLogLevel = "DEBUG"
)

Variables

This section is empty.

Functions

func NewDiscovery

func NewDiscovery(conf *Config) (*discovery, error)

NewDiscovery provides initialization of the discovery app

func NewMemberlistConfig

func NewMemberlistConfig(env string) (*memberlist.Config, error)

Types

type CacheConfig

type CacheConfig struct {
	MaxIdleDuration time.Duration
	TTLDuration     time.Duration
	MaxKeys         int
	LRUSamples      int
}

type Config

type Config struct {
	LogLevel         string
	Name             string
	KeepAlivePeriod  time.Duration
	DialTimeout      time.Duration
	Peers            []string
	PartitionCount   uint64
	BackupCount      int
	BackupMode       int
	LoadFactor       float64
	Hasher           Hasher
	KeyFile          string
	LogOutput        io.Writer
	Logger           *log.Logger
	MemberlistConfig *memberlist.Config
}

func DefaultConfig

func DefaultConfig() *Config

type DMapConfig

type DMapConfig struct {
	MaxIdleDuration time.Duration
	TTLDuration     time.Duration
	MaxKeys         int
	LRUSamples      int
	EvictionPolicy  EvictionPolicy
}

type DSR

type DSR struct {
	// contains filtered or unexported fields
}

func New

func New(conf *Config) (*DSR, error)

New provides initialization of the dsr app

func (*DSR) Start

func (dsr *DSR) Start() error

Start provides starting of the app

type EvictionPolicy

type EvictionPolicy string

type Hasher

type Hasher interface {
	Sum([]byte) uint64
}

Hasher defines interface for hash functions

func NewHasher

func NewHasher() Hasher

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server defines struct for the server

func NewServer

func NewServer(addr string, logger *log.Logger, keepalivePeriod time.Duration) *Server

NewServer provides starting of the server

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

ListenAndServe provides starting of the server

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳