Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrClientClosed is used if the client is closed ErrClientClosed = fmt.Errorf("client closed") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is used to interact with an hlld server
type Command ¶
Command is used to represent any command that can be sent to HLLD. It must be able to encode and decode from the wire.
type Config ¶
type Config struct { // MaxPipeline is the maximum number of commands to pipeline MaxPipeline int // Timeout is the read or write timeout Timeout time.Duration }
Config is used to parameterize the client
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig is used as the default client configuration
type CreateCommand ¶
type CreateCommand struct { // SetName is the name of the set to create SetName string // Precision is the number of bits used for the bucket, the higher // precision will reduce the errors at the cost of using more memory.A // By default this is unspecified and computed based on the ErrThreshold. Precision int // ErrThreshold is used to control the tolerable error. Higher thresholds // require less precision and less memory. It is optional and can be unspecified // to use the server default. ErrThreshold float64 // InMemory can be set to true to prevent the set from ever being // paged out to disk. This is not recommended as it prevents cold // sets from leaving memory. InMemory bool // contains filtered or unexported fields }
CreateCommand is used to make a new set
func NewCreateCommand ¶
func NewCreateCommand(name string) (*CreateCommand, error)
NewCreateCommand is used to prepare a new create command
func (*CreateCommand) Result ¶
func (c *CreateCommand) Result() (bool, error)
type FlushCommand ¶
type FlushCommand struct { // SetName is the optional name of the set to create SetName string // contains filtered or unexported fields }
FlushCommand is used to force a flush to disk
func NewFlushCommand ¶
func NewFlushCommand(name string) (*FlushCommand, error)
NewFlushCommand is used to flush keys to disk, optionally restricted to a specific set
func (*FlushCommand) Result ¶
func (c *FlushCommand) Result() (bool, error)
type Future ¶
type Future struct {
// contains filtered or unexported fields
}
Future is used to wrap a command and return a future
type InfoCommand ¶
type InfoCommand struct { // SetName is the name of the set SetName string // contains filtered or unexported fields }
InfoCommand is used to make a new set
func NewInfoCommand ¶
func NewInfoCommand(name string) (*InfoCommand, error)
NewInfoCommand is used to query a specific set
type ListCommand ¶
type ListCommand struct { // Prefix is the prefix to filter Prefix string // contains filtered or unexported fields }
ListCommand is used to make a new set
func NewListCommand ¶
func NewListCommand(prefix string) (*ListCommand, error)
NewListCommand is used to list the sets, filtering on an optional prefix
func (*ListCommand) Result ¶
func (c *ListCommand) Result() ([]*ListEntry, error)
type SetCommand ¶
type SetCommand struct { // Command is invoked on the set Command string // SetName is the name of the set to create SetName string // contains filtered or unexported fields }
SetCommand is used to act on a set
func NewClearCommand ¶
func NewClearCommand(name string) (*SetCommand, error)
NewClearCommand is used to remove a set from management, but leave on disk
func NewCloseCommand ¶
func NewCloseCommand(name string) (*SetCommand, error)
NewCloseCommand is used to close a set out of memory
func NewDropCommand ¶
func NewDropCommand(name string) (*SetCommand, error)
NewDropCommand is used to drop a set
func (*SetCommand) Result ¶
func (c *SetCommand) Result() (bool, error)
type SetInfo ¶
type SetInfo struct { // InMemory is true if the set is currently in memory InMemory bool // PageIns is the number of times the set has been paged in PageIns uint64 // PageOuts is the number of times the set has been paged out PageOuts uint64 // ErrThreshold is the error tolerance of the set ErrThreshold float64 // Precision is the number of precision bits used Precision uint64 // Sets is the number of write operations Sets uint64 // Size is the estimated cardinaality of the set Size uint64 // Storage is the disk space requirements of the set Storage uint64 }
SetInfo contains the results of a query
type SetKeysCommand ¶
type SetKeysCommand struct { // SetName is the name of the set to create SetName string // Keys is the keys to set Keys []string // contains filtered or unexported fields }
SetKeysCommand is used to set keys in a set
func NewSetKeysCommand ¶
func NewSetKeysCommand(name string, keys []string) (*SetKeysCommand, error)
NewSetKeysCommand is used to set keys in a set
func (*SetKeysCommand) Result ¶
func (c *SetKeysCommand) Result() (bool, error)