Documentation ¶
Index ¶
- func Logout(user *User) error
- func WriteConfig(config *Config, filepath string) (err error)
- type Comment
- type Config
- type Conversation
- type ConversationItem
- type Device
- type Diary
- type DiaryPrivacy
- type Header
- type InvisibleType
- type Message
- type MessageType
- type Option
- type Options
- type Response
- type Setting
- type SettingsPrivacy
- type User
- func (user *User) ChangePassword(currentPassword, newPassword, confirmPassword string) bool
- 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) GetConversation(conversationID string) *Conversation
- func (user *User) GetConversationsList() []ConversationItem
- func (user *User) GetDevices() []Device
- func (user *User) GetFriends() []Diary
- func (user *User) GetMoreMessages(conversation *Conversation) *Conversation
- func (user *User) GetMyAllDiaries() []Diary
- func (user *User) GetMyDiaries() []Diary
- func (user *User) GetUserAllDiaries(userID string) []Diary
- func (user *User) GetUserDiaries(userID string) []Diary
- 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) RemoveDevice(device Device) bool
- func (user *User) ReplyComment(userID, diaryID, comment string) Response
- func (user *User) SendMessage(conversationID, content string) bool
- 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 ¶
WriteConfig writes config to file.
Types ¶
type Config ¶
func ReadConfig ¶
ReadConfig reads config from file.
type Conversation ¶ added in v0.2.0
type Conversation struct { // Messages includes the message in the conversation. Messages []Message // MoreMessages is a link to get more message in the conversation. MoreMessages string }
Conversation defines one conversation and the messages.
type ConversationItem ¶ added in v0.2.0
ConversationItem defines every conversation in the conversation list.
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 Message ¶ added in v0.2.0
type Message struct { Type MessageType Content string Timestamp string }
Message defines the message in the conversation.
type MessageType ¶ added in v0.2.0
type MessageType string
MessageType defines who send the message.
const ( // TypeMe means message send by myself. TypeMe MessageType = "Me" // TypeTa means message send by others. TypeTa MessageType = "Ta" )
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 ¶
LoginWithConfig login iCity by config file.
func LoginWithCookies ¶ added in v0.2.1
LoginWithCookies login iCity by cookies file.
func (*User) ChangePassword ¶ added in v0.8.3
ChangePassword changes my password.
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) GetConversation ¶ added in v0.2.0
func (user *User) GetConversation(conversationID string) *Conversation
GetConversation gets one conversation details.
func (*User) GetConversationsList ¶ added in v0.2.0
func (user *User) GetConversationsList() []ConversationItem
GetConversationsList gets all conversations we have started.
func (*User) GetDevices ¶ added in v0.9.0
GetDevices gets devices we have login iCity.
func (*User) GetFriends ¶ added in v0.10.0
func (*User) GetMoreMessages ¶ added in v0.2.0
func (user *User) GetMoreMessages(conversation *Conversation) *Conversation
GetMoreMessages gets more messages in the conversation.
func (*User) GetMyAllDiaries ¶ added in v0.8.1
GetMyAllDiaries gets my all diaries.
func (*User) GetMyDiaries ¶ added in v0.8.0
GetMyDiaries gets my index page diaries.
func (*User) GetUserAllDiaries ¶ added in v0.8.2
GetUserAllDiaries gets user all diaries.
func (*User) GetUserDiaries ¶ added in v0.8.2
GetUserDiaries gets user index page diaries.
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) RemoveDevice ¶ added in v0.9.0
RemoveDevice removes one device.
func (*User) ReplyComment ¶
ReplyComment replies user by user id and diary id.
func (*User) SendMessage ¶ added in v0.2.0
SendMessage sends a message in the conversation by conversation 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 ¶
SetLocation sets user location.
func (*User) SetNickName ¶
SetNickName sets user nickname.
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