Documentation ¶
Index ¶
- func Builder(ctx *junodb.Context) (junodb.Database, error)
- type Database
- type Db
- func (db *Db) AddUserToGroup(member types.UserGroupMember) error
- func (db *Db) DeleteAllApplicationLinks(height int64) error
- func (db *Db) DeleteAllChainLinks(height int64) error
- func (db *Db) DeleteAllDefaultChainLinks(height int64) error
- func (db *Db) DeleteAllPosts(height int64, subspaceID uint64) error
- func (db *Db) DeleteAllReactions(height int64, subspaceID uint64, postID uint64) error
- func (db *Db) DeleteAllReasons(height int64, subspaceID uint64) error
- func (db *Db) DeleteAllRegisteredReactions(height int64, subspaceID uint64) error
- func (db *Db) DeleteAllRelationships(height int64, subspaceID uint64) error
- func (db *Db) DeleteAllReports(height int64, subspaceID uint64) error
- func (db *Db) DeleteAllSubspaces(height int64) error
- func (db *Db) DeleteAllUserBlocks(height int64, subspaceID uint64) error
- func (db *Db) DeleteApplicationLink(user, application, username string, height int64) error
- func (db *Db) DeleteAuthzGrant(granter string, grantee string, msgTypeURL string, height int64) error
- func (db *Db) DeleteBlockage(block types.Blockage) error
- func (db *Db) DeleteChainLink(user string, externalAddress string, chainName string, height int64) error
- func (db *Db) DeleteDTagTransferRequest(request types.DTagTransferRequest) error
- func (db *Db) DeleteExpiredFeeGrants(time time.Time) error
- func (db *Db) DeleteExpiredGrants(time time.Time) error
- func (db *Db) DeleteFeeGrant(granter string, grantee string, height int64) error
- func (db *Db) DeletePost(height int64, subspaceID uint64, postID uint64) error
- func (db *Db) DeletePostAttachment(height int64, subspaceID uint64, postID uint64, attachmentID uint32) error
- func (db *Db) DeleteProfile(address string, height int64) error
- func (db *Db) DeleteReaction(height int64, subspaceID uint64, postID uint64, reactionID uint32) error
- func (db *Db) DeleteReason(height int64, subspaceID uint64, reasonID uint32) error
- func (db *Db) DeleteRegisteredReaction(height int64, subspaceID uint64, reactionID uint32) error
- func (db *Db) DeleteRelationship(relationship types.Relationship) error
- func (db *Db) DeleteReport(height int64, subspaceID uint64, reportID uint64) error
- func (db *Db) DeleteSection(height int64, subspaceID uint64, sectionID uint32) error
- func (db *Db) DeleteSubspace(height int64, id uint64) error
- func (db *Db) DeleteUserGroup(height int64, subspaceID uint64, groupID uint32) error
- func (db *Db) DeleteUserPermission(permission types.UserPermission) error
- func (db *Db) GetApplicationLinkInfos() ([]types.ApplicationLinkInfo, error)
- func (db *Db) GetContract(address string) (*types.Contract, error)
- func (db *Db) GetProfilesAddresses() ([]string, error)
- func (db *Db) GetUserByAddress(address string) (*profilestypes.Profile, error)
- func (db *Db) GetUserTokens(userAddress string) ([]types.NotificationToken, error)
- func (db *Db) HasPost(height int64, subspaceID uint64, postID uint64) (bool, error)
- func (db *Db) HasValidator(_ string) (bool, error)
- func (db *Db) RemoveUserFromGroup(member types.UserGroupMember) error
- func (db *Db) SaveApplicationLink(link types.ApplicationLink) error
- func (db *Db) SaveApplicationLinkScore(score *types.ProfileScore) error
- func (db *Db) SaveAuthzGrant(grant types.AuthzGrant) error
- func (db *Db) SaveChainLink(link types.ChainLink) error
- func (db *Db) SaveCommitSignatures(_ []*juno.CommitSig) error
- func (db *Db) SaveContract(contract types.Contract) error
- func (db *Db) SaveDTagTransferRequest(request types.DTagTransferRequest) error
- func (db *Db) SaveDefaultChainLink(chainLink types.ChainLink) error
- func (db *Db) SaveFeeGrant(grant types.FeeGrant) error
- func (db *Db) SaveNotification(recipient types.NotificationRecipient, data types.NotificationData) error
- func (db *Db) SavePollAnswer(answer types.PollAnswer) error
- func (db *Db) SavePost(post types.Post) error
- func (db *Db) SavePostAttachment(attachment types.PostAttachment) error
- func (db *Db) SavePostTx(tx types.PostTransaction) error
- func (db *Db) SavePostsParams(params types.PostsParams) error
- func (db *Db) SaveProfile(profile *types.Profile) error
- func (db *Db) SaveProfilesParams(params types.ProfilesParams) error
- func (db *Db) SaveReaction(reaction types.Reaction) error
- func (db *Db) SaveReactionParams(params types.ReactionParams) error
- func (db *Db) SaveReason(reason types.Reason) error
- func (db *Db) SaveRegisteredReaction(reaction types.RegisteredReaction) error
- func (db *Db) SaveRelationship(relationship types.Relationship) error
- func (db *Db) SaveReport(report types.Report) error
- func (db *Db) SaveReportsParams(params types.ReportsParams) error
- func (db *Db) SaveSection(section types.Section) error
- func (db *Db) SaveSubspace(subspace types.Subspace) error
- func (db *Db) SaveTip(tip types.Tip) error
- func (db *Db) SaveToken(token types.NotificationToken) error
- func (db *Db) SaveTx(_ *juno.Tx) error
- func (db *Db) SaveUserBlock(block types.Blockage) error
- func (db *Db) SaveUserGroup(group types.UserGroup) error
- func (db *Db) SaveUserIfNotExisting(address string, height int64) error
- func (db *Db) SaveUserPermission(permission types.UserPermission) error
- func (db *Db) SaveValidators(_ []*juno.Validator) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Database ¶
type Db ¶
type Db struct { *postgresql.Database // contains filtered or unexported fields }
Db represents a PostgreSQL database with expanded features. so that it can properly store posts and other Desmos-related data.
func (*Db) AddUserToGroup ¶
func (db *Db) AddUserToGroup(member types.UserGroupMember) error
AddUserToGroup adds a user to a user group
func (*Db) DeleteAllApplicationLinks ¶
DeleteAllApplicationLinks deletes all the application links that have a height equal or lower to the one given
func (*Db) DeleteAllChainLinks ¶
DeleteAllChainLinks deletes all the chain links having a height lower than the given one
func (*Db) DeleteAllDefaultChainLinks ¶
DeleteAllDefaultChainLinks removes all default chain links having a height lower than the one specified
func (*Db) DeleteAllPosts ¶
DeleteAllPosts removes all the posts for the given subspace from the database
func (*Db) DeleteAllReactions ¶
DeleteAllReactions removes all the reactions from the database
func (*Db) DeleteAllReasons ¶
DeleteAllReasons deletes all the reasons from the database
func (*Db) DeleteAllRegisteredReactions ¶
func (*Db) DeleteAllRelationships ¶
DeleteAllRelationships allows to delete all the relationships associated with the given subspace from the database
func (*Db) DeleteAllReports ¶
DeleteAllReports removes all the reports from the database
func (*Db) DeleteAllSubspaces ¶
DeleteAllSubspaces removes all the subspaces from the database
func (*Db) DeleteAllUserBlocks ¶
DeleteAllUserBlocks allows to delete all the user blocks associated with the given subspace from the database
func (*Db) DeleteApplicationLink ¶
DeleteApplicationLink allows to delete the application link associated to the given user, having the given application and username values
func (*Db) DeleteAuthzGrant ¶
func (db *Db) DeleteAuthzGrant(granter string, grantee string, msgTypeURL string, height int64) error
DeleteAuthzGrant deletes the authz grant related to the given data
func (*Db) DeleteBlockage ¶
DeleteBlockage allow to remove a previously saved user blockage
func (*Db) DeleteChainLink ¶
func (db *Db) DeleteChainLink(user string, externalAddress string, chainName string, height int64) error
DeleteChainLink removes from the database the chain link made for the given user and having the provided external address and linked to the chain with the given name
func (*Db) DeleteDTagTransferRequest ¶
func (db *Db) DeleteDTagTransferRequest(request types.DTagTransferRequest) error
DeleteDTagTransferRequest deletes the DTag requests from sender to receiver
func (*Db) DeleteExpiredFeeGrants ¶
DeleteExpiredFeeGrants removes the fee grants that expire before or on the given time
func (*Db) DeleteExpiredGrants ¶
DeleteExpiredGrants deletes all the authz grants that are expired before or on the provided date
func (*Db) DeleteFeeGrant ¶
DeleteFeeGrant removes the fee grant for the given data from the database
func (*Db) DeletePost ¶
DeletePost removes the post with the given details from the database
func (*Db) DeletePostAttachment ¶
func (db *Db) DeletePostAttachment(height int64, subspaceID uint64, postID uint64, attachmentID uint32) error
DeletePostAttachment removes the given post attachment from the database
func (*Db) DeleteProfile ¶
DeleteProfile allows to delete the profile of the user having the given address
func (*Db) DeleteReaction ¶
func (db *Db) DeleteReaction(height int64, subspaceID uint64, postID uint64, reactionID uint32) error
DeleteReaction removes the given reaction from the database
func (*Db) DeleteReason ¶
DeleteReason removes the reason having the given id from the database along with all the associated reports
func (*Db) DeleteRegisteredReaction ¶
DeleteRegisteredReaction removes the given registered reaction from the database
func (*Db) DeleteRelationship ¶
func (db *Db) DeleteRelationship(relationship types.Relationship) error
DeleteRelationship allows to delete the relationship between the given sender and receiver on the specified subspace
func (*Db) DeleteReport ¶
DeleteReport removes the report with the given id from the database
func (*Db) DeleteSection ¶
DeleteSection removes the given section from the subspace
func (*Db) DeleteSubspace ¶
DeleteSubspace removes the subspace with the given id from the database
func (*Db) DeleteUserGroup ¶
DeleteUserGroup removes the given user group from the subspace
func (*Db) DeleteUserPermission ¶
func (db *Db) DeleteUserPermission(permission types.UserPermission) error
DeleteUserPermission removes the given permission from the database
func (*Db) GetApplicationLinkInfos ¶
func (db *Db) GetApplicationLinkInfos() ([]types.ApplicationLinkInfo, error)
GetApplicationLinkInfos returns the information of all the stored application links
func (*Db) GetContract ¶
GetContract returns the stored data of the contract with the given address
func (*Db) GetProfilesAddresses ¶
GetProfilesAddresses returns all the addresses of the various profiles accounts
func (*Db) GetUserByAddress ¶
func (db *Db) GetUserByAddress(address string) (*profilestypes.Profile, error)
GetUserByAddress returns the user row having the given address. If the user does not exist yet, returns nil instead.
func (*Db) GetUserTokens ¶
func (db *Db) GetUserTokens(userAddress string) ([]types.NotificationToken, error)
GetUserTokens returns all the notifications tokens associated to all the devices of the user having the given address
func (*Db) HasValidator ¶
HasValidator overrides postgresql.Database to perform a no-op
func (*Db) RemoveUserFromGroup ¶
func (db *Db) RemoveUserFromGroup(member types.UserGroupMember) error
RemoveUserFromGroup removes the member from the given user group
func (*Db) SaveApplicationLink ¶
func (db *Db) SaveApplicationLink(link types.ApplicationLink) error
SaveApplicationLink stores the given application link inside the database
func (*Db) SaveApplicationLinkScore ¶
func (db *Db) SaveApplicationLinkScore(score *types.ProfileScore) error
SaveApplicationLinkScore stores the given profile score inside the database
func (*Db) SaveAuthzGrant ¶
func (db *Db) SaveAuthzGrant(grant types.AuthzGrant) error
SaveAuthzGrant saves the given grant inside the database
func (*Db) SaveChainLink ¶
SaveChainLink allows to store inside the db the provided chain link
func (*Db) SaveCommitSignatures ¶
SaveCommitSignatures overrides postgresql.Database to perform a no-op
func (*Db) SaveContract ¶
SaveContract stores the given contract data into the database
func (*Db) SaveDTagTransferRequest ¶
func (db *Db) SaveDTagTransferRequest(request types.DTagTransferRequest) error
SaveDTagTransferRequest saves a new transfer request from sender to receiver
func (*Db) SaveDefaultChainLink ¶
SaveDefaultChainLink saves the given chain link as a default chain link
func (*Db) SaveFeeGrant ¶
SaveFeeGrant stores the given grant inside the database
func (*Db) SaveNotification ¶
func (db *Db) SaveNotification(recipient types.NotificationRecipient, data types.NotificationData) error
SaveNotification stores the given notification inside the database
func (*Db) SavePollAnswer ¶
func (db *Db) SavePollAnswer(answer types.PollAnswer) error
SavePollAnswer stores the given answer inside the database
func (*Db) SavePostAttachment ¶
func (db *Db) SavePostAttachment(attachment types.PostAttachment) error
SavePostAttachment stores the given attachment inside the database
func (*Db) SavePostTx ¶
func (db *Db) SavePostTx(tx types.PostTransaction) error
SavePostTx stores the given transaction into the database
func (*Db) SavePostsParams ¶
func (db *Db) SavePostsParams(params types.PostsParams) error
SavePostsParams stores the given params inside the database
func (*Db) SaveProfile ¶
SaveProfile saves the given profile into the database, replacing any existing info. Returns the inserted row or an error if something goes wrong.
func (*Db) SaveProfilesParams ¶
func (db *Db) SaveProfilesParams(params types.ProfilesParams) error
SaveProfilesParams allows to store the given profiles params
func (*Db) SaveReaction ¶
SaveReaction stores the given reaction inside the database
func (*Db) SaveReactionParams ¶
func (db *Db) SaveReactionParams(params types.ReactionParams) error
SaveReactionParams saves the given params inside the database
func (*Db) SaveReason ¶
SaveReason saves the given reason insinde the database
func (*Db) SaveRegisteredReaction ¶
func (db *Db) SaveRegisteredReaction(reaction types.RegisteredReaction) error
SaveRegisteredReaction stores the given registered reaction inside the database
func (*Db) SaveRelationship ¶
func (db *Db) SaveRelationship(relationship types.Relationship) error
SaveRelationship allows to save a relationship between the sender and receiver on the given subspace
func (*Db) SaveReport ¶
SaveReport saves the given report data inside the database
func (*Db) SaveReportsParams ¶
func (db *Db) SaveReportsParams(params types.ReportsParams) error
SaveReportsParams saves the given reports params inside the database
func (*Db) SaveSection ¶
SaveSection stores the given section inside the database
func (*Db) SaveSubspace ¶
SaveSubspace stores the given subspace inside the database
func (*Db) SaveToken ¶
func (db *Db) SaveToken(token types.NotificationToken) error
SaveToken stores the given notification token inside the database
func (*Db) SaveUserBlock ¶
SaveUserBlock allows to save a user blockage
func (*Db) SaveUserGroup ¶
SaveUserGroup stores the given group inside the database
func (*Db) SaveUserIfNotExisting ¶
SaveUserIfNotExisting creates a new user having the given address if it does not exist yet. Upon creating the user, returns that. If any error is raised during the process, returns that.
func (*Db) SaveUserPermission ¶
func (db *Db) SaveUserPermission(permission types.UserPermission) error
SaveUserPermission stores the given permissions inside the database