Documentation ¶
Overview ¶
Copyright 2016 Wenhui Shen <www.webx.top>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2016 Wenhui Shen <www.webx.top>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2016 Wenhui Shen <www.webx.top>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2016 Wenhui Shen <www.webx.top>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Variables
- func Decode(data []byte, to interface{}) error
- func Encode(data interface{}) ([]byte, error)
- func Md5(v string) string
- type Bolt
- func (bd *Bolt) Close() error
- func (bd *Bolt) ConsumeValue(key string, f func([]byte) error) error
- func (bd *Bolt) Del(key string) error
- func (bd *Bolt) Get(key string) (interface{}, error)
- func (bd *Bolt) Has(key string) (bool, error)
- func (bd *Bolt) Put(key string, val interface{}) error
- func (bd *Bolt) PutMany(data map[string]interface{}) error
- type Closer
- type LevelDB
- type Memcache
- func (rc *Memcache) ClearAll() error
- func (rc *Memcache) Decr(key string, delta uint64) error
- func (rc *Memcache) Del(key string) error
- func (rc *Memcache) Get(key string) (interface{}, error)
- func (rc *Memcache) Incr(key string, delta uint64) error
- func (rc *Memcache) IsExist(key string) bool
- func (rc *Memcache) Put(key string, value interface{}) error
- type Redis
- func (rc *Redis) ClearAll() error
- func (rc *Redis) Connect(config string) error
- func (rc *Redis) Decr(key string, delta uint64) error
- func (rc *Redis) Del(key string) error
- func (rc *Redis) Get(key string) (interface{}, error)
- func (rc *Redis) Incr(key string, delta uint64) error
- func (rc *Redis) IsExist(key string) bool
- func (rc *Redis) Put(key string, value interface{}) error
Constants ¶
This section is empty.
Variables ¶
var ( // the collection name of redis for cache adapter. DefaultKey string = "WebxRedis" )
Functions ¶
Types ¶
type Bolt ¶
type Bolt struct { Debug bool // contains filtered or unexported fields }
Bolt implements ds.Datastore TODO: use buckets to represent the heirarchy of the ds.Keys
type LevelDB ¶
type LevelDB struct { Debug bool // contains filtered or unexported fields }
LevelDB implements CacheStore provide local machine
func NewLevelDB ¶
type Memcache ¶
Memcache adapter.
func NewMemcache ¶
create new memcache adapter.
type Redis ¶
Redis cache adapter.
func (*Redis) Connect ¶
start redis cache adapter. config is like {"key":"collection key","conn":"connection info","dbnum":"0"} the cache item in redis are stored forever, so no gc operation.