Documentation ¶
Index ¶
- func Logout(user *User) error
- func WriteConfig(config *Config, filepath string) (err error)
- type Comment
- type Config
- type Diary
- type DiaryPrivacy
- type Header
- type InvisibleType
- type Option
- type Options
- type Response
- type Setting
- type SettingsPrivacy
- type User
- func (user *User) DeleteComment(commentID, diaryID string) (deleteResp Response)
- func (user *User) DeleteDiary(diaryId string) (deleteResp Response)
- func (user *User) Follow(userID string) bool
- func (user *User) GetComments(diaryID string) []Comment
- func (user *User) GetMessages()
- func (user *User) GetMessagesList()
- func (user *User) GetMoreMessages()
- func (user *User) GetWorld() []Diary
- func (user *User) Like(diaryId string) bool
- func (user *User) NewComment(diaryID, comment string) (newResp Response)
- func (user *User) NewDiary(title, content string, privacy DiaryPrivacy) (newResp Response)
- func (user *User) ReplyComment(userID, diaryID, comment string) Response
- func (user *User) SetAboutMeAccess(setting ViewAccess) bool
- func (user *User) SetAllowComment(setting ViewAccess) bool
- func (user *User) SetAllowLike(setting ViewAccess) bool
- func (user *User) SetAllowMessage(setting ViewAccess) bool
- func (user *User) SetBio(bio string) bool
- func (user *User) SetDefaultPrivacy(setting DiaryPrivacy) bool
- func (user *User) SetFollowersAccess(setting ViewAccess) bool
- func (user *User) SetFollowingsAccess(setting ViewAccess) bool
- func (user *User) SetInvisibleMode(setting InvisibleType) bool
- func (user *User) SetLocation(location string) bool
- func (user *User) SetNickName(nickname string) bool
- func (user *User) SetOnlyFriend(id string) bool
- func (user *User) SetPrivate(id string) bool
- func (user *User) SetPublic(id string) bool
- func (user *User) SetSocialBattlenet(battlenet string) bool
- func (user *User) SetSocialDribbble(dribbble string) bool
- func (user *User) SetSocialFacebook(facebook string) bool
- func (user *User) SetSocialGithub(github string) bool
- func (user *User) SetSocialHomePage(homepage string) bool
- func (user *User) SetSocialInstagram(instagram string) bool
- func (user *User) SetSocialLink1(link1 string) bool
- func (user *User) SetSocialLink2(link2 string) bool
- func (user *User) SetSocialLink3(link3 string) bool
- func (user *User) SetSocialNS(ns string) bool
- func (user *User) SetSocialNintendo(nintendo string) bool
- func (user *User) SetSocialPSN(psn string) bool
- func (user *User) SetSocialPixiv(pixiv string) bool
- func (user *User) SetSocialQQ(qq string) bool
- func (user *User) SetSocialSteam(steam string) bool
- func (user *User) SetSocialTelegram(telegram string) bool
- func (user *User) SetSocialTumblr(tumblr string) bool
- func (user *User) SetSocialTwitter(twitter string) bool
- func (user *User) SetSocialWechat(wechat string) bool
- func (user *User) SetSocialWeibo(weibo string) bool
- func (user *User) SetSocialXBox(xbox string) bool
- func (user *User) SetUnWorld(setting WorldType) bool
- func (user *User) Unfollow(userID string) bool
- func (user *User) Unlike(diaryId string) bool
- type ViewAccess
- type WorldType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteConfig ¶
Types ¶
type Config ¶
func ReadConfig ¶
type DiaryPrivacy ¶
type DiaryPrivacy int
const ( Public DiaryPrivacy = iota + 1 OnlyFriend Private )
func (DiaryPrivacy) Data ¶
func (p DiaryPrivacy) Data() string
func (DiaryPrivacy) String ¶
func (p DiaryPrivacy) String() string
type InvisibleType ¶
type InvisibleType int
const ( // NotInvisible shows all your diaries to everyone. NotInvisible InvisibleType = iota + 1 // ToStrangers shows your diaries to your friends. ToStrangers // ToAll show your diaries to yourself. ToAll )
func (InvisibleType) Data ¶
func (i InvisibleType) Data() string
func (InvisibleType) String ¶
func (i InvisibleType) String() string
type SettingsPrivacy ¶
type SettingsPrivacy struct { // DefaultPrivacy sets your new diary default access. DefaultPrivacy DiaryPrivacy // InvisibleMode sets invisible mode. InvisibleMode InvisibleType // UnWorld sets if your diary publish to world UnWorld WorldType // AboutMe sets who can access your about me page. AboutMe ViewAccess // Followings sets who can access your followings list. Followings ViewAccess // Followers sets who can access your followers list. Followers ViewAccess // AllowComment sets who can comment your diary. AllowComment ViewAccess // Allow Like sets who can like your diary. AllowLike ViewAccess // AllowMessage sets who can send you private message. AllowMessage ViewAccess }
type User ¶
type User struct { Username string Password string UserID string Nickname string Bio string Location string SettingsPrivacy SettingsPrivacy // contains filtered or unexported fields }
func Login ¶
Login logins user to iCity. If set true to saveCookies, then will write cookies to cookies.json, then will login to iCity with exists cookies.
func LoginWithConfig ¶
func (*User) DeleteComment ¶
DeleteComment deletes a comment by comment id.
func (*User) DeleteDiary ¶
DeleteDiary deletes the diary with given diary id.
func (*User) GetComments ¶
GetComments gets diary comments by diary id.
func (*User) GetMessages ¶ added in v0.7.0
func (user *User) GetMessages()
func (*User) GetMessagesList ¶ added in v0.7.0
func (user *User) GetMessagesList()
func (*User) GetMoreMessages ¶ added in v0.2.0
func (user *User) GetMoreMessages()
func (*User) NewComment ¶
NewComment creates a new comment of a diary by diary id.
func (*User) NewDiary ¶
func (user *User) NewDiary(title, content string, privacy DiaryPrivacy) (newResp Response)
NewDiary creates a new diary with title, content and privacy.
func (*User) ReplyComment ¶
ReplyComment replies user by user id and diary id.
func (*User) SetAboutMeAccess ¶
func (user *User) SetAboutMeAccess(setting ViewAccess) bool
SetAboutMeAccess sets AboutMe access.
func (*User) SetAllowComment ¶
func (user *User) SetAllowComment(setting ViewAccess) bool
SetAllowComment sets AllowComment access.
func (*User) SetAllowLike ¶
func (user *User) SetAllowLike(setting ViewAccess) bool
SetAllowLike sets AllowLike access.
func (*User) SetAllowMessage ¶
func (user *User) SetAllowMessage(setting ViewAccess) bool
SetAllowMessage sets AllowMessage access.
func (*User) SetDefaultPrivacy ¶
func (user *User) SetDefaultPrivacy(setting DiaryPrivacy) bool
SetDefaultPrivacy sets DefaultPrivacy access.
func (*User) SetFollowersAccess ¶
func (user *User) SetFollowersAccess(setting ViewAccess) bool
SetFollowersAccess sets Followers access.
func (*User) SetFollowingsAccess ¶
func (user *User) SetFollowingsAccess(setting ViewAccess) bool
SetFollowingsAccess sets Followings access.
func (*User) SetInvisibleMode ¶
func (user *User) SetInvisibleMode(setting InvisibleType) bool
SetInvisibleMode sets InvisibleMode.
func (*User) SetLocation ¶
func (*User) SetNickName ¶
func (*User) SetOnlyFriend ¶
SetOnlyFriend sets diary privacy to OnlyFriend.
func (*User) SetPrivate ¶
SetPrivate sets diary privacy to Private.
func (*User) SetSocialBattlenet ¶
func (*User) SetSocialDribbble ¶
func (*User) SetSocialFacebook ¶
func (*User) SetSocialGithub ¶
func (*User) SetSocialHomePage ¶
func (*User) SetSocialInstagram ¶
func (*User) SetSocialLink1 ¶
func (*User) SetSocialLink2 ¶
func (*User) SetSocialLink3 ¶
func (*User) SetSocialNS ¶
func (*User) SetSocialNintendo ¶
func (*User) SetSocialPSN ¶
func (*User) SetSocialPixiv ¶
func (*User) SetSocialQQ ¶
func (*User) SetSocialSteam ¶
func (*User) SetSocialTelegram ¶
func (*User) SetSocialTumblr ¶
func (*User) SetSocialTwitter ¶
func (*User) SetSocialWechat ¶
func (*User) SetSocialWeibo ¶
func (*User) SetSocialXBox ¶
func (*User) SetUnWorld ¶
SetUnWorld sets UnWorld type.
type ViewAccess ¶
type ViewAccess int
const ( // Everyone means everyone on iCity have access. Everyone ViewAccess = iota + 1 // Friend means only your friend have access. Friend // Self means only yourself have access. Self )
func (ViewAccess) Data ¶
func (v ViewAccess) Data() string
func (ViewAccess) String ¶
func (v ViewAccess) String() string