Documentation
¶
Index ¶
- type CanNotSetError
- type MemoryTable
- func (m *MemoryTable) All() map[string]interface{}
- func (m *MemoryTable) CanSet() bool
- func (m *MemoryTable) Get(key string) (interface{}, error)
- func (m *MemoryTable) GetKey(value interface{}) (string, error)
- func (m *MemoryTable) Has(key string) bool
- func (m *MemoryTable) Set(key string, value interface{}) error
- func (m *MemoryTable) Truncate()
- func (m *MemoryTable) Unset(key string) error
- type RouteError
- type RouteTable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CanNotSetError ¶
type CanNotSetError struct {
// contains filtered or unexported fields
}
func (*CanNotSetError) Error ¶
func (e *CanNotSetError) Error() string
type MemoryTable ¶
type MemoryTable struct {
// contains filtered or unexported fields
}
func NewMemoryTable ¶
func NewMemoryTable(max uint) *MemoryTable
func (*MemoryTable) All ¶
func (m *MemoryTable) All() map[string]interface{}
func (*MemoryTable) CanSet ¶
func (m *MemoryTable) CanSet() bool
func (*MemoryTable) Get ¶
func (m *MemoryTable) Get(key string) (interface{}, error)
func (*MemoryTable) GetKey ¶
func (m *MemoryTable) GetKey(value interface{}) (string, error)
func (*MemoryTable) Has ¶
func (m *MemoryTable) Has(key string) bool
func (*MemoryTable) Set ¶
func (m *MemoryTable) Set(key string, value interface{}) error
func (*MemoryTable) Truncate ¶
func (m *MemoryTable) Truncate()
func (*MemoryTable) Unset ¶
func (m *MemoryTable) Unset(key string) error
type RouteError ¶
type RouteError struct {
// contains filtered or unexported fields
}
func (*RouteError) Error ¶
func (e *RouteError) Error() string
type RouteTable ¶
type RouteTable interface {
// Get routing information for a request. After receive a request, it map the
// request to the client which must serve it.
Get(key string) (interface{}, error)
// Set request information of a request. Route is the endpoint which received to
// the server and value is information of client which registered this key
Set(key string, value interface{}) error
Has(key string) bool
// Unset a key
Unset(key string) error
// Indicate user can set more key or not
CanSet() bool
// Return first key which has the value
GetKey(value interface{}) (string, error)
// Return all routes
All() map[string]interface{}
// Truncate table
Truncate()
}
Click to show internal directories.
Click to hide internal directories.