Documentation ¶
Index ¶
- type BasicPost
- type Feed
- func (f *Feed) AddAddressToServers(address string, r Response) (err error)
- func (f *Feed) AddFriendsKey() (err error)
- func (f *Feed) AmFollowing(publickey string) bool
- func (f *Feed) Cleanup()
- func (f *Feed) Debug(b bool)
- func (f *Feed) DetermineComments(postID string) []BasicPost
- func (f *Feed) DetermineHashtags() (err error)
- func (f *Feed) DownloadEnvelope(address, id string) (err error)
- func (f *Feed) GetConnected() (us []User)
- func (self Feed) GetDatabase() database.DatabaseAPI
- func (f *Feed) GetEnvelope(id string) (e letter.Envelope, err error)
- func (f *Feed) GetHashTags() (tags []string)
- func (f *Feed) GetIDs(pubkey, signature string) (ids []string, err error)
- func (f *Feed) GetUser(public ...string) (u User)
- func (f *Feed) GetUserFriends() (u UserFriends)
- func (f *Feed) MakePost(e letter.Envelope) (post BasicPost)
- func (f *Feed) MakePostWithComments(e letter.Envelope) (post Post)
- func (f *Feed) MakeSearchIndex() (err error)
- func (f *Feed) OnlyIncludePostsFromFollowing(posts []Post) (filteredPosts []Post)
- func (f *Feed) ProcessEnvelope(e letter.Envelope) (err error)
- func (f *Feed) ProcessLetter(l letter.Letter) (ue letter.Envelope, err error)
- func (f *Feed) PurgeOverflowingStorage() (err error)
- func (f *Feed) Save() (err error)
- func (f *Feed) SearchIndexedPosts(search string) (posts []Post, err error)
- func (f *Feed) SetRegionKey(public, private string) (err error)
- func (f *Feed) ShowFeed(p ShowFeedParameters) (posts []Post, err error)
- func (f *Feed) SignalUpdate()
- func (f *Feed) Sync(address string) (err error)
- func (f *Feed) SyncServers()
- func (f *Feed) TestStuff()
- func (f *Feed) UnsealLetters() (err error)
- func (f *Feed) UpdateBlockedUsers() (err error)
- func (f *Feed) UpdateEverything()
- func (f *Feed) UpdateEverythingAndSync()
- func (f *Feed) UpdateFriends() (err error)
- func (f *Feed) UpdateOnUpload()
- func (f *Feed) UploadEnvelope(address, id string) (err error)
- type Post
- type Response
- type Settings
- type ShowFeedParameters
- type User
- type UserFriends
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicPost ¶
type BasicPost struct { Depth int `json:"depth"` ID string `json:"id"` FirstID string `json:"first_id"` Recipients string `json:"recipients"` ReplyTo string `json:"reply_to"` Content template.HTML `json:"content"` Date time.Time `json:"date"` TimeAgo string `json:"time_ago"` User User `json:"user"` Likes int64 `json:"likes"` Comments []BasicPost `json:"comments"` }
type Feed ¶
type Feed struct { RegionKey keypair.KeyPair `json:"region_key"` Settings Settings `json:"settings"` PersonalKey keypair.KeyPair `json:"personal_key"` // contains filtered or unexported fields }
Feed stores your basic data
func New ¶
func New(alias, locationToSaveData, regionKeyPublic, regionKeyPrivate string, debug bool) (f *Feed, err error)
New generates a new feed based on the location to find the identity file, the database, and the settings
func (*Feed) AddAddressToServers ¶
func (*Feed) AddFriendsKey ¶
AddFriendsKey will generate a new friends key and post it to the feed
func (*Feed) AmFollowing ¶
AmFollowing checks whether the current user is following the public key
func (*Feed) DetermineComments ¶
func (*Feed) DetermineHashtags ¶
DetermineHashtags will go through and find all the hashtags
func (*Feed) DownloadEnvelope ¶
DownloadEnvelope will download the specified envelope
func (*Feed) GetConnected ¶
GetConnected returns the users that are currently connected to
func (Feed) GetDatabase ¶
func (self Feed) GetDatabase() database.DatabaseAPI
This is needed for http rest api
func (*Feed) GetEnvelope ¶
GetEnvelope will return an envelope with the given ID
func (*Feed) GetHashTags ¶
func (*Feed) GetUserFriends ¶
func (f *Feed) GetUserFriends() (u UserFriends)
GetUserFriends returns detailed friend information
func (*Feed) MakePostWithComments ¶
func (*Feed) MakeSearchIndex ¶
MakeSearchIndex will make a search index
func (*Feed) OnlyIncludePostsFromFollowing ¶
OnlyIncludePostsFromFollowing will filter the posts to include only things from people the user is following
func (*Feed) ProcessEnvelope ¶
ProcessEnvelope will determine whether the incoming letter is valid and can be submitted to the database.
func (*Feed) ProcessLetter ¶
ProcessLetter will determine where to put the letter
func (*Feed) PurgeOverflowingStorage ¶
PurgeOverflowingStorage will delete old messages
func (*Feed) SearchIndexedPosts ¶
func (*Feed) SetRegionKey ¶
func (*Feed) SignalUpdate ¶
func (f *Feed) SignalUpdate()
func (*Feed) SyncServers ¶
func (f *Feed) SyncServers()
func (*Feed) UnsealLetters ¶
UnsealLetters will go through unopened envelopes and open them and then add them to the f.db. Also go through and purge bad letters (invalidated letters)
func (*Feed) UpdateBlockedUsers ¶
func (*Feed) UpdateEverything ¶
func (f *Feed) UpdateEverything()
func (*Feed) UpdateEverythingAndSync ¶
func (f *Feed) UpdateEverythingAndSync()
func (*Feed) UpdateFriends ¶
UpdateFriends will post keys to friends
func (*Feed) UpdateOnUpload ¶
func (f *Feed) UpdateOnUpload()
func (*Feed) UploadEnvelope ¶
UploadEnvelope will upload the specified envelope
type Settings ¶
type Settings struct { StoragePerPublicPerson int64 `json:"storage_per_person"` // maximum size in bytes to store of public messages. Once exceeded, old messages are purged StoragePerFriend int64 `json:"storage_per_friend"` // maximum size in bytes to store of friend messages. Once exceeded, old messages are purged FriendsOfFriends bool `json:"friends_of_friends"` // whether you want to share your friends friend keys with new friends, effectively making a new friend friends with all your friends. This also means that when you make a new friend, that friends key is emitted to all your current friends. (default: true) BlockPublicPhotos bool `json:"block_public_photos"` // if true, block the transfer of any public photos to your computer AvailableServers []string `json:"available_servers"` }
func GenerateSettings ¶
func GenerateSettings() Settings
GenerateSettings create new instance of Something
type ShowFeedParameters ¶
type User ¶
type User struct { Name string `json:"name"` Profile template.HTML `json:"profile"` ProfileContent template.HTMLAttr `json:"profile_attr"` PublicKey string `json:"public_key"` PublicHash string `json:"public_hash"` Image string `json:"image"` Followers []string `json:"followers"` Following []string `json:"following"` Friends []string `json:"friends"` Blocked []string `json:"blocked"` Server string `json:"server"` }