storage

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2018 License: MIT Imports: 0 Imported by: 2

Documentation

Index

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()
}

Jump to

Keyboard shortcuts

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