1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- package bitcoin
- import (
- "fmt"
- "runtime"
- "strings"
- "time"
- )
- type config struct {
- Title string
- WalletInfo walletinfo `toml:"walletinfo"`
- Limit limit `toml:"limit"`
- Rpc rpc `toml:"rpc"`
- Db databaseinfo `toml:"db"`
- Pubkey pubkeyinfo `toml:"pubkey"`
- Count count `toml:"count"`
- }
- type limit struct {
- Fee string
- }
- type walletinfo struct {
- WalletKey string
- }
- type rpc struct {
- Rpcuser string
- Rpcpassword string
- Rpchost string
- Rpcport int
- }
- type databaseinfo struct {
- DbPath string
- }
- type pubkeyinfo struct {
- Pubkeystr string
- }
- type count struct {
- Startcount uint32
- Endcount uint32
- }
- func LOG(info string, format string, v ...interface{}) {
- _, file, line, _ := runtime.Caller(1)
- fpaths := strings.Split(file, "/")
- size := len(fpaths)
- var sysflag = "lite package"
- if format == "" {
- fmt.Printf("%v |%v|%v|%v()|%v|%v\n", time.Now().Format("2006-01-02 15:04:05"), info, sysflag, fpaths[size-1], line, fmt.Sprintln(v...))
- } else {
- fmt.Printf("%v|%v|%v|%v|%v|%v\n", time.Now().Format("2006-01-02 15:04:05"), info, sysflag, fpaths[size-1], line, fmt.Sprintf(format, v...))
- }
- }
|