Documentation ¶
Index ¶
- Constants
- func ArrayToStr(a []int) string
- func GetFilesSizeMB(files []string) (int, error)
- type APIResponse
- type AudioAttachment
- type Comment
- type Dialog
- type DialogMessage
- type DocAttachment
- type Docs
- type Error
- type ForwardedMessage
- type Friends
- type FriendsRequests
- type Group
- type GroupContact
- type GroupMembers
- type GroupSearchResult
- type HistoryAttachment
- type HistoryAttachmentItem
- type Item
- type LastSeen
- type Like
- type LikeUser
- type Likes
- type LinkAttachment
- type LongPollMessage
- type LongPollServer
- type LongPollUpdate
- type Message
- type MessageAttachment
- type Mutual
- type PhotoAttachment
- type Push
- type Repost
- type Request
- type ResolveScreenName
- type Source
- type StickerAttachment
- type Token
- type TokenOptions
- type User
- type UserCity
- type UserCountry
- type VKClient
- func (client *VKClient) AddLongpollCallback(name string, f func(*LongPollMessage))
- func (client *VKClient) DeleteLongpollCallback(name string)
- func (client *VKClient) DialogsGet(count int, params url.Values) (*Dialog, error)
- func (client *VKClient) DocsSearch(query string, count int, params url.Values) (int, []*DocAttachment, error)
- func (client *VKClient) FriendsAdd(userID int, text string, follow int) error
- func (client *VKClient) FriendsDelete(userID int) error
- func (client *VKClient) FriendsGet(uid int, count int) (int, []*User, error)
- func (client *VKClient) FriendsGetRequests(count int, out int) (int, []*Request, error)
- func (client *VKClient) GetDocsString(docs []*DocAttachment) string
- func (client *VKClient) GetHistoryAttachments(peerID int, mediaType string, count int, params url.Values) (*HistoryAttachment, error)
- func (client *VKClient) GetMutual(sourceUid int, targetUid int) []*int
- func (client *VKClient) GetPhotosString(photos []*PhotoAttachment) string
- func (client *VKClient) GroupGet(userID int, count int) (int, []*Group, error)
- func (client *VKClient) GroupGetMembers(group_id int, count int, offset int) (int, []*User, error)
- func (client *VKClient) GroupSearch(query string, count int) (int, []*Group, error)
- func (client *VKClient) GroupSendInvite(groupID int, userID int) error
- func (client *VKClient) LikesGet(itemType string, ownerID int, itemID int, count int, params url.Values) (int, []*LikeUser, error)
- func (client *VKClient) ListenLongPollServer()
- func (client *VKClient) ListenLongPollServerWithCancel(cancelCtx context.Context)
- func (client *VKClient) MakeRequest(method string, params url.Values) (APIResponse, error)
- func (client *VKClient) MessagesDelete(ids []int, spam int, deleteForAll int) (int, error)
- func (client *VKClient) MessagesGet(count int, chatID int, isDialog bool, params url.Values) (int, []*DialogMessage, error)
- func (client *VKClient) MessagesGetByID(message_ids []int, params url.Values) (int, []*DialogMessage, error)
- func (client *VKClient) MessagesSend(user interface{}, message string, params url.Values) (APIResponse, error)
- func (client *VKClient) MessagesSetActivity(user int, params url.Values) error
- func (client *VKClient) ResolveScreenName(name string) (ResolveScreenName, error)
- func (client *VKClient) UploadGroupWallDoc(groupID int, fileName string) (*DocAttachment, error)
- func (client *VKClient) UploadGroupWallPhotos(groupID int, files []string) ([]*PhotoAttachment, error)
- func (client *VKClient) UploadMessagesPhotos(peerID int, files []string) ([]*PhotoAttachment, error)
- func (client *VKClient) UsersGet(users []int) ([]*User, error)
- func (client *VKClient) WallGet(id interface{}, count int, params url.Values) (*Wall, error)
- func (client *VKClient) WallGetByID(id string, params url.Values) (*Wall, error)
- func (client *VKClient) WallPost(ownerID int, message string, params url.Values) (int, error)
- func (client *VKClient) WallPostComment(ownerID int, postID int, message string, params url.Values) (int, error)
- type VideoAttachment
- type Wall
- type WallPost
Constants ¶
View Source
const ( DeviceIPhone = iota DeviceWPhone DeviceAndroid )
View Source
const ( TypePost = "post" TypeComment = "comment" TypePhoto = "photo" TypeDocument = "doc" TypeAudio = "audio" TypeVideo = "video" TypeNote = "note" TypePhotoComment = "photo_comment" TypeVideoComment = "video_comment" TypeTopicComment = "topic_comment" TypeSitepage = "sitepage" )
View Source
const ( ActivityTypeTyping = "typing" ActivityTypeAudioMsg = "audiomessage" )
View Source
const ( PlatformMobile PlatformIPhone PlatfromIPad PlatformAndroid PlatformWPhone PlatformWindows PlatformWeb )
last seen device
Variables ¶
This section is empty.
Functions ¶
func ArrayToStr ¶
func GetFilesSizeMB ¶
Types ¶
type APIResponse ¶
type APIResponse struct { Response json.RawMessage `json:"response"` ResponseError Error `json:"error"` }
type AudioAttachment ¶
type DialogMessage ¶
type DialogMessage struct { MID int `json:"id"` Date int64 `json:"date"` Out int `json:"out"` UID int `json:"user_id"` ReadState int `json:"read_state"` Title string `json:"title"` Body string `json:"body"` RandomID int `json:"random_id"` ChatID int64 `json:"chat_id"` ChatActive string `json:"chat_active"` PushSettings *Push `json:"push_settings"` UsersCount int `json:"users_count"` AdminID int `json:"admin_id"` Photo50 string `json:"photo_50"` Photo100 string `json:"photo_100"` Photo200 string `json:"photo_200"` ForwardedMessages []*ForwardedMessage `json:"fwd_messages"` Attachments []*MessageAttachment `json:"attachments"` }
type DocAttachment ¶
type Docs ¶
type Docs struct { Count int `json:"count"` Documents []*DocAttachment `json:"items"` }
type ForwardedMessage ¶
type ForwardedMessage struct { UID int `json:"user_id"` Date int64 `json:"date"` Body string `json:"body"` Attachments []*MessageAttachment `json:"attachments"` ForwardedMessages []*ForwardedMessage `json:"fwd_messages"` }
type FriendsRequests ¶
type Group ¶
type Group struct { ID int `json:"id"` Name string `json:"name"` ScreenName string `json:"screen_name"` Description string `json:"description"` Activity string `json:"activity"` Contacts []*GroupContact `json:"contacts"` IsClosed int `json:"is_closed"` Type string `json:"type"` IsAdmin int `json:"is_admin"` IsMember int `json:"is_member"` HasPhoto int `json:"has_photo"` IsMessagesBlocked int `json:"is_messages_blocked"` Photo50 string `json:"photo_50"` Photo100 string `json:"photo_100"` Photo200 string `json:"photo_200"` AgeLimit int `json:"age_limits"` CanCreateTopic int `json:"can_create_topic"` CanMessage int `json:"can_message"` CanPost int `json:"can_post"` CanSeeAllPosts int `json:"can_see_all_posts"` }
type GroupContact ¶
type GroupMembers ¶
type GroupSearchResult ¶
type HistoryAttachment ¶
type HistoryAttachment struct { Attachments []HistoryAttachmentItem `json:"items"` NextFrom string `json:"next_from"` }
type HistoryAttachmentItem ¶
type HistoryAttachmentItem struct { MID int `json:"message_id"` Attachment *MessageAttachment `json:"attachment"` }
type Item ¶
type Item struct { Message *DialogMessage `json:"message"` InRead int `json:"in_read"` OutRead int `json:"out_read"` }
type LinkAttachment ¶
type LongPollMessage ¶
type LongPollServer ¶
type LongPollUpdate ¶
type Message ¶
type Message struct { Count int `json:"count"` Messages []*DialogMessage `json:"items"` }
type MessageAttachment ¶
type MessageAttachment struct { Type string `json:"type"` Audio *AudioAttachment `json:"audio"` Video *VideoAttachment `json:"video"` Photo *PhotoAttachment `json:"photo"` Document *DocAttachment `json:"doc"` Link *LinkAttachment `json:"link"` Wall *WallPost `json:"wall"` Sticker *StickerAttachment `json:"sticker"` }
type PhotoAttachment ¶
type PhotoAttachment struct { ID int `json:"id"` AID int `json:"album_id"` OwnerID int `json:"owner_id"` Photo75 string `json:"photo_75"` Photo130 string `json:"photo_130"` Photo604 string `json:"photo_604"` Photo807 string `json:"photo_807"` Photo1280 string `json:"photo_1280"` Photo2560 string `json:"photo_2560"` Width int `json:"width"` Height int `json:"height"` Text string `json:"text"` Created int64 `json:"created"` AccessKey string `json:"access_key"` }
type ResolveScreenName ¶
type StickerAttachment ¶
type StickerAttachment struct { ID int `json:"id"` ProductID int `json:"product_id"` Photo64 string `json:"photo_64"` Photo128 string `json:"photo_128"` Photo256 string `json:"photo_256"` Photo352 string `json:"photo_352"` Photo512 string `json:"photo_512"` Width int `json:"width"` Height int `json:"height"` }
type TokenOptions ¶
type User ¶
type User struct { UID int `json:"id"` FirstName string `json:"first_name"` LastName string `json:"last_name"` Sex int `json:"sex"` Nickname string `json:"nickname"` ScreenName string `json:"screen_name"` BDate string `json:"bdate"` City *UserCity `json:"city"` Country *UserCountry `json:"country"` Photo string `json:"photo"` PhotoMedium string `json:"photo_medium"` PhotoBig string `json:"photo_big"` Photo_max_orig string `json:"photo_max_orig"` Photo_max string `json:"photo_max"` HasMobile int `json:"has_mobile"` Online int `json:"online"` CanPost int `json:"can_post"` CanSeeAllPosts int `json:"can_see_all_posts"` CanWritePrivateMessages int `json:"can_write_private_message"` Status string `json:"activity"` LastOnline *LastSeen `json:"last_seen"` Hidden int `json:"hidden"` Deactivated string `json:"deactivated"` Relation int `json:"relation"` }
type UserCountry ¶
type VKClient ¶
func NewVKClientWithToken ¶
func NewVKClientWithToken(token string, options *TokenOptions) (*VKClient, error)
func (*VKClient) AddLongpollCallback ¶
func (client *VKClient) AddLongpollCallback(name string, f func(*LongPollMessage))
func (*VKClient) DeleteLongpollCallback ¶
func (*VKClient) DialogsGet ¶
func (*VKClient) DocsSearch ¶
func (*VKClient) FriendsAdd ¶
func (*VKClient) FriendsDelete ¶
func (*VKClient) FriendsGet ¶
func (*VKClient) FriendsGetRequests ¶
func (*VKClient) GetDocsString ¶
func (client *VKClient) GetDocsString(docs []*DocAttachment) string
func (*VKClient) GetHistoryAttachments ¶
func (*VKClient) GetPhotosString ¶
func (client *VKClient) GetPhotosString(photos []*PhotoAttachment) string
func (*VKClient) GroupGetMembers ¶
func (*VKClient) GroupSearch ¶
func (*VKClient) GroupSendInvite ¶
func (*VKClient) ListenLongPollServer ¶
func (client *VKClient) ListenLongPollServer()
func (*VKClient) ListenLongPollServerWithCancel ¶
func (*VKClient) MakeRequest ¶
func (*VKClient) MessagesDelete ¶
func (*VKClient) MessagesGet ¶
func (*VKClient) MessagesGetByID ¶
func (*VKClient) MessagesSend ¶
func (*VKClient) MessagesSetActivity ¶
func (*VKClient) ResolveScreenName ¶
func (client *VKClient) ResolveScreenName(name string) (ResolveScreenName, error)
func (*VKClient) UploadGroupWallDoc ¶
func (client *VKClient) UploadGroupWallDoc(groupID int, fileName string) (*DocAttachment, error)
func (*VKClient) UploadGroupWallPhotos ¶
func (client *VKClient) UploadGroupWallPhotos(groupID int, files []string) ([]*PhotoAttachment, error)
func (*VKClient) UploadMessagesPhotos ¶
func (client *VKClient) UploadMessagesPhotos(peerID int, files []string) ([]*PhotoAttachment, error)
func (*VKClient) WallGetByID ¶
type VideoAttachment ¶
type VideoAttachment struct { ID int `json:"id"` OwnerID int `json:"owner_id"` Title string `json:"title"` Duration int `json:"duration"` Description string `json:"description"` Date int64 `json:"date"` AddingDate int64 `json:"adding_date"` Views int `json:"views"` Width int `json:"width"` Height int `json:"height"` Photo130 string `json:"photo130"` Photo320 string `json:"photo320"` Photo800 string `json:"photo800"` FirstFrame320 string `json:"first_frame_320"` FirstFrame160 string `json:"first_frame_160"` FirstFrame130 string `json:"first_frame_130"` FirstFrame800 string `json:"first_frame_800"` Player string `json:"player"` CanEdit int `json:"can_edit"` CanAdd int `json:"can_add"` }
type WallPost ¶
type WallPost struct { ID int `json:"id"` FromID int `json:"from_id"` OwnerID int `json:"owner_id"` ToID int `json:"to_id"` Date int64 `json:"date"` MarkedAsAd int `json:"marked_as_ads"` IsPinned int `json:"is_pinned"` PostType string `json:"post_type"` CopyPostDate int64 `json:"copy_post_date"` CopyPostType string `json:"copy_post_type"` CopyOwnerID int `json:"copy_owner_id"` CopyPostID int `json:"copy_post_id"` CopyHistory []*WallPost `json:"copy_history"` CreatedBy int `json:"created_by"` Text string `json:"text"` CanDelete int `json:"can_delete"` CanPin int `json:"can_pin"` Attachments []*MessageAttachment `json:"attachments"` PostSource *Source `json:"post_source"` Comments *Comment `json:"comments"` Likes *Like `json:"likes"` Reposts *Repost `json:"reposts"` Online int `json:"online"` ReplyCount int `json:"reply_count"` }
Click to show internal directories.
Click to hide internal directories.