gobchest

package module
v0.0.0-...-8a01e67 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2014 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterSetType

func RegisterSetType(v interface{})

Types

type Chest

type Chest struct {
	Data map[string]interface{}
	// contains filtered or unexported fields
}

func NewChest

func NewChest(filePath string) (*Chest, error)

func (*Chest) Get

func (s *Chest) Get(req *Request, response *Response) error

func (*Chest) ListAppend

func (s *Chest) ListAppend(req *Request, response *Response) error

func (*Chest) Set

func (s *Chest) Set(req *Request, response *Response) error

func (*Chest) SetAdd

func (s *Chest) SetAdd(req *Request, response *Response) error

func (*Chest) SetExists

func (s *Chest) SetExists(req *Request, response *Response) error

type Client

type Client struct {
	*rpc.Client
}

func NewClient

func NewClient(addr string) (*Client, error)

func (*Client) Close

func (c *Client) Close()

func (*Client) Get

func (c *Client) Get(key string) (interface{}, error)

func (*Client) ListAppend

func (c *Client) ListAppend(key string, values ...interface{}) error

func (*Client) Set

func (c *Client) Set(key string, value interface{}) error

func (*Client) SetAdd

func (c *Client) SetAdd(key string, value interface{}) error

func (*Client) SetExists

func (c *Client) SetExists(key string, value interface{}) bool

type Request

type Request struct {
	Type  RequestType
	Key   string
	Value interface{}
}

type RequestType

type RequestType uint8
var (
	Set        RequestType = 1
	Get        RequestType = 2
	ListAppend RequestType = 3
	SetAdd     RequestType = 4
	SetExists  RequestType = 5
)

type Response

type Response struct {
	Value interface{}
}

type Server

type Server struct {
	*rpc.Server
	// contains filtered or unexported fields
}

func NewServer

func NewServer(addr string, filePath string) (*Server, error)

func (*Server) Close

func (s *Server) Close()

func (*Server) Save

func (s *Server) Save()

func (*Server) SetErrorHandler

func (s *Server) SetErrorHandler(fn func(error))

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL