Documentation ¶
Index ¶
- Constants
- Variables
- func PrintHexView(input []byte, bytesPerRow int)
- func SetLogLevel(level int)
- type Application
- type ConfigStringSet
- type FileStorage
- func (c *FileStorage) Close() error
- func (c *FileStorage) CollectKeys(keymap Keymap)
- func (s *FileStorage) Config() *SharedStorageConfiguration
- func (s *FileStorage) Delete(key Key) error
- func (c *FileStorage) Get(key Key) (*Value, error)
- func (c *FileStorage) Has(key Key) bool
- func (c *FileStorage) Head(key Key) (*Value, error)
- func (c *FileStorage) KeyCount() int
- func (c *FileStorage) Keys() (keys []Key)
- func (c *FileStorage) Open() error
- func (s *FileStorage) Set(key Key, value *Value) error
- func (s *FileStorage) SetHead(key Key, value *Value) error
- func (c *FileStorage) Size() int64
- func (c *FileStorage) Start() error
- func (c *FileStorage) Stop() error
- type FileStorageChunk
- type IPNetMap
- type Key
- type KeySetForbiddenError
- type Keymap
- type Listener
- type MemoryStorage
- func (c *MemoryStorage) CollectKeys(keymap Keymap)
- func (s *MemoryStorage) Config() *SharedStorageConfiguration
- func (s *MemoryStorage) Delete(key Key) error
- func (s *MemoryStorage) Get(key Key) (*Value, error)
- func (s *MemoryStorage) Has(key Key) bool
- func (c *MemoryStorage) Head(key Key) (*Value, error)
- func (c *MemoryStorage) KeyCount() int
- func (c *MemoryStorage) Keys() (keys []Key)
- func (s *MemoryStorage) Set(key Key, value *Value) error
- func (s *MemoryStorage) SetHead(key Key, value *Value) error
- func (s *MemoryStorage) Size() int64
- func (c *MemoryStorage) Start() error
- func (c *MemoryStorage) Stop() error
- type MetricsServer
- type Server
- type ServerAuth
- type ServerMetrics
- type SharedStorageConfiguration
- type Storage
- type StorageChain
- func (c *StorageChain) CollectKeys(keymap Keymap)
- func (s *StorageChain) Config() *SharedStorageConfiguration
- func (c *StorageChain) Delete(key Key) error
- func (c *StorageChain) Get(key Key) (value *Value, err error)
- func (c *StorageChain) Has(key Key) bool
- func (c *StorageChain) Head(key Key) (*Value, error)
- func (c *StorageChain) KeyCount() int
- func (c *StorageChain) Keys() (keys []Key)
- func (c *StorageChain) Set(key Key, value *Value) error
- func (c *StorageChain) SetHead(key Key, value *Value) error
- func (c *StorageChain) Size() (size int64)
- func (c *StorageChain) Start() error
- func (c *StorageChain) Stop() error
- func (c *StorageChain) Storages() []Storage
- type StorageController
- func (c *StorageController) Chain() *StorageChain
- func (c *StorageController) CollectKeys(keymap Keymap)
- func (c *StorageController) Delete(key Key) error
- func (c *StorageController) Get(key Key) (value *Value, err error)
- func (c *StorageController) Has(key Key) bool
- func (c *StorageController) Head(key Key) (value *Value, err error)
- func (c *StorageController) Set(key Key, value *Value) error
- func (c *StorageController) Size() (size int64)
- func (c *StorageController) Start() error
- func (c *StorageController) Stop() error
- type Value
- type ValueHeader
Constants ¶
View Source
const ( LogLevelNone = 0 LogLevelError = 10 LogLevelWarn = 20 LogLevelInfo = 100 LogLevelDebug = 200 LogLevelTrace = 200 )
View Source
const ( ValueHeader_Etag = 1 << iota ValueHeader_Created = 2 << iota ValueHeader_LastRead = 3 << iota ValueHeader_LastWrite = 4 << iota ValueHeader_Reads = 5 << iota ValueHeader_Writes = 6 << iota )
View Source
const (
CompressionZLib = 0
)
View Source
const DEFAULT_LISTEN_PORT = 48282
View Source
const SeverAuthDefaultRealm = "Authentication required"
View Source
const ValueHeaderFlag_ContentType = 1
View Source
const ValueHeaderSize = 4 + 8 + 8 + 8 + 8 + 8 + 4
Variables ¶
View Source
var Endianess = binary.BigEndian
Functions ¶
func PrintHexView ¶
func SetLogLevel ¶
func SetLogLevel(level int)
Types ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
func NewApplication ¶
func NewApplication() (app *Application)
func (*Application) GetServerByRoot ¶
func (app *Application) GetServerByRoot(path string) *Server
func (*Application) Load ¶
func (app *Application) Load() error
func (*Application) Start ¶
func (app *Application) Start() (err error)
func (*Application) Stop ¶
func (app *Application) Stop() error
type ConfigStringSet ¶
func (ConfigStringSet) Contains ¶
func (m ConfigStringSet) Contains(key string) bool
func (ConfigStringSet) Delete ¶
func (m ConfigStringSet) Delete(key string)
func (ConfigStringSet) Get ¶
func (m ConfigStringSet) Get(key string) bool
func (ConfigStringSet) Keys ¶
func (m ConfigStringSet) Keys() (keys []string)
func (ConfigStringSet) Set ¶
func (m ConfigStringSet) Set(key string, value bool)
func (ConfigStringSet) String ¶
func (m ConfigStringSet) String() string
type FileStorage ¶
type FileStorage struct {
// contains filtered or unexported fields
}
func NewFileStorage ¶
func NewFileStorage() *FileStorage
func (*FileStorage) Close ¶
func (c *FileStorage) Close() error
func (*FileStorage) CollectKeys ¶
func (c *FileStorage) CollectKeys(keymap Keymap)
func (*FileStorage) Config ¶
func (s *FileStorage) Config() *SharedStorageConfiguration
func (*FileStorage) Delete ¶
func (s *FileStorage) Delete(key Key) error
func (*FileStorage) Has ¶
func (c *FileStorage) Has(key Key) bool
func (*FileStorage) KeyCount ¶
func (c *FileStorage) KeyCount() int
func (*FileStorage) Keys ¶
func (c *FileStorage) Keys() (keys []Key)
func (*FileStorage) Open ¶
func (c *FileStorage) Open() error
func (*FileStorage) SetHead ¶ added in v0.1.6
func (s *FileStorage) SetHead(key Key, value *Value) error
func (*FileStorage) Size ¶
func (c *FileStorage) Size() int64
func (*FileStorage) Start ¶
func (c *FileStorage) Start() error
func (*FileStorage) Stop ¶
func (c *FileStorage) Stop() error
type FileStorageChunk ¶
type FileStorageChunk struct {
// contains filtered or unexported fields
}
func (*FileStorageChunk) String ¶
func (c *FileStorageChunk) String() string
type KeySetForbiddenError ¶
type KeySetForbiddenError struct {
// contains filtered or unexported fields
}
func NewKeySetForbiddenError ¶
func NewKeySetForbiddenError(message string) *KeySetForbiddenError
func (*KeySetForbiddenError) Error ¶
func (e *KeySetForbiddenError) Error() string
type Listener ¶
type Listener struct {
// contains filtered or unexported fields
}
func NewListener ¶
func NewListener() *Listener
func (*Listener) ParseAddress ¶
type MemoryStorage ¶
type MemoryStorage struct {
// contains filtered or unexported fields
}
func NewMemoryStorage ¶
func NewMemoryStorage() *MemoryStorage
func (*MemoryStorage) CollectKeys ¶
func (c *MemoryStorage) CollectKeys(keymap Keymap)
func (*MemoryStorage) Config ¶
func (s *MemoryStorage) Config() *SharedStorageConfiguration
func (*MemoryStorage) Delete ¶
func (s *MemoryStorage) Delete(key Key) error
func (*MemoryStorage) Has ¶
func (s *MemoryStorage) Has(key Key) bool
func (*MemoryStorage) KeyCount ¶
func (c *MemoryStorage) KeyCount() int
func (*MemoryStorage) Keys ¶
func (c *MemoryStorage) Keys() (keys []Key)
func (*MemoryStorage) SetHead ¶ added in v0.1.6
func (s *MemoryStorage) SetHead(key Key, value *Value) error
func (*MemoryStorage) Size ¶
func (s *MemoryStorage) Size() int64
func (*MemoryStorage) Start ¶
func (c *MemoryStorage) Start() error
func (*MemoryStorage) Stop ¶
func (c *MemoryStorage) Stop() error
type MetricsServer ¶
type MetricsServer struct {
// contains filtered or unexported fields
}
func NewMetricsServer ¶
func NewMetricsServer(app *Application) *MetricsServer
func (*MetricsServer) Start ¶
func (s *MetricsServer) Start()
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) Start ¶
func (s *Server) Start(app *Application) (err error)
func (*Server) Storage ¶
func (s *Server) Storage() *StorageController
type ServerAuth ¶
type ServerAuth struct {
// contains filtered or unexported fields
}
func NewServerAuth ¶
func NewServerAuth() *ServerAuth
type ServerMetrics ¶
type ServerMetrics struct { Requests uint64 RequestsPerMethod map[string]uint64 RequestStatusCodes map[int]uint64 }
func NewServerMetrics ¶
func NewServerMetrics() *ServerMetrics
func (*ServerMetrics) CountRequest ¶
func (m *ServerMetrics) CountRequest(req *http.Request)
func (*ServerMetrics) CountStatus ¶
func (m *ServerMetrics) CountStatus(code int)
type SharedStorageConfiguration ¶
type SharedStorageConfiguration struct {
// contains filtered or unexported fields
}
type Storage ¶
type Storage interface { Config() *SharedStorageConfiguration Start() error Stop() error KeyCount() int CollectKeys(keymap Keymap) Keys() []Key Has(key Key) bool Head(key Key) (*Value, error) Get(key Key) (*Value, error) Set(key Key, value *Value) error SetHead(key Key, value *Value) error Delete(key Key) error Size() int64 }
type StorageChain ¶
type StorageChain struct {
// contains filtered or unexported fields
}
func NewStorageChain ¶
func NewStorageChain() *StorageChain
func (*StorageChain) CollectKeys ¶
func (c *StorageChain) CollectKeys(keymap Keymap)
func (*StorageChain) Config ¶
func (s *StorageChain) Config() *SharedStorageConfiguration
func (*StorageChain) Delete ¶
func (c *StorageChain) Delete(key Key) error
func (*StorageChain) Has ¶
func (c *StorageChain) Has(key Key) bool
func (*StorageChain) KeyCount ¶
func (c *StorageChain) KeyCount() int
func (*StorageChain) Keys ¶
func (c *StorageChain) Keys() (keys []Key)
func (*StorageChain) SetHead ¶ added in v0.1.6
func (c *StorageChain) SetHead(key Key, value *Value) error
func (*StorageChain) Size ¶
func (c *StorageChain) Size() (size int64)
func (*StorageChain) Start ¶
func (c *StorageChain) Start() error
func (*StorageChain) Stop ¶
func (c *StorageChain) Stop() error
func (*StorageChain) Storages ¶
func (c *StorageChain) Storages() []Storage
type StorageController ¶
type StorageController struct {
// contains filtered or unexported fields
}
func NewStorageController ¶
func NewStorageController() *StorageController
func (*StorageController) Chain ¶
func (c *StorageController) Chain() *StorageChain
func (*StorageController) CollectKeys ¶
func (c *StorageController) CollectKeys(keymap Keymap)
func (*StorageController) Delete ¶
func (c *StorageController) Delete(key Key) error
func (*StorageController) Has ¶
func (c *StorageController) Has(key Key) bool
func (*StorageController) Head ¶
func (c *StorageController) Head(key Key) (value *Value, err error)
func (*StorageController) Size ¶
func (c *StorageController) Size() (size int64)
func (*StorageController) Start ¶
func (c *StorageController) Start() error
func (*StorageController) Stop ¶
func (c *StorageController) Stop() error
type Value ¶
type Value struct { ValueHeader Data []byte }
func (*Value) BinarySize ¶
func (*Value) ReadResponse ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.