Documentation ¶
Index ¶
- func Base58Decode(input []byte) []byte
- func Base58Encode(input []byte) []byte
- func CheckDbFileExist(userName string) bool
- func DecryptString(source []byte) string
- func EncryptString(source string) []byte
- func FormatTimestamp(t int64) string
- func GenKeyForUserWithPasswd(userName, passwd string)
- func GetAppFolderPath() string
- func GetAppHome() string
- func GetAppName() string
- func GetDbBucketName() string
- func GetDbFilePath(userName string) string
- func GetDbHeadKey() string
- func GetDbTailKey() string
- func GetHeadDefaultContent() string
- func GetPrivateKeyName() string
- func GetPrivateKeyPath(userName string) string
- func GetPrvKey(userName string) []byte
- func GetPubKey(userName string) []byte
- func GetPubKeyName() string
- func GetPublicKeyPath(userName string) string
- func GetTailDefaultContent() string
- func GetVersion() string
- func RSADecrypt(encryptedSrc []byte, prvKey []byte) (res []byte, err error)
- func RSADecryptWithPwd(src []byte, prvKey []byte, pwd string) (res []byte, err error)
- func RSAEncrypt(src []byte, pubKey []byte) (res []byte, err error)
- func RSAGenKey(bits int) (pubKey, prvKey []byte, err error)
- func RSAGenKeyWithPwd(bits int, pwd string) (pubKey, prvKey []byte, err error)
- func StringToBytes(str string) []byte
- type Data
- type Note
- type NoteBook
- type NoteIter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base58Encode ¶
Base58Encode encodes a byte array to Base58
func CheckDbFileExist ¶
func DecryptString ¶
DecryptString decodes `source` with gob.
func EncryptString ¶
EncryptString encodes `source` with gob.
func FormatTimestamp ¶
FormatTimestamp transform timestamp to formatted time string.
func GenKeyForUserWithPasswd ¶
func GenKeyForUserWithPasswd(userName, passwd string)
func GetAppFolderPath ¶
func GetAppFolderPath() string
func GetDbBucketName ¶
func GetDbBucketName() string
GetDbBucketName returns default bucket name for a notebook.
func GetDbFilePath ¶
GetDbFilePath returns the notebook path for userName.
func GetHeadDefaultContent ¶
func GetHeadDefaultContent() string
GetHeadDefaultContent returns content for the first note generated by system.
func GetPrivateKeyPath ¶
func GetPublicKeyPath ¶
func GetTailDefaultContent ¶
func GetTailDefaultContent() string
GetTailDefaultContent returns content for the last note generated by system.
func RSADecrypt ¶
RSADecrypt decrypt encrypted data with private key.
func RSADecryptWithPwd ¶
RSADecryptWithPwd decrypt src with private key and password
func RSAEncrypt ¶
RSAEncrypt use publicKey to encrypt source data.
func RSAGenKeyWithPwd ¶
-------------------------------- RSAGenKeyWithPwd generate rsa pair key with specified password
func StringToBytes ¶
StringToBytes change str to bytes without malloc.
Types ¶
type Note ¶
Note means a note in notebook
func DeserializeNote ¶
DeserializeNote decodes bytes to Note.
func (*Note) SimpleString ¶
type NoteBook ¶
NoteBook represents a diary book that contains many diary notes.
func CreateNewNoteBook ¶
CreateNewNoteBook creates a NoteBook for userName.
func GetNoteBook ¶
GetNoteBook return userName's NoteBook
func (*NoteBook) DeleteNotePrefix ¶
DeleteNotePrefix delete notes that match prefix of `id`.