Documentation
¶
Index ¶
- Constants
- Variables
- type Configuration
- type NFTAvatar
- type Note
- type NoteAction
- type NotePage
- type NoteStatus
- type Poster
- func (p *Poster) BatchQueryIsFollowingStatus(users *UserPage) error
- func (p *Poster) BatchQueryNFTAvatarByIds(nftIds []string) (res map[string]*NFTAvatar, err error)
- func (p *Poster) BatchQueryNFTAvatarForUserPage(page *UserPage) error
- func (p *Poster) BatchQueryNoteByIds(ids []string) (*NotePage, error)
- func (p *Poster) BatchQueryNoteStatus(page *NotePage, viewer string) error
- func (p *Poster) BatchQueryNoteStatusByIds(noteIds []string, viewer string) (map[string]*NoteStatus, error)
- func (p *Poster) BatchQueryUserByAddressArray(array *base.StringArray) (*UserPage, error)
- func (p *Poster) BatchQueryUserByAddressJson(jsonString string) (*UserPage, error)
- func (p *Poster) CheckProfile(profile *Profile) (vp *ValidProfile, err error)
- func (p *Poster) DmensFollow(addresses *base.StringArray) (*sui.Transaction, error)
- func (p *Poster) DmensPost(text string) (*sui.Transaction, error)
- func (p *Poster) DmensPostWithRef(action int, text, refIdentifier, refIdPoster string) (*sui.Transaction, error)
- func (p *Poster) DmensUnfollow(addresses *base.StringArray) (*sui.Transaction, error)
- func (p *Poster) FetchDmensGlobalConfig() error
- func (p *Poster) FetchDmensObjecId() error
- func (p *Poster) IsMyFollowing(address string) (*base.OptionalBool, error)
- func (p *Poster) IsRegister() bool
- func (p *Poster) MakeQuery(q *Query) (string, error)
- func (p *Poster) QueryAllNoteList(pageSize int, afterCursor string) (*NotePage, error)
- func (p *Poster) QueryDmensGlobalConfig() *Query
- func (p *Poster) QueryDmensObjectId() *Query
- func (p *Poster) QueryNFTAvatar(nftId string) (*NFTAvatar, error)
- func (p *Poster) QueryNoteById(noteId string) (*Note, error)
- func (p *Poster) QueryNoteStatusById(noteId string, viewer string) (*NoteStatus, error)
- func (p *Poster) QueryNotesMyFollowed(pageSize int, afterCursor string) (*NotePage, error)
- func (p *Poster) QueryReplyNoteList(noteId string, pageSize int, afterCursor string) (*NotePage, error)
- func (p *Poster) QuerySuiNameByAddress(address string) (name *base.OptionalString, err error)
- func (p *Poster) QueryTrendNoteList(pageSize int, afterCursor string) (*NotePage, error)
- func (p *Poster) QueryTrendUserList(pageSize int) (*UserPage, error)
- func (p *Poster) QueryUserFollowCount(user string) (*UserFollowCount, error)
- func (p *Poster) QueryUserFollowers(user string, pageSize int, afterCursor string) (*UserPage, error)
- func (p *Poster) QueryUserFollowing(user string, pageSize int, afterCursor string) (*UserPage, error)
- func (p *Poster) QueryUserInfoByAddress(address string) (*UserInfo, error)
- func (p *Poster) QueryUserNoteList(user string, pageSize int, afterCursor string) (*NotePage, error)
- func (p *Poster) QueryUserRepostList(user string, pageSize int, afterCursor string) (*RepostNotePage, error)
- func (p *Poster) QueryUserRepostListAsNotePage(user string, pageSize int, afterCursor string) (*NotePage, error)
- func (p *Poster) QueryUsersByName(name string, pageSize int, afterCursor string) (*UserPage, error)
- func (p *Poster) Register(validProfile *ValidProfile) (*sui.Transaction, error)
- func (p *Poster) RemoveNftAvatar(avatar *NFTAvatar) (*sui.Transaction, error)
- func (p *Poster) SetNftAvatar(nftId string) (*sui.Transaction, error)
- func (p *Poster) SwitchRpcUrl(rpc string)
- type PosterConfig
- type Profile
- type Query
- type RepostNote
- type RepostNotePage
- type UserFollowCount
- type UserInfo
- type UserPage
- type ValidProfile
Constants ¶
const ( ActionRePost ActionQuotePost ActionReply ActionLike )
const ( FunctionRegister = "register" FunctionAddItem = "add_item" FunctionRemoveItem = "remove_item" )
Variables ¶
var ( MainnetConfig = &Configuration{ Name: "mainnet", IsMainNet: true, GraphqlUrl: "https://graphql.coming.chat/sui-mainnet/graphql", } TestnetConfig = &Configuration{ Name: "testnet", GraphqlUrl: "https://graphql.coming.chat/sui-testnet/graphql", } DevnetConfig = &Configuration{ Name: "devnet", GraphqlUrl: "https://graphql.coming.chat/sui-devnet/graphql", } )
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type NFTAvatar ¶
type NFTAvatar struct { Id string `json:"id"` Image string `json:"image"` Type string `json:"type"` Name string `json:"name"` }
func NewNFTAvatar ¶
func NewNFTAvatar() *NFTAvatar
func NewNFTAvatarWithId ¶
func (*NFTAvatar) JsonString ¶
func (n *NFTAvatar) JsonString() (*base.OptionalString, error)
type Note ¶
type Note struct { CreateTime int64 `json:"createTime"` NoteId string `json:"noteId"` Action NoteAction `json:"action"` Text string `json:"text"` Poster string `json:"poster"` RefId string `json:"refId"` Status *NoteStatus `json:"status"` }
func NewNoteWithJsonString ¶
func (*Note) JsonString ¶
func (n *Note) JsonString() (*base.OptionalString, error)
type NoteAction ¶
type NoteAction = int
const ( ACTION_POST NoteAction = 0 ACTION_REPOST NoteAction = 1 ACTION_QUOTE_POST NoteAction = 2 ACTION_REPLY NoteAction = 3 ACTION_LIKE NoteAction = 4 )
type NotePage ¶
type NotePage struct { *inter.SdkPageable[*Note] }
func NewNotePage ¶
func NewNotePage() *NotePage
type NoteStatus ¶
type NoteStatus struct { NoteId string `json:"noteId"` Viewer string `json:"viewer"` ReplyCount int64 `json:"replyCount"` RepostCount int64 `json:"repostCount"` LikeCount int64 `json:"likeCount"` // Whether the viewer reposted it IsReposted bool `json:"isReposted"` // Whether the viewer liked it IsLiked bool `json:"isLiked"` }
type Poster ¶
type Poster struct { *Configuration *PosterConfig // contains filtered or unexported fields }
func NewPoster ¶
func NewPoster(posterConfig *PosterConfig, configuration *Configuration) (*Poster, error)
func (*Poster) BatchQueryIsFollowingStatus ¶
BatchQueryIsFollowingStatus Batch query the following status of all users in a specified list. The query results will be modified directly in the pointer object.
func (*Poster) BatchQueryNFTAvatarByIds ¶
func (*Poster) BatchQueryNFTAvatarForUserPage ¶
func (*Poster) BatchQueryNoteByIds ¶
func (*Poster) BatchQueryNoteStatus ¶
BatchQueryNoteStatus 批量查询 page 中所有 note 的状态,数据会直接同步到 page 中每一个 note 对象中 @param viewer the note's viewer, if the viewer is empty, the poster's address will be queried.
func (*Poster) BatchQueryNoteStatusByIds ¶
func (p *Poster) BatchQueryNoteStatusByIds(noteIds []string, viewer string) (map[string]*NoteStatus, error)
BatchQueryNoteStatusByIds
func (*Poster) BatchQueryUserByAddressArray ¶
func (p *Poster) BatchQueryUserByAddressArray(array *base.StringArray) (*UserPage, error)
func (*Poster) BatchQueryUserByAddressJson ¶
BatchQueryUserByAddressJson @param jsonString address array's json string. e.g. `["0x1","0x2", "0x3"]`
func (*Poster) CheckProfile ¶
func (p *Poster) CheckProfile(profile *Profile) (vp *ValidProfile, err error)
func (*Poster) DmensFollow ¶
func (p *Poster) DmensFollow(addresses *base.StringArray) (*sui.Transaction, error)
func (*Poster) DmensPostWithRef ¶
func (*Poster) DmensUnfollow ¶
func (p *Poster) DmensUnfollow(addresses *base.StringArray) (*sui.Transaction, error)
func (*Poster) FetchDmensGlobalConfig ¶
func (*Poster) FetchDmensObjecId ¶
FetchDmensObjecId After ios or android call profileRegister and send that transaction, this func should be recalled again to fetch the registered dmens object id
func (*Poster) IsMyFollowing ¶
func (p *Poster) IsMyFollowing(address string) (*base.OptionalBool, error)
func (*Poster) IsRegister ¶
func (*Poster) QueryAllNoteList ¶
QueryAllNoteList @param pageSize The number of notes per page. @param afterCursor Each page has a cursor, and you need to specify the cursor to get the next page of content, If you want to get the first page of content, pass in empty.
func (*Poster) QueryDmensGlobalConfig ¶
func (*Poster) QueryDmensObjectId ¶
func (*Poster) QueryNoteStatusById ¶
func (p *Poster) QueryNoteStatusById(noteId string, viewer string) (*NoteStatus, error)
QueryNoteStatusById @param noteId the note's id @param viewer the note's viewer, if the viewer is empty, the poster's address will be queried.
func (*Poster) QueryNotesMyFollowed ¶
func (*Poster) QueryReplyNoteList ¶
func (*Poster) QuerySuiNameByAddress ¶
func (p *Poster) QuerySuiNameByAddress(address string) (name *base.OptionalString, err error)
func (*Poster) QueryTrendNoteList ¶
func (*Poster) QueryTrendUserList ¶
func (*Poster) QueryUserFollowCount ¶
func (p *Poster) QueryUserFollowCount(user string) (*UserFollowCount, error)
QueryUserFollowCount @param user If the user is empty, the poster's address will be queried.
func (*Poster) QueryUserFollowers ¶
func (p *Poster) QueryUserFollowers(user string, pageSize int, afterCursor string) (*UserPage, error)
QueryUserFollowers @param user If the user is empty, the poster's address will be queried.
func (*Poster) QueryUserFollowing ¶
func (p *Poster) QueryUserFollowing(user string, pageSize int, afterCursor string) (*UserPage, error)
QueryUserFollowing @param user If the user is empty, the poster's address will be queried.
func (*Poster) QueryUserInfoByAddress ¶
QueryUserInfoByAddress @param address If the address is empty, the poster's address will be queried.
func (*Poster) QueryUserNoteList ¶
func (p *Poster) QueryUserNoteList(user string, pageSize int, afterCursor string) (*NotePage, error)
QueryUserNoteList @param user If the user is empty, the poster's address will be queried.
func (*Poster) QueryUserRepostList ¶
func (p *Poster) QueryUserRepostList(user string, pageSize int, afterCursor string) (*RepostNotePage, error)
QueryUserRepostList @param user If the user is empty, the poster's address will be queried.
func (*Poster) QueryUserRepostListAsNotePage ¶
func (p *Poster) QueryUserRepostListAsNotePage(user string, pageSize int, afterCursor string) (*NotePage, error)
QueryUserRepostListAsNotePage @param user If the user is empty, the poster's address will be queried.
func (*Poster) QueryUsersByName ¶
func (*Poster) Register ¶
func (p *Poster) Register(validProfile *ValidProfile) (*sui.Transaction, error)
func (*Poster) RemoveNftAvatar ¶
func (p *Poster) RemoveNftAvatar(avatar *NFTAvatar) (*sui.Transaction, error)
func (*Poster) SetNftAvatar ¶
func (p *Poster) SetNftAvatar(nftId string) (*sui.Transaction, error)
func (*Poster) SwitchRpcUrl ¶
type PosterConfig ¶
type PosterConfig struct { Address string DmensNftId string // Default false Reviewing bool // contains filtered or unexported fields }
func NewPosterConfig ¶
func NewPosterConfig(address string, reviewing bool) *PosterConfig
type Query ¶
type Query struct { Query string OperationName string Variables map[string]interface{} // 因为在 Variables 中使用 cursor 无法实现 `null cursor`, 因此将 cursor 单独取出来 // cursor 为空时,表示 null Cursor string }
func (*Query) ActualQueryString ¶
type RepostNote ¶
type RepostNote struct { *Note // origin note info Repost *Note `json:"repost"` // repost note info }
func NewRepostNote ¶
func NewRepostNote() *RepostNote
func NewRepostNoteWithJsonString ¶
func NewRepostNoteWithJsonString(str string) (*RepostNote, error)
func (*RepostNote) JsonString ¶
func (n *RepostNote) JsonString() (*base.OptionalString, error)
type RepostNotePage ¶
type RepostNotePage struct { *inter.SdkPageable[*RepostNote] }
func NewRepostNotePage ¶
func NewRepostNotePage() *RepostNotePage
func NewRepostNotePageWithJsonString ¶
func NewRepostNotePageWithJsonString(str string) (*RepostNotePage, error)
type UserFollowCount ¶
type UserFollowCount struct { User string `json:"user"` FollowerCount int `json:"followerCount"` FollowingCount int `json:"followingCount"` }
func NewUserFollowCount ¶
func NewUserFollowCount() *UserFollowCount
func NewUserFollowCountWithJsonString ¶
func NewUserFollowCountWithJsonString(str string) (*UserFollowCount, error)
func (*UserFollowCount) JsonString ¶
func (u *UserFollowCount) JsonString() (*base.OptionalString, error)
type UserInfo ¶
type UserInfo struct { Address string `json:"address"` Avatar string `json:"avatar"` Bio string `json:"bio"` Name string `json:"name"` NodeId string `json:"nodeId"` Background string `json:"background"` Website string `json:"website"` Identification string `json:"identification"` // Only queried when call QueryUserInfoByAddress SuiName string `json:"suiName"` // NFT avatar's nftid Item []string `json:"item"` NFTAvatar *NFTAvatar `json:"nftAvatar"` IsFollowing bool `json:"isFollowing"` }
func NewUserInfo ¶
func NewUserInfo() *UserInfo
func (*UserInfo) JsonString ¶
func (u *UserInfo) JsonString() (*base.OptionalString, error)
type UserPage ¶
type UserPage struct { *inter.SdkPageable[*UserInfo] }
func NewUserPage ¶
func NewUserPage() *UserPage
type ValidProfile ¶
Source Files
¶
- configuration.go
- dmens.go
- errors.go
- fetch_nft.go
- poster.go
- profile.go
- query.go
- query_dmens_global_config.go
- query_dmens_id.go
- query_note_by_id.go
- query_note_list.go
- query_note_my_followed.go
- query_note_status.go
- query_trend_notes.go
- query_trend_user.go
- query_types_note.go
- query_types_page.go
- query_types_raw.go
- query_types_user.go
- query_user_followers.go
- query_user_followinfo.go
- query_user_following.go
- query_user_info.go
- types.go