Documentation
¶
Index ¶
- Constants
- Variables
- func AddBlock(block *Block) error
- func AddUpdateTopicInfo(topicName string, numPosts int, followers int, recentPost time.Time) error
- func AttachUnreadToTopics(topics []*view.Topic, userPkHash []byte) error
- func ContainsWatchedPkHash(pkHashes [][]byte) (bool, error)
- func Find(out interface{}, where ...interface{}) error
- func GetCountMemoFollows() (uint, error)
- func GetCountMemoLikes() (uint, error)
- func GetCountMemoPollOption() (uint, error)
- func GetCountMemoPollQuestion() (uint, error)
- func GetCountMemoPollVote() (uint, error)
- func GetCountMemoPosts() (uint, uint, uint, uint, error)
- func GetCountMemoSetName() (uint, error)
- func GetCountMemoSetPic() (uint, error)
- func GetCountMemoSetProfile() (uint, error)
- func GetCountMemoTopicFollow() (uint, error)
- func GetCsrfTokenString(cookieId string) (string, error)
- func GetFollowerCountForPkHash(followPkHash []byte) (uint, error)
- func GetFollowerCountForTopic(topic string) (uint, error)
- func GetFollowingCountForPkHash(pkHash []byte) (uint, error)
- func GetLastNotificationId(userId uint) (uint, error)
- func GetLastTopicPostId(userPkHash []byte, topic string) (uint, error)
- func GetMemoCohortStats() ([]view.MemoCohortStat, error)
- func GetMemoTopicFollowCountForUser(pkHash []byte) (uint, error)
- func GetPersonalizedRecentTopLikedTxHashes(selfPkHash []byte, offset uint, timeStart time.Time, timeEnd time.Time) ([][]byte, error)
- func GetPostReplyCount(txHash []byte) (uint, error)
- func GetRecentTopLikedTxHashes(offset uint, timeStart time.Time, timeEnd time.Time) ([][]byte, error)
- func GetThreads(offset uint, topic string) ([]*view.Thread, error)
- func GetTopicInfo(offset uint, searchString string, pkHash []byte, orderType view.TopicOrderType) ([]*view.Topic, error)
- func GetTopicInfoFromPosts(topicNames ...string) ([]*view.Topic, error)
- func GetUniqueMemoAPkHashes(offset int, searchString string, orderType UserStatOrderType) ([]*view.Profile, error)
- func GetUniqueMemoAPkHashesMatchName(searchString string, offset int) ([][]byte, error)
- func GetUniqueUserCount() (int, error)
- func GetUnreadNotificationCount(pkHash []byte, lastNotificationId uint) (uint, error)
- func GetUserFirstPostStats() ([]view.UserDateStat, error)
- func GetUserIdFromPkHash(pkHash []byte) (uint, error)
- func GetUserStats() ([]view.UserStat, error)
- func HasSpendable(pkHash []byte) (bool, error)
- func IsAlreadyExistsError(e error) bool
- func IsDuplicateEntryError(e error) bool
- func IsFollowing(followerPkHash []byte, followingPkHash []byte) (bool, error)
- func IsFollowingTopic(pkHash []byte, topic string) (bool, error)
- func IsNoRowsInResultSetError(e error) bool
- func IsRecordNotFoundError(e error) bool
- func IsValidDefaultTip(defaultTip uint) bool
- func IsValidIntegrationsSetting(integrations string) bool
- func IsValidThemeSetting(theme string) bool
- func Save(value interface{}) error
- func SaveBlocks(blocks []*Block) error
- func SetLastNotificationId(userId uint, lastNotificationId uint) error
- func SetLastTopicPostId(userPkHash []byte, topic string, lastPostId uint) error
- func ToSnake(in string) string
- func UpdateCsrfTokenSession(oldCookieId string, newCookieId string) error
- type Block
- func ConvertMessageHeaderToBlock(header *wire.BlockHeader) *Block
- func GetBlockByHash(hash chainhash.Hash) (*Block, error)
- func GetBlockByHeight(height uint) (*Block, error)
- func GetBlocksInHeightRange(startHeight uint, endHeight uint) ([]*Block, error)
- func GetGenesis() (*Block, error)
- func GetRecentBlock() (*Block, error)
- type CsrfToken
- type FeedEvent
- func GetFeedByTxHash(txHash []byte) (*FeedEvent, error)
- func GetRecentFeedEvents(offset uint) ([]*FeedEvent, error)
- func GetRecentFeedForPkHash(pkHash []byte, offset uint) ([]*FeedEvent, error)
- func GetRecentFeedUserEvents(pkHash []byte, offset uint, eventTypes []FeedEventType) ([]*FeedEvent, error)
- type FeedEventType
- type Key
- func GenerateKey(name string, password string, userId uint) (*Key, error)
- func GetAllKeys() ([]*Key, error)
- func GetKey(id uint, userId uint) (*Key, error)
- func GetKeyForUser(userId uint) (*Key, error)
- func GetKeyFromPublicKey(publicKey []byte) (*Key, error)
- func GetKeysForUser(userId uint) ([]*Key, error)deprecated
- func ImportKey(name string, password string, wif string, userId uint) (*Key, error)
- type MemoFollow
- func GetAllFollows(offset uint) ([]*MemoFollow, error)
- func GetFollowersForPkHash(pkHash []byte, offset int) ([]*MemoFollow, error)
- func GetFollowingForPkHash(followPkHash []byte, offset int) ([]*MemoFollow, error)
- func GetMemoFollow(txHash []byte) (*MemoFollow, error)
- func GetMemoFollowsByTxHashes(txHashes [][]byte) ([]*MemoFollow, error)
- type MemoLike
- func GetLikes(offset uint) ([]*MemoLike, error)
- func GetMemoLike(txHash []byte) (*MemoLike, error)
- func GetMemoLikesByTxHashes(txHashes [][]byte) ([]*MemoLike, error)
- func GetMemoLikesForPkHash(pkHash []byte) ([]*MemoLike, error)
- func GetMemoLikesForTxnHash(txHash []byte) ([]*MemoLike, error)
- func GetRecentLikes(offset uint) ([]*MemoLike, error)
- func GetRecentLikesForTopic(topic string, lastLikeId uint) ([]*MemoLike, error)
- type MemoPollOption
- type MemoPollQuestion
- type MemoPollVote
- type MemoPost
- func GetMemoPost(txHash []byte) (*MemoPost, error)
- func GetMemoPostById(id uint) (*MemoPost, error)
- func GetOlderPostsForTopic(topic string, firstPostId uint) ([]*MemoPost, error)
- func GetPersonalizedTopPosts(selfPkHash []byte, offset uint, timeStart time.Time, timeEnd time.Time) ([]*MemoPost, error)
- func GetPollsPosts(offset uint) ([]*MemoPost, error)
- func GetPostReplies(txHash []byte, offset uint) ([]*MemoPost, error)
- func GetPosts(offset uint) ([]*MemoPost, error)
- func GetPostsByTxHashes(txHashes [][]byte) ([]*MemoPost, error)
- func GetPostsFeedForPkHash(pkHash []byte, offset uint) ([]*MemoPost, error)
- func GetPostsForPkHash(pkHash []byte, offset uint) ([]*MemoPost, error)
- func GetPostsForTopic(topic string, offset uint) ([]*MemoPost, error)
- func GetRankedPosts(offset uint, searchString string) ([]*MemoPost, error)
- func GetRecentPosts(offset uint, searchString string) ([]*MemoPost, error)
- func GetRecentPostsForTopic(topic string, lastPostId uint) ([]*MemoPost, error)
- func GetRecentReplyPosts(offset uint) ([]*MemoPost, error)
- func GetTopPosts(offset uint, timeStart time.Time, timeEnd time.Time) ([]*MemoPost, error)
- func (m MemoPost) GetAddress() wallet.Address
- func (m MemoPost) GetAddressString() string
- func (m MemoPost) GetMessage() string
- func (m MemoPost) GetParentTransactionHashString() string
- func (m MemoPost) GetRootTransactionHashString() string
- func (m MemoPost) GetScriptString() string
- func (m MemoPost) GetTimeString() string
- func (m MemoPost) GetTransactionHashString() string
- func (m MemoPost) GetUrlEncodedTopic() string
- func (m *MemoPost) Save() error
- type MemoSetName
- func GetMemoSetName(txHash []byte) (*MemoSetName, error)
- func GetMemoSetNameById(id uint) (*MemoSetName, error)
- func GetNameForPkHash(pkHash []byte) (*MemoSetName, error)
- func GetNamesForPkHashes(pkHashes [][]byte) ([]*MemoSetName, error)
- func GetSetNames(offset uint) ([]*MemoSetName, error)
- func GetSetNamesByTxHashes(txHashes [][]byte) ([]*MemoSetName, error)
- type MemoSetPic
- func GetMemoSetPic(txHash []byte) (*MemoSetPic, error)
- func GetMemoSetPicById(id uint) (*MemoSetPic, error)
- func GetPicForPkHash(pkHash []byte) (*MemoSetPic, error)
- func GetPicsForPkHashes(pkHashes [][]byte) ([]*MemoSetPic, error)
- func GetSetProfilePics(offset uint) ([]*MemoSetPic, error)
- func GetSetProfilePicsByTxHashes(txHashes [][]byte) ([]*MemoSetPic, error)
- type MemoSetProfile
- func GetMemoSetProfile(txHash []byte) (*MemoSetProfile, error)
- func GetMemoSetProfileById(id uint) (*MemoSetProfile, error)
- func GetProfileForPkHash(pkHash []byte) (*MemoSetProfile, error)
- func GetSetProfiles(offset uint) ([]*MemoSetProfile, error)
- func GetSetProfilesByTxHashes(txHashes [][]byte) ([]*MemoSetProfile, error)
- func GetSetProfilesForPkHash(pkHash []byte) ([]*MemoSetProfile, error)
- type MemoTest
- type MemoTopicFollow
- type NodeStatus
- type Notification
- type Peer
- type Session
- type TopicInfo
- type Transaction
- func (t *Transaction) Delete() error
- func (t *Transaction) GetBlockHeight() string
- func (t *Transaction) GetBlockTime() string
- func (t *Transaction) GetChainHash() *chainhash.Hash
- func (t *Transaction) GetFee() int64
- func (t *Transaction) GetFeeBCH() float64
- func (t *Transaction) GetKeyId() uint
- func (t *Transaction) GetValues() map[string]*Value
- func (t *Transaction) HasFee() bool
- func (t *Transaction) HasUserKey(userId uint) bool
- func (t *Transaction) Save() error
- type TransactionIn
- func (t TransactionIn) Delete() error
- func (t TransactionIn) GetAddress() wallet.Address
- func (t TransactionIn) GetAddressString() string
- func (t TransactionIn) GetHashString() string
- func (t TransactionIn) GetOutPoint() *wire.OutPoint
- func (t *TransactionIn) GetPkHash() []byte
- func (t TransactionIn) GetPrevOutPointHash() []byte
- func (t TransactionIn) GetPrevOutPointString() string
- func (t TransactionIn) GetPublicKey() []byte
- func (t TransactionIn) HasOut() bool
- func (t TransactionIn) Save() error
- type TransactionOut
- func (t TransactionOut) GetAddressString() string
- func (t TransactionOut) GetHashString() string
- func (t TransactionOut) GetMessage() string
- func (t TransactionOut) GetPkHash() []byte
- func (t TransactionOut) GetScriptClass() string
- func (t TransactionOut) HasIn() bool
- func (t TransactionOut) IsMemo() bool
- func (t TransactionOut) IsSpendable() bool
- func (t TransactionOut) Save() error
- func (t TransactionOut) ValueInBCH() float64
- type TxHashCount
- type TxOutSortByValue
- type User
- type UserAction
- type UserSettings
- type UserStat
- type UserStatOrderType
- type UserTopicView
- type Value
Constants ¶
View Source
const ( BlockTable = "Block" KeyTable = "Key" TxOutTable = "TxOut" TransactionTable = "Transaction" TransactionBlockTbl = "Transaction.Block" )
View Source
const ( RankCountBoost int = 60 RankGravity float32 = 2 )
View Source
const ( NotificationTypeLike = 1 NotificationTypeReply = 2 NotificationTypeThreadReply = 3 NotificationTypeNewFollower = 4 )
View Source
const ( SettingIntegrationsAll = "all" SettingIntegrationsHide = "hide" SettingIntegrationsNone = "none" SettingThemeDefault = "default" SettingThemeDark = "dark" MaxDefaultTip = 1e9 )
Variables ¶
View Source
var PostEvents = []FeedEventType{ FeedEventPost, FeedEventReply, FeedEventTopicPost, FeedEventCreatePoll, }
Functions ¶
func AddUpdateTopicInfo ¶
func AttachUnreadToTopics ¶
func ContainsWatchedPkHash ¶
func GetCountMemoFollows ¶
func GetCountMemoLikes ¶
func GetCountMemoPollOption ¶
func GetCountMemoPollVote ¶
func GetCountMemoSetName ¶
func GetCountMemoSetPic ¶
func GetCountMemoSetProfile ¶
func GetCountMemoTopicFollow ¶
func GetCsrfTokenString ¶
func GetLastNotificationId ¶
func GetMemoCohortStats ¶
func GetMemoCohortStats() ([]view.MemoCohortStat, error)
func GetPostReplyCount ¶
func GetTopicInfo ¶
func GetTopicInfoFromPosts ¶
func GetUniqueMemoAPkHashes ¶
func GetUniqueUserCount ¶
func GetUserFirstPostStats ¶
func GetUserFirstPostStats() ([]view.UserDateStat, error)
func GetUserIdFromPkHash ¶
func GetUserStats ¶
func HasSpendable ¶
func IsAlreadyExistsError ¶
func IsDuplicateEntryError ¶
func IsRecordNotFoundError ¶
func IsValidDefaultTip ¶
func IsValidThemeSetting ¶
func SaveBlocks ¶
func SetLastNotificationId ¶
func SetLastTopicPostId ¶
func UpdateCsrfTokenSession ¶
Types ¶
type Block ¶
type Block struct { Id uint `gorm:"primary_key"` Height uint `gorm:"unique"` Timestamp time.Time Hash []byte `gorm:"unique"` PrevBlock []byte MerkleRoot []byte Nonce uint32 TxnCount uint32 Version int32 Bits uint32 CreatedAt time.Time UpdatedAt time.Time }
func ConvertMessageHeaderToBlock ¶
func ConvertMessageHeaderToBlock(header *wire.BlockHeader) *Block
func GetBlockByHeight ¶
func GetBlocksInHeightRange ¶
func GetGenesis ¶
func GetRecentBlock ¶
func (Block) GetChainhash ¶
func (Block) GetMerkleRoot ¶
func (Block) GetPrevBlockChainhash ¶
func (Block) NextHeight ¶
func (Block) PrevHeight ¶
type CsrfToken ¶
type CsrfToken struct { Id uint `gorm:"primary_key"` CookieId string `gorm:"unique;size:140"` Token string `gorm:"unique;size:140"` CreatedAt time.Time UpdatedAt time.Time }
func GetCsrfToken ¶
type FeedEvent ¶
type FeedEvent struct { Id uint `gorm:"primary_key"` Block *Block `gorm:"foreignkey:BlockHeight"` BlockHeight uint `gorm:"index:block_height"` PkHash []byte `gorm:"index:pk_hash"` TxHash []byte `gorm:"unique"` EventType FeedEventType CreatedAt time.Time UpdatedAt time.Time }
func GetFeedByTxHash ¶
func GetRecentFeedEvents ¶
func GetRecentFeedForPkHash ¶
func GetRecentFeedUserEvents ¶
func GetRecentFeedUserEvents(pkHash []byte, offset uint, eventTypes []FeedEventType) ([]*FeedEvent, error)
func (FeedEvent) GetAddress ¶
func (FeedEvent) GetTransactionHashString ¶
type FeedEventType ¶
type FeedEventType int
const ( FeedEventPost FeedEventType = 1 FeedEventReply FeedEventType = 2 FeedEventLike FeedEventType = 3 FeedEventTopicPost FeedEventType = 4 FeedEventCreatePoll FeedEventType = 5 FeedEventPollVote FeedEventType = 6 FeedEventSetName FeedEventType = 7 FeedEventSetProfile FeedEventType = 8 FeedEventSetProfilePic FeedEventType = 9 FeedEventFollowUser FeedEventType = 10 FeedEventFollowTopic FeedEventType = 11 )
type Key ¶
type Key struct { Id uint `gorm:"primary_key"` Name string UserId uint Value []byte PublicKey []byte `gorm:"unique"` PkHash []byte `gorm:"unique"` MaxCheck uint // maximum block height checked for transactions MinCheck uint // minimum block height checked for transactions CreatedAt time.Time UpdatedAt time.Time }
func GetAllKeys ¶
func GetKeyForUser ¶
func GetKeyFromPublicKey ¶
func GetKeysForUser
deprecated
func (Key) GetAddress ¶
func (Key) GetPrivateKey ¶
func (k Key) GetPrivateKey(password string) (*wallet.PrivateKey, error)
func (Key) GetPublicKey ¶
type MemoFollow ¶
type MemoFollow struct { Id uint `gorm:"primary_key"` TxHash []byte `gorm:"unique;size:50"` ParentHash []byte PkHash []byte `gorm:"index:pk_hash;index:pk_hash_follow"` PkScript []byte Address string FollowPkHash []byte `gorm:"index:follow_pk_hash;index:pk_hash_follow"` BlockId uint Block *Block Unfollow bool CreatedAt time.Time UpdatedAt time.Time }
func GetAllFollows ¶
func GetAllFollows(offset uint) ([]*MemoFollow, error)
func GetFollowersForPkHash ¶
func GetFollowersForPkHash(pkHash []byte, offset int) ([]*MemoFollow, error)
func GetFollowingForPkHash ¶
func GetFollowingForPkHash(followPkHash []byte, offset int) ([]*MemoFollow, error)
func GetMemoFollow ¶
func GetMemoFollow(txHash []byte) (*MemoFollow, error)
func GetMemoFollowsByTxHashes ¶
func GetMemoFollowsByTxHashes(txHashes [][]byte) ([]*MemoFollow, error)
func (MemoFollow) GetAddressString ¶
func (m MemoFollow) GetAddressString() string
func (MemoFollow) GetFollowAddressString ¶
func (m MemoFollow) GetFollowAddressString() string
func (MemoFollow) GetScriptString ¶
func (m MemoFollow) GetScriptString() string
func (MemoFollow) GetTimeString ¶
func (m MemoFollow) GetTimeString() string
func (MemoFollow) GetTransactionHashString ¶
func (m MemoFollow) GetTransactionHashString() string
func (MemoFollow) Save ¶
func (m MemoFollow) Save() error
type MemoLike ¶
type MemoLike struct { Id uint `gorm:"primary_key"` TxHash []byte `gorm:"unique;size:50"` ParentHash []byte PkHash []byte `gorm:"index:pk_hash"` PkScript []byte Address string LikeTxHash []byte `gorm:"index:like_tx_hash"` TipAmount int64 TipPkHash []byte BlockId uint Block *Block CreatedAt time.Time UpdatedAt time.Time }
func GetMemoLike ¶
func GetMemoLikesByTxHashes ¶
func GetMemoLikesForPkHash ¶
func GetMemoLikesForTxnHash ¶
func GetRecentLikes ¶
func GetRecentLikesForTopic ¶
func (MemoLike) GetAddressString ¶
func (MemoLike) GetLikeTransactionHashString ¶
func (MemoLike) GetScriptString ¶
func (MemoLike) GetTimeString ¶
func (MemoLike) GetTransactionHashString ¶
type MemoPollOption ¶
type MemoPollOption struct { Id uint `gorm:"primary_key"` TxHash []byte `gorm:"unique;size:50"` ParentHash []byte PkHash []byte `gorm:"index:pk_hash"` PkScript []byte PollTxHash []byte `gorm:"index:poll_tx_hash"` Option string `gorm:"size:500"` BlockId uint Block *Block CreatedAt time.Time UpdatedAt time.Time }
func GetMemoPollOption ¶
func GetMemoPollOption(txHash []byte) (*MemoPollOption, error)
func GetMemoPollOptionByOption ¶
func GetMemoPollOptionByOption(pollTxHash []byte, option string) (*MemoPollOption, error)
func GetMemoPollOptionsByTxHashes ¶
func GetMemoPollOptionsByTxHashes(txHashes [][]byte) ([]*MemoPollOption, error)
func (MemoPollOption) GetAddress ¶
func (m MemoPollOption) GetAddress() wallet.Address
func (MemoPollOption) GetAddressString ¶
func (m MemoPollOption) GetAddressString() string
func (MemoPollOption) GetPollTransactionHashString ¶
func (m MemoPollOption) GetPollTransactionHashString() string
func (MemoPollOption) GetTransactionHashString ¶
func (m MemoPollOption) GetTransactionHashString() string
func (MemoPollOption) Save ¶
func (m MemoPollOption) Save() error
type MemoPollQuestion ¶
type MemoPollQuestion struct { Id uint `gorm:"primary_key"` TxHash []byte `gorm:"key;size:50"` Options []*MemoPollOption `gorm:"foreignkey:PollTxHash;associationforeignkey:TxHash"` NumOptions uint PollType int CreatedAt time.Time UpdatedAt time.Time }
func GetMemoPollQuestion ¶
func GetMemoPollQuestion(txHash []byte) (*MemoPollQuestion, error)
func GetMemoPollQuestions ¶
func GetMemoPollQuestions(txHashes [][]byte) ([]*MemoPollQuestion, error)
func (MemoPollQuestion) GetTransactionHashString ¶
func (m MemoPollQuestion) GetTransactionHashString() string
func (MemoPollQuestion) Save ¶
func (m MemoPollQuestion) Save() error
type MemoPollVote ¶
type MemoPollVote struct { Id uint `gorm:"primary_key"` TxHash []byte `gorm:"unique;size:50"` ParentHash []byte PkHash []byte `gorm:"index:pk_hash"` PkScript []byte BlockId uint Block *Block OptionTxHash []byte `gorm:"index:option_tx_hash"` TipAmount int64 TipPkHash []byte Message string CreatedAt time.Time UpdatedAt time.Time }
func GetMemoPollVote ¶
func GetMemoPollVote(txHash []byte) (*MemoPollVote, error)
func GetMemoPollVotesByTxHashes ¶
func GetMemoPollVotesByTxHashes(txHashes [][]byte) ([]*MemoPollVote, error)
func GetPollVotes ¶
func GetPollVotes(offset uint) ([]*MemoPollVote, error)
func GetVotesForOptions ¶
func GetVotesForOptions(questionTxHash []byte, single bool) ([]*MemoPollVote, error)
func (MemoPollVote) GetAddress ¶
func (m MemoPollVote) GetAddress() wallet.Address
func (MemoPollVote) GetAddressString ¶
func (m MemoPollVote) GetAddressString() string
func (MemoPollVote) GetTransactionHashString ¶
func (m MemoPollVote) GetTransactionHashString() string
func (MemoPollVote) Save ¶
func (m MemoPollVote) Save() error
type MemoPost ¶
type MemoPost struct { Id uint `gorm:"primary_key"` TxHash []byte `gorm:"unique;size:50"` ParentHash []byte PkHash []byte `gorm:"index:pk_hash"` PkScript []byte `gorm:"size:500"` Address string ParentTxHash []byte `gorm:"index:parent_tx_hash"` Parent *MemoPost RootTxHash []byte `gorm:"index:root_tx_hash"` Replies []*MemoPost `gorm:"foreignkey:ParentTxHash"` Topic string `gorm:"index:tag;size:500"` Message string `gorm:"size:500"` IsPoll bool IsVote bool BlockId uint Block *Block CreatedAt time.Time UpdatedAt time.Time }
func GetMemoPost ¶
func GetMemoPostById ¶
func GetOlderPostsForTopic ¶
func GetPersonalizedTopPosts ¶
func GetPollsPosts ¶
func GetPostsByTxHashes ¶
func GetPostsFeedForPkHash ¶
func GetRecentPostsForTopic ¶
func GetRecentReplyPosts ¶
func GetTopPosts ¶
func (MemoPost) GetAddress ¶
func (MemoPost) GetAddressString ¶
func (MemoPost) GetMessage ¶
func (MemoPost) GetParentTransactionHashString ¶
func (MemoPost) GetRootTransactionHashString ¶
func (MemoPost) GetScriptString ¶
func (MemoPost) GetTimeString ¶
func (MemoPost) GetTransactionHashString ¶
func (MemoPost) GetUrlEncodedTopic ¶
type MemoSetName ¶
type MemoSetName struct { Id uint `gorm:"primary_key"` TxHash []byte `gorm:"unique;size:50"` ParentHash []byte PkHash []byte `gorm:"index:pk_hash"` PkScript []byte `gorm:"size:500"` Address string Name string `gorm:"size:500"` BlockId uint Block *Block CreatedAt time.Time UpdatedAt time.Time }
func GetMemoSetName ¶
func GetMemoSetName(txHash []byte) (*MemoSetName, error)
func GetMemoSetNameById ¶
func GetMemoSetNameById(id uint) (*MemoSetName, error)
func GetNameForPkHash ¶
func GetNameForPkHash(pkHash []byte) (*MemoSetName, error)
func GetNamesForPkHashes ¶
func GetNamesForPkHashes(pkHashes [][]byte) ([]*MemoSetName, error)
func GetSetNames ¶
func GetSetNames(offset uint) ([]*MemoSetName, error)
func GetSetNamesByTxHashes ¶
func GetSetNamesByTxHashes(txHashes [][]byte) ([]*MemoSetName, error)
func (MemoSetName) GetAddressString ¶
func (m MemoSetName) GetAddressString() string
func (MemoSetName) GetScriptString ¶
func (m MemoSetName) GetScriptString() string
func (MemoSetName) GetTimeString ¶
func (m MemoSetName) GetTimeString() string
func (MemoSetName) GetTransactionHashString ¶
func (m MemoSetName) GetTransactionHashString() string
func (MemoSetName) Save ¶
func (m MemoSetName) Save() error
type MemoSetPic ¶
type MemoSetPic struct { Id uint `gorm:"primary_key"` TxHash []byte `gorm:"unique;size:50"` ParentHash []byte PkHash []byte `gorm:"index:pk_hash"` PkScript []byte `gorm:"size:500"` Address string Url string `gorm:"size:500"` BlockId uint Block *Block CreatedAt time.Time UpdatedAt time.Time }
func GetMemoSetPic ¶
func GetMemoSetPic(txHash []byte) (*MemoSetPic, error)
func GetMemoSetPicById ¶
func GetMemoSetPicById(id uint) (*MemoSetPic, error)
func GetPicForPkHash ¶
func GetPicForPkHash(pkHash []byte) (*MemoSetPic, error)
func GetPicsForPkHashes ¶
func GetPicsForPkHashes(pkHashes [][]byte) ([]*MemoSetPic, error)
func GetSetProfilePics ¶
func GetSetProfilePics(offset uint) ([]*MemoSetPic, error)
func GetSetProfilePicsByTxHashes ¶
func GetSetProfilePicsByTxHashes(txHashes [][]byte) ([]*MemoSetPic, error)
func (MemoSetPic) GetAddressString ¶
func (m MemoSetPic) GetAddressString() string
func (MemoSetPic) GetExtension ¶
func (m MemoSetPic) GetExtension() string
func (MemoSetPic) GetScriptString ¶
func (m MemoSetPic) GetScriptString() string
func (MemoSetPic) GetTimeString ¶
func (m MemoSetPic) GetTimeString() string
func (MemoSetPic) GetTransactionHashString ¶
func (m MemoSetPic) GetTransactionHashString() string
func (MemoSetPic) Save ¶
func (m MemoSetPic) Save() error
type MemoSetProfile ¶
type MemoSetProfile struct { Id uint `gorm:"primary_key"` TxHash []byte `gorm:"unique;size:50"` ParentHash []byte PkHash []byte `gorm:"index:pk_hash"` PkScript []byte `gorm:"size:500"` Address string Profile string `gorm:"size:500"` BlockId uint Block *Block CreatedAt time.Time UpdatedAt time.Time }
func GetMemoSetProfile ¶
func GetMemoSetProfile(txHash []byte) (*MemoSetProfile, error)
func GetMemoSetProfileById ¶
func GetMemoSetProfileById(id uint) (*MemoSetProfile, error)
func GetProfileForPkHash ¶
func GetProfileForPkHash(pkHash []byte) (*MemoSetProfile, error)
func GetSetProfiles ¶
func GetSetProfiles(offset uint) ([]*MemoSetProfile, error)
func GetSetProfilesByTxHashes ¶
func GetSetProfilesByTxHashes(txHashes [][]byte) ([]*MemoSetProfile, error)
func GetSetProfilesForPkHash ¶
func GetSetProfilesForPkHash(pkHash []byte) ([]*MemoSetProfile, error)
func (MemoSetProfile) GetAddressString ¶
func (m MemoSetProfile) GetAddressString() string
func (MemoSetProfile) GetScriptString ¶
func (m MemoSetProfile) GetScriptString() string
func (MemoSetProfile) GetTimeString ¶
func (m MemoSetProfile) GetTimeString() string
func (MemoSetProfile) GetTransactionHashString ¶
func (m MemoSetProfile) GetTransactionHashString() string
func (MemoSetProfile) Save ¶
func (m MemoSetProfile) Save() error
type MemoTest ¶
type MemoTest struct { Id uint `gorm:"primary_key"` TxHash []byte `gorm:"unique;size:50"` PkHash []byte PkScript []byte `gorm:"size:500"` Address string BlockId uint Block *Block CreatedAt time.Time UpdatedAt time.Time }
func GetMemoTest ¶
func (MemoTest) GetAddressString ¶
func (MemoTest) GetScriptString ¶
func (MemoTest) GetTransactionHashString ¶
type MemoTopicFollow ¶
type MemoTopicFollow struct { Id uint `gorm:"primary_key"` TxHash []byte `gorm:"unique;size:50"` ParentHash []byte PkHash []byte `gorm:"index:pk_hash"` PkScript []byte Topic string `gorm:"index:topic"` BlockId uint Block *Block Unfollow bool CreatedAt time.Time UpdatedAt time.Time }
func GetFollowersForTopic ¶
func GetFollowersForTopic(topic string) ([]*MemoTopicFollow, error)
func GetMemoTopicFollow ¶
func GetMemoTopicFollow(txHash []byte) (*MemoTopicFollow, error)
func GetMemoTopicFollowsByTxHashes ¶
func GetMemoTopicFollowsByTxHashes(txHashes [][]byte) ([]*MemoTopicFollow, error)
func GetTopicFollows ¶
func GetTopicFollows(offset uint) ([]*MemoTopicFollow, error)
func (MemoTopicFollow) GetScriptString ¶
func (m MemoTopicFollow) GetScriptString() string
func (MemoTopicFollow) GetTimeString ¶
func (m MemoTopicFollow) GetTimeString() string
func (MemoTopicFollow) GetTransactionHashString ¶
func (m MemoTopicFollow) GetTransactionHashString() string
func (MemoTopicFollow) Save ¶
func (m MemoTopicFollow) Save() error
type NodeStatus ¶
type NodeStatus struct { Id uint `gorm:"primary_key"` HeightChecked uint CreatedAt time.Time UpdatedAt time.Time }
func GetNodeStatus ¶
func GetNodeStatus() (*NodeStatus, error)
func (*NodeStatus) Save ¶
func (s *NodeStatus) Save() error
type Notification ¶
type Notification struct { Id uint `gorm:"primary_key"` PkHash []byte `gorm:"not null;unique_index:pk_hash_tx_hash"` TxHash []byte `gorm:"not null;unique_index:pk_hash_tx_hash"` Type uint CreatedAt time.Time UpdatedAt time.Time }
func AddNotification ¶
func AddNotification(pkHash []byte, txHash []byte, notificationType uint) (*Notification, error)
func GetRecentNotificationsForUser ¶
func GetRecentNotificationsForUser(pkHash []byte, offset uint) ([]*Notification, error)
type Peer ¶
type Peer struct { Id uint `gorm:"primary_key"` IP []byte `gorm:"unique_index:ip_port"` Port uint16 `gorm:"unique_index:ip_port"` Services uint64 Address string CreatedAt time.Time UpdatedAt time.Time }
func (*Peer) GetAddress ¶
func (*Peer) GetServices ¶
type Session ¶
type Session struct { Id uint `gorm:"primary_key"` CookieId string `gorm:"unique;size:140"` HasLoggedOut bool UserId uint StartTs uint CreatedAt time.Time UpdatedAt time.Time }
func GetSession ¶
type Transaction ¶
type Transaction struct { Id uint `gorm:"primary_key"` BlockId uint Block *Block Hash []byte `gorm:"unique;"` Version int32 TxIn []*TransactionIn `gorm:"foreignkey:TransactionHash"` TxOut []*TransactionOut `gorm:"foreignkey:TransactionHash"` LockTime uint32 CreatedAt time.Time UpdatedAt time.Time }
func ConvertMsgToTransaction ¶
func ConvertMsgToTransaction(msg *wire.MsgTx) (*Transaction, error)
func GetTransactionByHash ¶
func GetTransactionByHash(hash []byte) (*Transaction, error)
func GetTransactionByHashWithOutputs ¶
func GetTransactionByHashWithOutputs(hash []byte) (*Transaction, error)
func (*Transaction) Delete ¶
func (t *Transaction) Delete() error
func (*Transaction) GetBlockHeight ¶
func (t *Transaction) GetBlockHeight() string
func (*Transaction) GetBlockTime ¶
func (t *Transaction) GetBlockTime() string
func (*Transaction) GetChainHash ¶
func (t *Transaction) GetChainHash() *chainhash.Hash
func (*Transaction) GetFee ¶
func (t *Transaction) GetFee() int64
func (*Transaction) GetFeeBCH ¶
func (t *Transaction) GetFeeBCH() float64
func (*Transaction) GetKeyId ¶
func (t *Transaction) GetKeyId() uint
func (*Transaction) GetValues ¶
func (t *Transaction) GetValues() map[string]*Value
func (*Transaction) HasFee ¶
func (t *Transaction) HasFee() bool
func (*Transaction) HasUserKey ¶
func (t *Transaction) HasUserKey(userId uint) bool
func (*Transaction) Save ¶
func (t *Transaction) Save() error
type TransactionIn ¶
type TransactionIn struct { Id uint `gorm:"primary_key"` Index uint HashString string `gorm:"index:hash_string"` TransactionHash []byte Transaction *Transaction `gorm:"foreignkey:TransactionHash"` KeyPkHash []byte `gorm:"index:pk_hash"` Key *Key `gorm:"foreignkey:KeyPkHash"` PreviousOutPointHash []byte `gorm:"unique_index:previous_out"` PreviousOutPointIndex uint32 `gorm:"unique_index:previous_out"` SignatureScript []byte UnlockString string Sequence uint32 TxnOutHashString string `gorm:"size:4096"` TxnOut *TransactionOut `gorm:"foreignkey:TxnOutHashString"` CreatedAt time.Time UpdatedAt time.Time }
func GetTransactionInput ¶
func GetTransactionInput(txHash []byte, index uint32) (*TransactionIn, error)
func GetTransactionInputByHashString ¶
func GetTransactionInputByHashString(hashString string) (*TransactionIn, error)
func (TransactionIn) Delete ¶
func (t TransactionIn) Delete() error
func (TransactionIn) GetAddress ¶
func (t TransactionIn) GetAddress() wallet.Address
func (TransactionIn) GetAddressString ¶
func (t TransactionIn) GetAddressString() string
func (TransactionIn) GetHashString ¶
func (t TransactionIn) GetHashString() string
func (TransactionIn) GetOutPoint ¶
func (t TransactionIn) GetOutPoint() *wire.OutPoint
func (*TransactionIn) GetPkHash ¶
func (t *TransactionIn) GetPkHash() []byte
func (TransactionIn) GetPrevOutPointHash ¶
func (t TransactionIn) GetPrevOutPointHash() []byte
func (TransactionIn) GetPrevOutPointString ¶
func (t TransactionIn) GetPrevOutPointString() string
func (TransactionIn) GetPublicKey ¶
func (t TransactionIn) GetPublicKey() []byte
func (TransactionIn) HasOut ¶
func (t TransactionIn) HasOut() bool
func (TransactionIn) Save ¶
func (t TransactionIn) Save() error
type TransactionOut ¶
type TransactionOut struct { Id uint `gorm:"primary_key"` Index uint32 `gorm:"unique_index:transaction_out_index;"` HashString string TransactionHash []byte `gorm:"unique_index:transaction_out_index;"` Transaction *Transaction `gorm:"foreignkey:TransactionHash"` KeyPkHash []byte `gorm:"index:pk_hash"` Key *Key `gorm:"foreignkey:KeyPkHash"` Value int64 PkScript []byte LockString string RequiredSigs uint ScriptClass uint TxnInHashString string `gorm:"index:txn_in_hash_string"` TxnIn *TransactionIn `gorm:"foreignkey:TxnInHashString"` CreatedAt time.Time UpdatedAt time.Time }
func GetSpendableTransactionOutputsForPkHash ¶
func GetSpendableTransactionOutputsForPkHash(pkHash []byte) ([]*TransactionOut, error)
func GetTransactionOutput ¶
func GetTransactionOutput(txHash []byte, index uint32) (*TransactionOut, error)
func (TransactionOut) GetAddressString ¶
func (t TransactionOut) GetAddressString() string
func (TransactionOut) GetHashString ¶
func (t TransactionOut) GetHashString() string
func (TransactionOut) GetMessage ¶
func (t TransactionOut) GetMessage() string
func (TransactionOut) GetPkHash ¶
func (t TransactionOut) GetPkHash() []byte
func (TransactionOut) GetScriptClass ¶
func (t TransactionOut) GetScriptClass() string
func (TransactionOut) HasIn ¶
func (t TransactionOut) HasIn() bool
func (TransactionOut) IsMemo ¶
func (t TransactionOut) IsMemo() bool
func (TransactionOut) IsSpendable ¶
func (t TransactionOut) IsSpendable() bool
func (TransactionOut) Save ¶
func (t TransactionOut) Save() error
func (TransactionOut) ValueInBCH ¶
func (t TransactionOut) ValueInBCH() float64
type TxHashCount ¶
func GetPostReplyCounts ¶
func GetPostReplyCounts(txHashes [][]byte) ([]TxHashCount, error)
type TxOutSortByValue ¶
type TxOutSortByValue []*TransactionOut
func (TxOutSortByValue) Len ¶
func (txOuts TxOutSortByValue) Len() int
func (TxOutSortByValue) Less ¶
func (txOuts TxOutSortByValue) Less(i, j int) bool
func (TxOutSortByValue) Swap ¶
func (txOuts TxOutSortByValue) Swap(i, j int)
type User ¶
type User struct { Id uint `gorm:"primary_key"` Username string `gorm:"unique;size:50"` PasswordHash string CreatedAt time.Time UpdatedAt time.Time }
func GetUserById ¶
func GetUserByUsername ¶
type UserAction ¶
type UserSettings ¶
type UserSettings struct { Id uint `gorm:"primary_key"` UserId uint `gorm:"unique"` DefaultTip uint Integrations string `gorm:"size:25"` Theme string `gorm:"size:25"` CreatedAt time.Time UpdatedAt time.Time }
func GetDefaultUserSettings ¶
func GetDefaultUserSettings() UserSettings
func GetSettingsForUser ¶
func GetSettingsForUser(userId uint) (*UserSettings, error)
func SaveSettingsForUser ¶
func (UserSettings) GetDefaultTipString ¶
func (u UserSettings) GetDefaultTipString() string
func (*UserSettings) Save ¶
func (u *UserSettings) Save() error
type UserStat ¶
type UserStat struct { Id uint `gorm:"primary_key"` PkHash []byte `gorm:"not null;unique"` NumPosts int NumFollowers int FirstPost time.Time LastPost time.Time CreatedAt time.Time UpdatedAt time.Time }
func GetUserStat ¶
type UserStatOrderType ¶
type UserStatOrderType int
const ( UserStatOrderCreated UserStatOrderType = iota UserStatOrderNewest UserStatOrderPosts UserStatOrderFollowers )
Source Files
¶
- block.go
- csrf_tokens.go
- feed_event.go
- key.go
- main.go
- memo.go
- memo_follow.go
- memo_like.go
- memo_poll_option.go
- memo_poll_question.go
- memo_poll_vote.go
- memo_post.go
- memo_set_name.go
- memo_set_pic.go
- memo_set_profile.go
- memo_topic_follow.go
- node_status.go
- notification.go
- peer.go
- session.go
- topic_info.go
- transaction.go
- transaction_in.go
- transaction_out.go
- user.go
- user_action.go
- user_settings.go
- user_stat.go
- user_topic_view.go
Click to show internal directories.
Click to hide internal directories.