Documentation ¶
Index ¶
- Constants
- Variables
- func BytesToString(b []byte) string
- func StringToBytes(s string) (b []byte)
- type CmdPacket
- func (c *CmdPacket) Decrypt(seq uint8) error
- func (c *CmdPacket) Encrypt(seq uint8) (raw []byte)
- func (c *CmdPacket) Put()
- func (c *CmdPacket) ReadFrom(f io.Reader) (n int64, err error)
- func (c *CmdPacket) Refresh(cmd uint8, data []byte, t *tea.TEA)
- func (c *CmdPacket) Write(buf []byte) (n int, err error)
- type Regedit
- func (r *Regedit) Cat() (*Storage, error)
- func (r *Regedit) Close() (err error)
- func (r *Regedit) Connect() (err error)
- func (r *Regedit) ConnectIn(timeout time.Duration) (err error)
- func (r *Regedit) Del(key string) error
- func (r *Regedit) Get(key string) (string, error)
- func (r *Regedit) IsMd5Equal(m [md5.Size]byte) (bool, error)
- func (r *Regedit) Load() (*Storage, error)
- func (r *Regedit) Set(key, value string) error
- type Storage
Constants ¶
View Source
const ( CMDGET uint8 = iota CMDCAT CMDMD5 CMDACK CMDEND CMDSET CMDDEL CMDDAT )
View Source
const ( ACKNONE uint8 = iota<<4 + 3 ACKSUCC ACKDATA ACKNULL ACKNEQU ACKERRO )
Variables ¶
View Source
var ( ErrGetKeyTooLong = errors.New("reg: get key too long") ErrDecAck = errors.New("reg: decrypt ack error") ErrInternalServer = errors.New("reg: internal server error") ErrPermissionDenied = errors.New("reg: permission denied") ErrSetKeyTooLong = errors.New("reg: set key too long") ErrSetValTooLong = errors.New("reg: set val too long") ErrUnknownAck = errors.New("reg: unknown ack error") ErrNoSuchKey = errors.New("reg: no such key") ErrRawDataTooLong = errors.New("reg: raw data too long") ErrMd5NotEqual = errors.New("reg: md5 not equal") ErrInvalidCatData = errors.New("reg: invalid cat data") ErrNilStorData = errors.New("reg: nil stor data") )
View Source
var (
ErrMd5Mismatch = errors.New("cmd: md5 mismatch")
)
Functions ¶
func StringToBytes ¶ added in v0.0.3
StringToBytes 没有内存开销的转换
Types ¶
type CmdPacket ¶
type CmdPacket struct { io.ReaderFrom Data []byte // contains filtered or unexported fields }
func ReadCmdPacket ¶ added in v0.1.0
type Regedit ¶
type Regedit struct {
// contains filtered or unexported fields
}
func NewRegReader ¶
func NewRegedit ¶
func (*Regedit) IsMd5Equal ¶ added in v0.2.0
Click to show internal directories.
Click to hide internal directories.