memo

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const SeenPostShardSeconds = 60 * 60

SeenPostShardSeconds shards seen posts into 1 hour groups

Variables

This section is empty.

Functions

func GetRoomHash

func GetRoomHash(room string) []byte

func GetSeenPostShard32

func GetSeenPostShard32(seen time.Time) uint32

func GetSeenPostShardSource

func GetSeenPostShardSource(seen time.Time) uint

func GetTopics

func GetTopics() []db.Object

func IsSeenPostSameShardWindow

func IsSeenPostSameShardWindow(a, b time.Time) bool

func ListenAddrFolloweds

func ListenAddrFolloweds(ctx context.Context, followAddrs [][25]byte) (chan *AddrFollowed, error)

func ListenAddrFollows

func ListenAddrFollows(ctx context.Context, addrs [][25]byte) (chan *AddrFollow, error)

func ListenAddrNames

func ListenAddrNames(ctx context.Context, addrs [][25]byte) (chan *AddrName, error)

func ListenAddrProfilePics

func ListenAddrProfilePics(ctx context.Context, addrs [][25]byte) (chan *AddrProfilePic, error)

func ListenAddrProfiles

func ListenAddrProfiles(ctx context.Context, addrs [][25]byte) (chan *AddrProfile, error)

func ListenAddrRoomFollows

func ListenAddrRoomFollows(ctx context.Context, addrs [][25]byte) (chan *AddrRoomFollow, error)

func ListenPostChildren

func ListenPostChildren(ctx context.Context, postTxHashes [][32]byte) (chan *PostChild, error)

func ListenPostLikes

func ListenPostLikes(ctx context.Context, postTxHashes [][32]byte) (chan *PostLike, error)

func ListenPosts

func ListenPosts(ctx context.Context) (chan *Post, error)

func ListenRoomPosts

func ListenRoomPosts(ctx context.Context, rooms []string) (chan *RoomPost, error)

Types

type AddrFollow

type AddrFollow struct {
	Addr       [25]byte
	Seen       time.Time
	TxHash     [32]byte
	Unfollow   bool
	FollowAddr [25]byte
}

func GetAddrFollows

func GetAddrFollows(ctx context.Context, addrs [][25]byte) ([]*AddrFollow, error)

func GetAddrFollowsSingle

func GetAddrFollowsSingle(ctx context.Context, addr [25]byte, start time.Time) ([]*AddrFollow, error)

func (*AddrFollow) Deserialize

func (f *AddrFollow) Deserialize(data []byte)

func (*AddrFollow) GetShardSource

func (f *AddrFollow) GetShardSource() uint

func (*AddrFollow) GetTopic

func (f *AddrFollow) GetTopic() string

func (*AddrFollow) GetUid

func (f *AddrFollow) GetUid() []byte

func (*AddrFollow) Serialize

func (f *AddrFollow) Serialize() []byte

func (*AddrFollow) SetUid

func (f *AddrFollow) SetUid(uid []byte)

type AddrFollowed

type AddrFollowed struct {
	FollowAddr [25]byte
	Seen       time.Time
	TxHash     [32]byte
	Addr       [25]byte
	Unfollow   bool
}

func GetAddrFolloweds

func GetAddrFolloweds(ctx context.Context, followAddresses [][25]byte) ([]*AddrFollowed, error)

func GetAddrFollowedsSingle

func GetAddrFollowedsSingle(ctx context.Context, followAddr [25]byte, start time.Time) ([]*AddrFollowed, error)

func (*AddrFollowed) Deserialize

func (f *AddrFollowed) Deserialize(data []byte)

func (*AddrFollowed) GetShardSource

func (f *AddrFollowed) GetShardSource() uint

func (*AddrFollowed) GetTopic

func (f *AddrFollowed) GetTopic() string

func (*AddrFollowed) GetUid

func (f *AddrFollowed) GetUid() []byte

func (*AddrFollowed) Serialize

func (f *AddrFollowed) Serialize() []byte

func (*AddrFollowed) SetUid

func (f *AddrFollowed) SetUid(uid []byte)

type AddrLike

type AddrLike struct {
	Addr       [25]byte
	Seen       time.Time
	LikeTxHash [32]byte
	PostTxHash [32]byte
}

func (*AddrLike) Deserialize

func (l *AddrLike) Deserialize(data []byte)

func (*AddrLike) GetShardSource

func (l *AddrLike) GetShardSource() uint

func (*AddrLike) GetTopic

func (l *AddrLike) GetTopic() string

func (*AddrLike) GetUid

func (l *AddrLike) GetUid() []byte

func (*AddrLike) Serialize

func (l *AddrLike) Serialize() []byte

func (*AddrLike) SetUid

func (l *AddrLike) SetUid(uid []byte)

type AddrName

type AddrName struct {
	Addr   [25]byte
	Seen   time.Time
	TxHash [32]byte
	Name   string
}

func GetAddrName

func GetAddrName(ctx context.Context, addr [25]byte) (*AddrName, error)

func (*AddrName) Deserialize

func (n *AddrName) Deserialize(data []byte)

func (*AddrName) GetShardSource

func (n *AddrName) GetShardSource() uint

func (*AddrName) GetTopic

func (n *AddrName) GetTopic() string

func (*AddrName) GetUid

func (n *AddrName) GetUid() []byte

func (*AddrName) Serialize

func (n *AddrName) Serialize() []byte

func (*AddrName) SetUid

func (n *AddrName) SetUid(uid []byte)

type AddrPost

type AddrPost struct {
	Addr   [25]byte
	Seen   time.Time
	TxHash [32]byte
}

func GetAddrPosts

func GetAddrPosts(ctx context.Context, addrs [][25]byte, newest bool) ([]*AddrPost, error)

func GetSingleAddrPosts

func GetSingleAddrPosts(ctx context.Context, addr [25]byte, newest bool, start time.Time) ([]*AddrPost, error)

func (*AddrPost) Deserialize

func (p *AddrPost) Deserialize([]byte)

func (*AddrPost) GetShardSource

func (p *AddrPost) GetShardSource() uint

func (*AddrPost) GetTopic

func (p *AddrPost) GetTopic() string

func (*AddrPost) GetUid

func (p *AddrPost) GetUid() []byte

func (*AddrPost) Serialize

func (p *AddrPost) Serialize() []byte

func (*AddrPost) SetUid

func (p *AddrPost) SetUid(uid []byte)

type AddrProfile

type AddrProfile struct {
	Addr    [25]byte
	Seen    time.Time
	TxHash  [32]byte
	Profile string
}

func GetAddrProfile

func GetAddrProfile(ctx context.Context, addr [25]byte) (*AddrProfile, error)

func (*AddrProfile) Deserialize

func (p *AddrProfile) Deserialize(data []byte)

func (*AddrProfile) GetShardSource

func (p *AddrProfile) GetShardSource() uint

func (*AddrProfile) GetTopic

func (p *AddrProfile) GetTopic() string

func (*AddrProfile) GetUid

func (p *AddrProfile) GetUid() []byte

func (*AddrProfile) Serialize

func (p *AddrProfile) Serialize() []byte

func (*AddrProfile) SetUid

func (p *AddrProfile) SetUid(uid []byte)

type AddrProfilePic

type AddrProfilePic struct {
	Addr   [25]byte
	Seen   time.Time
	TxHash [32]byte
	Pic    string
}

func GetAddrProfilePic

func GetAddrProfilePic(ctx context.Context, addr [25]byte) (*AddrProfilePic, error)

func (*AddrProfilePic) Deserialize

func (p *AddrProfilePic) Deserialize(data []byte)

func (*AddrProfilePic) GetShardSource

func (p *AddrProfilePic) GetShardSource() uint

func (*AddrProfilePic) GetTopic

func (p *AddrProfilePic) GetTopic() string

func (*AddrProfilePic) GetUid

func (p *AddrProfilePic) GetUid() []byte

func (*AddrProfilePic) Serialize

func (p *AddrProfilePic) Serialize() []byte

func (*AddrProfilePic) SetUid

func (p *AddrProfilePic) SetUid(uid []byte)

type AddrRoomFollow

type AddrRoomFollow struct {
	Addr     [25]byte
	Seen     time.Time
	TxHash   [32]byte
	Unfollow bool
	Room     string
}

func GetAddrRoomFollows

func GetAddrRoomFollows(ctx context.Context, addrs [][25]byte) ([]*AddrRoomFollow, error)

func (*AddrRoomFollow) Deserialize

func (f *AddrRoomFollow) Deserialize(data []byte)

func (*AddrRoomFollow) GetShardSource

func (f *AddrRoomFollow) GetShardSource() uint

func (*AddrRoomFollow) GetTopic

func (f *AddrRoomFollow) GetTopic() string

func (*AddrRoomFollow) GetUid

func (f *AddrRoomFollow) GetUid() []byte

func (*AddrRoomFollow) Serialize

func (f *AddrRoomFollow) Serialize() []byte

func (*AddrRoomFollow) SetUid

func (f *AddrRoomFollow) SetUid(uid []byte)

type LikeTip

type LikeTip struct {
	LikeTxHash [32]byte
	Tip        int64
}

func GetLikeTips

func GetLikeTips(likeTxHashes [][32]byte) ([]*LikeTip, error)

func (*LikeTip) Deserialize

func (t *LikeTip) Deserialize(data []byte)

func (*LikeTip) GetShardSource

func (t *LikeTip) GetShardSource() uint

func (*LikeTip) GetTopic

func (t *LikeTip) GetTopic() string

func (*LikeTip) GetUid

func (t *LikeTip) GetUid() []byte

func (*LikeTip) Serialize

func (t *LikeTip) Serialize() []byte

func (*LikeTip) SetUid

func (t *LikeTip) SetUid(uid []byte)

type Post

type Post struct {
	TxHash [32]byte
	Addr   [25]byte
	Post   string
}

func GetPost

func GetPost(ctx context.Context, txHash [32]byte) (*Post, error)

func GetPosts

func GetPosts(ctx context.Context, txHashes [][32]byte) ([]*Post, error)

func (*Post) Deserialize

func (p *Post) Deserialize(data []byte)

func (*Post) GetShardSource

func (p *Post) GetShardSource() uint

func (*Post) GetTopic

func (p *Post) GetTopic() string

func (*Post) GetUid

func (p *Post) GetUid() []byte

func (*Post) Serialize

func (p *Post) Serialize() []byte

func (*Post) SetUid

func (p *Post) SetUid(uid []byte)

type PostChild

type PostChild struct {
	PostTxHash  [32]byte
	ChildTxHash [32]byte
}

func GetPostChildren

func GetPostChildren(ctx context.Context, postTxHash [32]byte) ([]*PostChild, error)

func (*PostChild) Deserialize

func (c *PostChild) Deserialize([]byte)

func (*PostChild) GetShardSource

func (c *PostChild) GetShardSource() uint

func (*PostChild) GetTopic

func (c *PostChild) GetTopic() string

func (*PostChild) GetUid

func (c *PostChild) GetUid() []byte

func (*PostChild) Serialize

func (c *PostChild) Serialize() []byte

func (*PostChild) SetUid

func (c *PostChild) SetUid(uid []byte)

type PostLike

type PostLike struct {
	PostTxHash [32]byte
	Seen       time.Time
	LikeTxHash [32]byte
	Addr       [25]byte
}

func GetPostLikes

func GetPostLikes(postTxHashes [][32]byte) ([]*PostLike, error)

func (*PostLike) Deserialize

func (l *PostLike) Deserialize(data []byte)

func (*PostLike) GetShardSource

func (l *PostLike) GetShardSource() uint

func (*PostLike) GetTopic

func (l *PostLike) GetTopic() string

func (*PostLike) GetUid

func (l *PostLike) GetUid() []byte

func (*PostLike) Serialize

func (l *PostLike) Serialize() []byte

func (*PostLike) SetUid

func (l *PostLike) SetUid(uid []byte)

type PostParent

type PostParent struct {
	PostTxHash   [32]byte
	ParentTxHash [32]byte
}

func GetPostParent

func GetPostParent(ctx context.Context, postTxHash [32]byte) (*PostParent, error)

func (*PostParent) Deserialize

func (p *PostParent) Deserialize(data []byte)

func (*PostParent) GetShardSource

func (p *PostParent) GetShardSource() uint

func (*PostParent) GetTopic

func (p *PostParent) GetTopic() string

func (*PostParent) GetUid

func (p *PostParent) GetUid() []byte

func (*PostParent) Serialize

func (p *PostParent) Serialize() []byte

func (*PostParent) SetUid

func (p *PostParent) SetUid(uid []byte)

type PostRoom

type PostRoom struct {
	TxHash [32]byte
	Room   string
}

func GetPostRoom

func GetPostRoom(ctx context.Context, txHash []byte) (*PostRoom, error)

func (*PostRoom) Deserialize

func (r *PostRoom) Deserialize(data []byte)

func (*PostRoom) GetShardSource

func (r *PostRoom) GetShardSource() uint

func (*PostRoom) GetTopic

func (r *PostRoom) GetTopic() string

func (*PostRoom) GetUid

func (r *PostRoom) GetUid() []byte

func (*PostRoom) Serialize

func (r *PostRoom) Serialize() []byte

func (*PostRoom) SetUid

func (r *PostRoom) SetUid(uid []byte)

type RoomFollow

type RoomFollow struct {
	RoomHash []byte
	Seen     time.Time
	TxHash   [32]byte
	Unfollow bool
	Addr     [25]byte
}

func GetRoomFollows

func GetRoomFollows(ctx context.Context, room string) ([]*RoomFollow, error)

func (*RoomFollow) Deserialize

func (f *RoomFollow) Deserialize(data []byte)

func (*RoomFollow) GetShardSource

func (f *RoomFollow) GetShardSource() uint

func (*RoomFollow) GetTopic

func (f *RoomFollow) GetTopic() string

func (*RoomFollow) GetUid

func (f *RoomFollow) GetUid() []byte

func (*RoomFollow) Serialize

func (f *RoomFollow) Serialize() []byte

func (*RoomFollow) SetUid

func (f *RoomFollow) SetUid(uid []byte)

type RoomPost

type RoomPost struct {
	RoomHash []byte
	Seen     time.Time
	TxHash   [32]byte
}

func GetRoomPosts

func GetRoomPosts(ctx context.Context, room string) ([]*RoomPost, error)

func (*RoomPost) Deserialize

func (p *RoomPost) Deserialize([]byte)

func (*RoomPost) GetShardSource

func (p *RoomPost) GetShardSource() uint

func (*RoomPost) GetTopic

func (p *RoomPost) GetTopic() string

func (*RoomPost) GetUid

func (p *RoomPost) GetUid() []byte

func (*RoomPost) Serialize

func (p *RoomPost) Serialize() []byte

func (*RoomPost) SetUid

func (p *RoomPost) SetUid(uid []byte)

type SeenPost

type SeenPost struct {
	Seen       time.Time
	PostTxHash [32]byte
}

func GetSeenPosts

func GetSeenPosts(ctx context.Context, start time.Time, startTxHash [32]byte, limit uint32) ([]*SeenPost, error)

func (*SeenPost) Deserialize

func (i *SeenPost) Deserialize([]byte)

func (*SeenPost) GetShardSource

func (i *SeenPost) GetShardSource() uint

func (*SeenPost) GetTopic

func (i *SeenPost) GetTopic() string

func (*SeenPost) GetUid

func (i *SeenPost) GetUid() []byte

func (*SeenPost) Serialize

func (i *SeenPost) Serialize() []byte

func (*SeenPost) SetUid

func (i *SeenPost) SetUid(uid []byte)

Jump to

Keyboard shortcuts

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