Skip to content

Commit

Permalink
rename project
Browse files Browse the repository at this point in the history
  • Loading branch information
Jemmy committed Jan 20, 2021
1 parent b16d9bd commit 6d1cfa8
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 21 deletions.
2 changes: 1 addition & 1 deletion cmd/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.
package cmd

import (
"github.com/jemmyh/terminal_note/note"
"github.com/jemmyh/tnote/note"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package cmd
import (
"fmt"

"github.com/jemmyh/terminal_note/note"
"github.com/jemmyh/tnote/note"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.
package cmd

import (
"github.com/jemmyh/terminal_note/note"
"github.com/jemmyh/tnote/note"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/print.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"fmt"

"github.com/boltdb/bolt"
"github.com/jemmyh/terminal_note/note"
"github.com/jemmyh/tnote/note"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"os"
"os/user"

"github.com/jemmyh/terminal_note/note"
"github.com/jemmyh/tnote/note"
"github.com/spf13/cobra"
"gopkg.in/AlecAivazis/survey.v1"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package cmd
import (
"fmt"

"github.com/jemmyh/terminal_note/note"
"github.com/jemmyh/tnote/note"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package main

import "github.com/jemmyh/terminal_note/cmd"
import "github.com/jemmyh/tnote/cmd"

/*
* @CreateTime: 2021/1/14 15:31
Expand Down
15 changes: 7 additions & 8 deletions note/note.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,16 @@ import (
/*
* @CreateTime: 2021/1/12 18:28
* @Author: Jemmy@[email protected]
* @Description: note is a message in notebook
* @Description: note is a message in notebook, which is managed like a node in a double linked list.
*/

// Note means a diary note
// Note means a note in notebook
type Note struct {
ID []byte // 某一天20191214
PrevID []byte // 上一条ID
NextID []byte // 下一条ID
Content []byte // 日记内容
IsSecret bool // TODO: 是否加密,如果加密,则需要密码访问
Timestamp int64 // 时间戳
ID []byte
PrevID []byte
NextID []byte
Content []byte
Timestamp int64
}

// NewNote returns a `Note` object with `content` and `timestamp`
Expand Down
4 changes: 2 additions & 2 deletions note/note_book.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func (b *NoteBook) DeleteNotePrefix(id []byte, userName, pwd string) {

// GetDbFilePath returns the notebook path for userName.
func GetDbFilePath(userName string) string {
// ~/.terminal_note/terminal_diary_xxx.db
// ~/.tnote/terminal_diary_xxx.db
folderName := GetAppFolderPath()
if _, err := os.Stat(folderName); os.IsNotExist(err) {
err := os.Mkdir(folderName, os.ModePerm)
Expand Down Expand Up @@ -248,7 +248,7 @@ func CheckDbFileExist(userName string) bool {
}

func GetAppFolderPath() string {
// ~/.terminal_note/
// ~/.tnote/
user, _ := user2.Current()
return user.HomeDir + "/" + GetAppHome()
}
Expand Down
8 changes: 4 additions & 4 deletions note/varables.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ const (
// version ...
version = "v2.0.0"
// appHome is the folder name for App
appHome = ".terminal_note"
appHome = ".tnote"

// idLayout use timestamp as note id
idLayout = "20060102150405"

// dbFileNameTemplate local file to save a notebook
dbFileNameTemplate = ".terminal_note_%s.db"
dbFileNameTemplate = ".tnote_%s.db"
// dbBucket bucket name to save all notes in a notebook
dbBucket = "diary"
// dbHeadKey default key to save the first tip note, which is generated default
Expand All @@ -30,8 +30,8 @@ const (
tailContent = "end"

rsaBits = 2048
pubKeyTempName = "terminal_note_%s_rsa.pub"
prvTempName = "terminal_note_%s_rsa"
pubKeyTempName = "tnote_%s_rsa.pub"
prvTempName = "tnote_%s_rsa"
)

// GetAppName ...
Expand Down

0 comments on commit 6d1cfa8

Please sign in to comment.