Documentation ¶
Index ¶
- Constants
- type TNustDBClient
- func (s *TNustDBClient) Del(keyname string) error
- func (s *TNustDBClient) DelAll(keyname string) error
- func (s *TNustDBClient) Get(keyname string) (value string, err error)
- func (s *TNustDBClient) GetAll(keyname string) (items []*TNustDBField, err error)
- func (d *TNustDBClient) GetHead() string
- func (s *TNustDBClient) Set(keyname string, value string, args ...int) error
- func (d *TNustDBClient) SetHead(head string)
- type TNustDBField
Constants ¶
View Source
const ( ConnTimeout = time.Second * 3 OperTimeout = time.Second * 5 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TNustDBClient ¶
type TNustDBClient struct {
// contains filtered or unexported fields
}
func GetInstance ¶
func GetInstance(bucket_name, db_path string) *TNustDBClient
*
- 获取一个单例,可以用这个不需要考虑线程安全
func GetSafeInstance ¶
func GetSafeInstance(bucket_name, db_path string) *TNustDBClient
*
- 获取一个线程安全的单例
func InitInstance ¶
func InitInstance(bucket_name, db_path string) *TNustDBClient
*
- 初始化一个单例,一般用于程序启动时
func (*TNustDBClient) DelAll ¶
func (s *TNustDBClient) DelAll(keyname string) error
func (*TNustDBClient) Get ¶
func (s *TNustDBClient) Get(keyname string) (value string, err error)
*
- Get Single Key
func (*TNustDBClient) GetAll ¶
func (s *TNustDBClient) GetAll(keyname string) (items []*TNustDBField, err error)
func (*TNustDBClient) Set ¶
func (s *TNustDBClient) Set(keyname string, value string, args ...int) error
*
- Set Value ttl : NusDB支持TTL(存活时间)的功能,可以对指定的bucket里的key过期时间的设置
func (*TNustDBClient) SetHead ¶
func (d *TNustDBClient) SetHead(head string)
type TNustDBField ¶
Click to show internal directories.
Click to hide internal directories.