Documentation ¶
Index ¶
Constants ¶
const ( ModuleName = "relationships" RouterKey = ModuleName StoreKey = ModuleName ActionCreateRelationship = "create_relationship" ActionDeleteRelationship = "delete_relationship" ActionBlockUser = "block_user" ActionUnblockUser = "unblock_user" // Queries QuerierRoute = ModuleName QueryUserRelationships = "user_relationships" QueryRelationships = "relationships" QueryUserBlocks = "user_blocks" )
Variables ¶
var ( RelationshipsStorePrefix = []byte("relationships") UsersBlocksStorePrefix = []byte("users_blocks") )
var ModelsCdc = codec.New()
ModelsCdc is the codec
Functions ¶
func RegisterModelsCodec ¶
RegisterModelsCodec registers concrete types on the Amino codec
func RelationshipsStoreKey ¶
func RelationshipsStoreKey(user sdk.AccAddress) []byte
RelationshipsStoreKey turns a user address to a key used to store a Address -> []Address couple
func UsersBlocksStoreKey ¶ added in v0.12.0
func UsersBlocksStoreKey(user sdk.AccAddress) []byte
UsersBlocksStoreKey turns a user address to a key used to store a Address -> []Address couple
Types ¶
type Relationship ¶ added in v0.12.0
type Relationship struct { Recipient sdk.AccAddress `json:"recipient" yaml:"recipient"` Subspace string `json:"subspace" yaml:"subspace"` }
Relationship is the struct of a relationship. It represent the concept of "follow" of traditional social networks.
func NewRelationship ¶ added in v0.12.0
func NewRelationship(recipient sdk.AccAddress, subspace string) Relationship
func (Relationship) Equals ¶ added in v0.12.0
func (r Relationship) Equals(other Relationship) bool
Equals allows to check whether the contents of r are the same of other
func (Relationship) String ¶ added in v0.12.0
func (r Relationship) String() string
String implement fmt.Stringer
func (Relationship) Validate ¶ added in v0.12.0
func (r Relationship) Validate() error
Validate implement Validator
type Relationships ¶ added in v0.12.0
type Relationships []Relationship
func (Relationships) String ¶ added in v0.12.0
func (rs Relationships) String() string
String implement fmt.Stringer
type UserBlock ¶ added in v0.12.0
type UserBlock struct { Blocker sdk.AccAddress `json:"blocker" yaml:"blocker"` Blocked sdk.AccAddress `json:"blocked" yaml:"blocked"` Reason string `json:"reason,omitempty" yaml:"reason,omitempty"` Subspace string `json:"subspace" yaml:"subspace"` }
UserBlock represents the fact that the Blocker has blocked the given Blocked user. The Reason field represents the reason the user has been blocked for, and is optional.
func NewUserBlock ¶ added in v0.12.0
func NewUserBlock(blocker, blocked sdk.AccAddress, reason, subspace string) UserBlock
func (UserBlock) Equals ¶ added in v0.12.0
Equals checks if the two user blocks have the same content