util

package
v0.0.0-...-25cadc1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2018 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultDbpath string = "./bottos.db"

DefaultDbpath is DefaultDbpath

View Source
const DefualtAgingTime int64 = 30 * 60

DefualtAgingTime int64

View Source
const InserTxInfoSql string = "INSERT INTO txinfo(TransactionID,Price,Type,From,To,Date,BlockId) values(?,?,?,?,?,?,?)"

InserTxInfoSql const

View Source
const InserUserInfoSql string = "" /* 153-byte string literal not displayed */

InserUserInfoSql string

View Source
const InsertUserFileSql string = "insert into fileinfo(FileHash,Username,FileName,FileSize,FileNumber,FilePolicy,AuthorizedStorage) values(?,?,?,?,?,?,?)"

InsertUserFileSql is insert sql

View Source
const InsertUserRequireSql string = "" /* 162-byte string literal not displayed */

InsertUserRequireSql is sql

View Source
const InsertUserTokenSql string = "insert into tokeninfo(Username, Token,InsertTime) values(?,?,?)"

InsertUserTokenSql string

View Source
const QueryUserInfoSql string = "select * from userinfo"

QueryUserInfoSql string

Variables

This section is empty.

Functions

func FuncLog

func FuncLog(depthList ...int) string

FuncLog is to log

func YesterdayDur

func YesterdayDur() (time.Time, time.Time)

YesterdayDur is to YesterdayDur

Types

type AccountInfo

type AccountInfo struct {
	AccountName       string `json:"account_name"`
	BtoBalance        string `json:"bto_balance"`
	StakedBalance     string `json:"staked_balance"`
	UnstakingBalance  string `json:"unstaking_balance"`
	LastUnstakingTime string `json:"last_unstaking_time"`
	Permissions       []struct {
		PermName     string `json:"perm_name"`
		Parent       string `json:"parent"`
		RequiredAuth struct {
			Threshold int `json:"threshold"`
			Keys      []struct {
				Key    string `json:"key"`
				Weight int    `json:"weight"`
			} `json:"keys"`
			Accounts []interface{} `json:"accounts"`
		} `json:"required_auth"`
	} `json:"permissions"`
}

AccountInfo struct

type AssetDBInfo

type AssetDBInfo struct {
	AssetID     string `bson:"asset_id" json:"asset_id"`
	UserName    string `bson:"user_name" json:"user_name"`
	AssetName   string `bson:"asset_name" json:"asset_name"`
	FeatureTag  uint64 `bson:"feature_tag" json:"feature_tag"`
	SamplePath  string `bson:"sample_path" json:"sample_path"`
	SampleHash  string `bson:"sample_hash" json:"sample_hash"`
	StoragePath string `bson:"storage_path" json:"storage_path"`
	StorageHash string `bson:"storage_hash" json:"storage_hash"`
	ExpireTime  uint32 `bson:"expire_time" json:"expire_time"`
	Price       uint64 `bson:"price" json:"price"`
	Description string `bson:"description" json:"description"`
	UploadDate  uint32 `bson:"upload_date" json:"upload_date"`
}

AssetDBInfo struct

type Block

type Block struct {
	Previous              string        `json:"previous"`
	Timestamp             string        `json:"timestamp"`
	TransactionMerkleRoot string        `json:"transaction_merkle_root"`
	Producer              string        `json:"producer"`
	ProducerChanges       []interface{} `json:"producer_changes"`
	ProducerSignature     string        `json:"producer_signature"`
	Cycles                []interface{} `json:"cycles"`
	ID                    string        `json:"id"`
	BlockNum              uint64        `json:"block_num"`
	RefBlockPrefix        uint64        `json:"ref_block_prefix"`
}

Block struct

type CodeInfo

type CodeInfo struct {
	Previous string `json:"previous"`
}

CodeInfo struct

type DataPresaleDBInfo

type DataPresaleDBInfo struct {
	DataPresaleID string `json:"data_presale_id"`
	UserName      string `json:"user_name"`
	AssetID       string `json:"asset_id"`
	DataReqID     string `json:"data_req_id"`
	Consumer      string `json:"consumer"`
}

DataPresaleDBInfo struct

type DayRange

type DayRange struct {
	Begin time.Time
	End   time.Time
}

DayRange struct

func WeekDur

func WeekDur() []*DayRange

WeekDur is to WeekDur

type FavoritDBInfo

type FavoritDBInfo struct {
	UserName  string `json:"user_name"`
	OpType    string `json:"op_type"`
	GoodsType string `json:"goods_type"`
	GoodsID   string `json:"goods_id"`
}

FavoritDBInfo struct

type FileDBInfo

type FileDBInfo struct {
	FileHash          string `json:"file_hash"`
	Username          string `json:"username"`
	FileName          string `json:"file_name"`
	FileSize          uint64 `json:"file_size"`
	FileNumber        uint64 `json:"file_number"`
	FilePolicy        string `json:"file_policy"`
	AuthorizedStorage string `json:"authorized_storage"`
}

FileDBInfo struct

type Info

type Info struct {
	ServerVersion            string `json:"server_version"`
	HeadBlockNum             uint64 `json:"head_block_num"`
	LastIrreversibleBlockNum uint64 `json:"last_irreversible_block_num"`
	HeadBlockID              string `json:"head_block_id"`
	HeadBlockTime            string `json:"head_block_time"`
	HeadBlockProducer        string `json:"head_block_producer"`
	RecentSlots              string `json:"recent_slots"`
	ParticipationRate        string `json:"participation_rate"`
}

Info struct

type NodeDBInfo

type NodeDBInfo struct {
	NodeId   string `json:"node_id"`
	NodeIP   string `json:"node_ip"`
	NodePort string `json:"node_port"`
}

NodeDBInfo struct

type RequirementDBInfo

type RequirementDBInfo struct {
	RequirementId   string `bson:"requirement_id" json:"requirement_id"`
	Username        string `bson:"username" json:"username"`
	RequirementName string `bson:"requirement_name" json:"requirement_name"`
	FeatureTag      uint64 `bson:"feature_tag" json:"feature_tag"`
	SamplePath      string `bson:"sample_path" json:"sample_path"`
	SampleHash      string `bson:"sample_hash" json:"sample_hash"`
	ExpireTime      uint32 `bson:"expire_time" json:"expire_time"`
	Price           uint64 `bson:"price" json:"price"`
	Description     string `bson:"description" json:"description"`
	PublishDate     uint32 `bson:"publish_date" json:"publish_date"`
}

RequirementDBInfo struct

type SyncDBInfo

type SyncDBInfo struct {
	SyncedNumber string `json:"synced_number"`
}

SyncDBInfo struct

type TokenDBInfo

type TokenDBInfo struct {
	Username   string `db:"username"`
	Token      string `db:"token"`
	InsertTime int64  `db:"insert_time"`
}

TokenDBInfo struct

type TransferDBInfo

type TransferDBInfo struct {
	TransactionID string `json:"tx_id"`
	From          string `json:"from"`
	To            string `json:"to"`
	Price         uint64 `json:"price"`
	TxTime        string `json:"tx_time"`
	BlockNum      uint64 `json:"block_num"`
}

TransferDBInfo struct

type TxDBInfo

type TxDBInfo struct {
	TransactionID string `json:"transaction_id"`
	From          string `json:"from"`
	To            string `json:"to"`
	Price         uint64 `json:"price"`
	Type          uint64 `json:"type"`
	Date          string `json:"date"`
	BlockId       uint64 `json:"block_id"`
}

TxDBInfo struct

type TxInfo

type TxInfo struct {
	TransactionID string `json:"transaction_id"`
	Transaction   struct {
		RefBlockNum    uint64        `json:"ref_block_num"`
		RefBlockPrefix uint64        `json:"ref_block_prefix"`
		Expiration     string        `json:"expiration"`
		Scope          []string      `json:"scope"`
		Signatures     []interface{} `json:"signatures"`
		Messages       []struct {
			Code          string        `json:"code"`
			Type          string        `json:"type"`
			Authorization []interface{} `json:"authorization"`
			Data          struct {
				UserName  string `json:"user_name"`
				BasicInfo struct {
					Info string `json:"info"`
				} `json:"basic_info"`
			} `json:"data"`
			HexData string `json:"hex_data"`
		} `json:"messages"`
		Output []struct {
			Notify       []interface{} `json:"notify"`
			DeferredTrxs []interface{} `json:"deferred_trxs"`
		} `json:"output"`
	} `json:"transaction"`
}

TxInfo struct

type UserDBInfo

type UserDBInfo struct {
	Username       string `db:"username"`
	Accountname    string `db:"accountname"`
	Ownerpubkey    string `db:"owner_pub_key"`
	Activepubkey   string `db:"active_pub_key"`
	EncyptedInfo   string `db:"encypted_info"`
	UserType       string `db:"user_type"`
	RoleType       string `db:"role_type"`
	CompanyName    string `db:"company_name"`
	CompanyAddress string `db:"company_address"`
}

UserDBInfo struct

type UserInfo

type UserInfo struct {
	Username     string `db:"username"`
	Accountname  string `db:"accountname"`
	Ownerpubkey  string `db:"ownerpubkey"`
	Activepubkey string `db:"activepubkey"`
	UserType     string `db:"user_type"`
	RoleType     string `db:"role_type"`
	Info         string `db:"info"`
}

UserInfo struct

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL