profile

package
v0.0.0-...-2f442fc Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2018 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TimeRange1Hour   = "1h"
	TimeRange24Hours = "24h"
	TimeRange7Days   = "7d"
	TimeRangeAll     = "all"
)

Variables

Functions

func AttachLikesToPosts

func AttachLikesToPosts(posts []*Post) error

func AttachNamesToPosts

func AttachNamesToPosts(posts []*Post) error

func AttachParentToPosts

func AttachParentToPosts(posts []*Post) error

func AttachPollsToPosts

func AttachPollsToPosts(posts []*Post) error

func AttachProfilePicsToPosts

func AttachProfilePicsToPosts(posts []*Post) error

func AttachRepliesToPost

func AttachRepliesToPost(post *Post, offset uint) error

func AttachReplyCountToPosts

func AttachReplyCountToPosts(posts []*Post) error

func AttachReputationToFollowers

func AttachReputationToFollowers(followers []*Follower) error

func AttachReputationToPosts

func AttachReputationToPosts(posts []*Post) error

func AttachReputationToProfiles

func AttachReputationToProfiles(profiles []*Profile) error

func CanFollow

func CanFollow(pkHash []byte, selfPkHash []byte) (bool, error)

func SetShowMediaForPosts

func SetShowMediaForPosts(posts []*Post, userId uint) error

func StringIsTimeRange

func StringIsTimeRange(str string) bool

Types

type Follower

type Follower struct {
	Name       string
	PkHash     []byte
	SelfPkHash []byte
	Reputation *rep.Reputation
}

func GetFollowers

func GetFollowers(selfPkHash []byte, pkHash []byte, offset int) ([]*Follower, error)

func GetFollowing

func GetFollowing(selfPkHash []byte, pkHash []byte, offset int) ([]*Follower, error)

func (*Follower) GetAddressString

func (f *Follower) GetAddressString() string

type Like

type Like struct {
	Id         uint
	Amount     int64
	Name       string
	PkHash     []byte
	Timestamp  time.Time
	TxnHash    []byte
	PostTxHash []byte
}

func GetLikesForPkHash

func GetLikesForPkHash(pkHash []byte) ([]*Like, error)

func (*Like) GetAddressString

func (l *Like) GetAddressString() string

func (*Like) GetPostTransactionHashString

func (l *Like) GetPostTransactionHashString() string

func (*Like) GetTimeString

func (l *Like) GetTimeString(timezone string) string

func (*Like) GetTransactionHashString

func (l *Like) GetTransactionHashString() string

type Option

type Option struct {
	Name        string
	Votes       int
	UniqueVotes int
	Satoshis    int64
}

type Poll

type Poll struct {
	Question   *db.MemoPollQuestion
	Votes      []*db.MemoPollVote
	SelfPkHash []byte
}

func (*Poll) CanVote

func (p *Poll) CanVote() bool

func (*Poll) GetOptions

func (p *Poll) GetOptions() []Option

func (*Poll) IsMulti

func (p *Poll) IsMulti() bool

type Post

type Post struct {
	Name         string
	Memo         *db.MemoPost
	Parent       *Post
	Likes        []*Like
	HasLiked     bool
	SelfPkHash   []byte
	ReplyCount   uint
	Replies      []*Post
	Reputation   *rep.Reputation
	ShowMedia    bool
	Poll         *Poll
	VoteQuestion *db.MemoPost
	VoteOption   *db.MemoPollOption
	ProfilePic   *db.MemoSetPic
}

func CreatePostsFromDbPosts

func CreatePostsFromDbPosts(selfPkHash []byte, dbPosts []*db.MemoPost) ([]*Post, error)

func GetOlderPostsForTopic

func GetOlderPostsForTopic(tag string, selfPkHash []byte, firstPostId uint) ([]*Post, error)

func GetPollsPosts

func GetPollsPosts(selfPkHash []byte, offset uint) ([]*Post, error)

func GetPostByTxHash

func GetPostByTxHash(txHash []byte, selfPkHash []byte) (*Post, error)

func GetPostByTxHashWithReplies

func GetPostByTxHashWithReplies(txHash []byte, selfPkHash []byte, offset uint) (*Post, error)

func GetPostsByTxHashes

func GetPostsByTxHashes(txHashes [][]byte, selfPkHash []byte) ([]*Post, error)

func GetPostsFeed

func GetPostsFeed(selfPkHash []byte, offset uint) ([]*Post, error)

func GetPostsForHash

func GetPostsForHash(pkHash []byte, selfPkHash []byte, offset uint) ([]*Post, error)

func GetPostsForTopic

func GetPostsForTopic(tag string, selfPkHash []byte, offset uint) ([]*Post, error)

func GetRankedPosts

func GetRankedPosts(selfPkHash []byte, offset uint, searchString string) ([]*Post, error)

func GetRecentPosts

func GetRecentPosts(selfPkHash []byte, offset uint, searchString string) ([]*Post, error)

func GetTopPosts

func GetTopPosts(selfPkHash []byte, offset uint, timeStart time.Time, timeEnd time.Time, personalized bool) ([]*Post, error)

func GetTopPostsNamedRange

func GetTopPostsNamedRange(selfPkHash []byte, offset uint, timeRange string, personalized bool) ([]*Post, error)

func (Post) GetLastLikeId

func (p Post) GetLastLikeId() uint

func (Post) GetMessage

func (p Post) GetMessage() string

func (Post) GetTimeAgo

func (p Post) GetTimeAgo() string

func (Post) GetTimeString

func (p Post) GetTimeString(timezone string) string

func (Post) GetTotalTip

func (p Post) GetTotalTip() int64

func (Post) IsLoggedIn

func (p Post) IsLoggedIn() bool

func (Post) IsPoll

func (p Post) IsPoll() bool

func (Post) IsSelf

func (p Post) IsSelf() bool

type Profile

type Profile struct {
	Name       string
	PkHash     []byte
	NameTx     []byte
	Profile    string
	ProfileTx  []byte
	Self       bool
	SelfPkHash []byte
	Balance    int64
	BalanceBCH float64

	FollowerCount        int
	FollowingCount       int
	TopicsFollowingCount int
	NumPosts             int
	FirstPost            time.Time
	LastPost             time.Time
	Followers            []*Follower
	Following            []*Follower
	Reputation           *rep.Reputation
	CanFollow            bool
	CanUnfollow          bool
	Qr                   string
	Pic                  *db.MemoSetPic
	// contains filtered or unexported fields
}

func GetBasicProfile

func GetBasicProfile(pkHash []byte, selfPkHash []byte) (*Profile, error)

func GetProfile

func GetProfile(pkHash []byte, selfPkHash []byte) (*Profile, error)

func GetProfileAndSetBalances

func GetProfileAndSetBalances(pkHash []byte, selfPkHash []byte) (*Profile, error)

func GetProfiles

func GetProfiles(selfPkHash []byte, searchString string, offset int, orderType db.UserStatOrderType) ([]*Profile, error)

func (Profile) GetAddressString

func (p Profile) GetAddressString() string

func (Profile) GetCashAddressOnlyString

func (p Profile) GetCashAddressOnlyString() string

func (Profile) GetCashAddressString

func (p Profile) GetCashAddressString() string

func (Profile) GetFirstPost

func (p Profile) GetFirstPost(timezone string) string

func (Profile) GetJoined

func (p Profile) GetJoined() string

func (Profile) GetLastPost

func (p Profile) GetLastPost(timezone string) string

func (Profile) GetNameTx

func (p Profile) GetNameTx() string

func (Profile) GetText

func (p Profile) GetText() string

func (Profile) HasBalance

func (p Profile) HasBalance() bool

func (Profile) IsSelf

func (p Profile) IsSelf() bool

func (Profile) NameSet

func (p Profile) NameSet() bool

func (*Profile) SetBalances

func (p *Profile) SetBalances() error

func (*Profile) SetCanFollow

func (p *Profile) SetCanFollow() error

func (*Profile) SetFollowerCount

func (p *Profile) SetFollowerCount() error

func (*Profile) SetFollowingCount

func (p *Profile) SetFollowingCount() error

func (*Profile) SetQr

func (p *Profile) SetQr() error

func (*Profile) SetReputation

func (p *Profile) SetReputation() error

func (*Profile) SetTopicsFollowingCount

func (p *Profile) SetTopicsFollowingCount() error

func (*Profile) SetUserStats

func (p *Profile) SetUserStats() error

type Vote

type Vote struct {
	Name    string
	Option  string
	Message string
	Tip     int64
	Vote    *db.MemoPollVote
}

func GetVotesForTxHash

func GetVotesForTxHash(txHash []byte) ([]*Vote, error)

func (Vote) GetProfileHashString

func (v Vote) GetProfileHashString() string

func (Vote) GetTimeAgo

func (v Vote) GetTimeAgo() string

func (Vote) GetTxHashString

func (v Vote) GetTxHashString() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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