Documentation ¶
Index ¶
- Constants
- Variables
- func Clear() (err error)
- func CloseDb()
- func Count() int64
- func CreateInBatches(models []Model) (err error)
- func DeleteByTag(tag string) error
- func FetchRepositoryContent() []*github.RepositoryContent
- func FetchUrlContent(ctx context.Context, filename string) ([]byte, string, error)
- func Flush() (err error)
- func Get(url string) ([]byte, error)
- func GetToken(token string) string
- func InitDb(dsn string)
- func NewClient(token string)
- func SpinnerStart(prefix string)
- func SpinnerStop()
- type Model
Constants ¶
View Source
const CommandName = "sync"
View Source
const CommandUsage = "同步远程数据保存到本地 sqlite 数据库"
View Source
const GoCommandName = "sync-go"
View Source
const GoCommandUsage = "同步远程 go package 保存到本地 sqlite 数据库"
View Source
const GoTagName = "go-package"
View Source
const Owner = "xiaoxuan6"
View Source
const Repo = "resource"
View Source
const SqlitePath = "rsearch.db"
Variables ¶
View Source
var (
Client *github.Client
)
View Source
var DB *gorm.DB
View Source
var FgColor = map[string][]string{
"github": {"github", "GitHub"},
"color": {"color", "Color"},
"api": {"api", "Api", "API"},
"markdown": {"markdown", "Markdown"},
"json": {"json", "JSON"},
"sql": {"sql", "SQL"},
"tool": {"tool", "Tool"},
"cli": {"cli", "CLI"},
}
Functions ¶
func CreateInBatches ¶
func DeleteByTag ¶
func FetchRepositoryContent ¶ added in v0.1.1
func FetchRepositoryContent() []*github.RepositoryContent
func FetchUrlContent ¶ added in v0.1.1
func SpinnerStart ¶ added in v0.1.0
func SpinnerStart(prefix string)
func SpinnerStop ¶ added in v0.1.0
func SpinnerStop()
Types ¶
Click to show internal directories.
Click to hide internal directories.