Documentation ¶
Index ¶
- Constants
- func ArrayToStr(a []int) string
- func BoolToInt(a bool) int
- func GetFilesSizeMB(files []string) (int, error)
- func IntToBool(a int) bool
- type APIResponse
- type Ads
- func (a *Ads) CreateTargetGroup(AccountID int, Lifetime string, Name string, ClientIDs ...int) ([]CreateTargetGroupResponse, error)
- func (a *Ads) DeleteTargetGroup(AccountID int, TargetGroupID int, ClientIDs ...int) ([]int, error)
- func (a *Ads) GetAccounts() ([]GetAccountResponse, error)
- func (a *Ads) GetClients(AccountID int) (GetClientResponse, error)
- func (a *Ads) GetTargetGroup(AccountID int, ClientIDs ...int) ([]TargetGroupResponse, error)
- func (a *Ads) ImportTargetContacts(accountID int, targetGroupID int, contacts string) (ImportTargetContactsResponse, error)
- func (a *Ads) UpdateTargetGroup(AccountID string, TargetGroupID int) (int, error)
- type AudioAttachment
- type BotlLongPollDM
- type BotsLongPollEvent
- type BotsLongPollObject
- type BotsLongPollServer
- type BotsLongPollUpdate
- type Comment
- type Comments
- type CreateTargetGroupResponse
- type Dialog
- type DialogMessage
- type DocAttachment
- type Docs
- type Error
- type ForwardedMessage
- type Friends
- type FriendsRequests
- type GetAccountResponse
- type GetClientResponse
- type Group
- type GroupContact
- type GroupMembers
- type GroupSearchResult
- type HistoryAttachment
- type HistoryAttachmentItem
- type ImportTargetContactsResponse
- 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 TargetGroupResponse
- type Token
- type TokenOptions
- type Topic
- type TopicComment
- type Topics
- type User
- type UserCity
- type UserCountry
- type VKClient
- func (client *VKClient) AddLongpollCallback(name string, f func(*LongPollMessage))
- func (client *VKClient) BoardAddTopic(groupID int, title string, text string, fromGroup bool, attachments []string) (int, error)
- func (client *VKClient) BoardCloseTopic(groupID int, topicID int) (bool, error)
- func (client *VKClient) BoardCreateComment(groupID int, topicID int, message string, attachments []string, fromGroup bool, ...) (int, error)
- func (client *VKClient) BoardDeleteComment(groupID int, topicID int, commetID int) (bool, error)
- func (client *VKClient) BoardDeleteTopic(groupID int, topicID int) (bool, error)
- func (client *VKClient) BoardEditComment(groupID int, topicID int, commentID int, message string, attachments []string) (bool, error)
- func (client *VKClient) BoardEditTopic(groupID int, topicID int, title string) (bool, error)
- func (client *VKClient) BoardFixTopic(groupID int, topicID int) (bool, error)
- func (client *VKClient) BoardGetComments(groupID int, topicID int, count int, params url.Values) (*Comments, error)
- func (client *VKClient) BoardGetTopics(groupID int, count int, params url.Values) (*Topics, error)
- func (client *VKClient) BoardOpenTopic(groupID int, topicID int) (bool, error)
- func (client *VKClient) BoardRestoreComment(groupID int, topicID int, commentID int) (bool, error)
- func (client *VKClient) BoardUnfixTopic(groupID int, topicID int) (bool, error)
- 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) GetPhotosString(photos []*PhotoAttachment) string
- func (client *VKClient) GroupGet(userID int, count int) (int, []*Group, error)
- func (client *VKClient) GroupGetMembers(group_id int, count 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(peerOrDomain 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 VKGroupBot
- type VideoAttachment
- type Wall
- type WallPost
Constants ¶
const ( DeviceIPhone = iota DeviceWPhone DeviceAndroid )
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" )
const ( ActivityTypeTyping = "typing" ActivityTypeAudioMsg = "audiomessage" )
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 Ads ¶
type Ads struct {
// contains filtered or unexported fields
}
func (*Ads) CreateTargetGroup ¶
func (*Ads) DeleteTargetGroup ¶
func (*Ads) GetAccounts ¶
func (a *Ads) GetAccounts() ([]GetAccountResponse, error)
func (*Ads) GetClients ¶
func (a *Ads) GetClients(AccountID int) (GetClientResponse, error)
func (*Ads) GetTargetGroup ¶
func (a *Ads) GetTargetGroup(AccountID int, ClientIDs ...int) ([]TargetGroupResponse, error)
func (*Ads) ImportTargetContacts ¶
func (a *Ads) ImportTargetContacts( accountID int, targetGroupID int, contacts string) (ImportTargetContactsResponse, error)
Examples: ImportTargetContacts
type AudioAttachment ¶
type BotlLongPollDM ¶
type BotlLongPollDM struct { MessageID int `json:"id"` Date int64 `json:"date"` PeerID int64 `json:"peer_id"` SendByID int64 `json:"from_id"` Text string `json:"text"` RandomID int64 `json:"random_id"` Attachments []MessageAttachment `json:"attachments"` Isimportant bool `json:"important"` FwdMessages []BotlLongPollDM `json:"fwd_messages"` ReplyMessage *BotlLongPollDM `json:"reply_message"` }
type BotsLongPollEvent ¶
type BotsLongPollEvent struct { Type string `json:"type"` Object BotsLongPollObject `json:"object"` }
type BotsLongPollObject ¶
type BotsLongPollObject struct { Message BotlLongPollDM `json:"message"` ClientInfo interface{} `json:"client_info` }
type BotsLongPollServer ¶
type BotsLongPollUpdate ¶
type BotsLongPollUpdate struct { Failed int `json:"failed"` TS string `json:"ts"` Updates []BotsLongPollEvent `json:"updates"` }
type Comments ¶
type Comments struct { Count int `json:"count"` Comments []*TopicComment `json:"items"` // Poll *Poll `json:"poll"` Profiles []*User `json:"profiles"` }
type CreateTargetGroupResponse ¶
type CreateTargetGroupResponse struct {
ID int `json:"id"`
}
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 GetAccountResponse ¶
type GetClientResponse ¶
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 ImportTargetContactsResponse ¶
type ImportTargetContactsResponse struct {
Response int `json:"response"`
}
Возвращает количество обработанных контактов.
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 TargetGroupResponse ¶
type TargetGroupResponse struct { ID int `json:"id"` Name string `json:"name"` LastUpdated int `json:"last_updated"` IsAudience bool `json:"is_audience"` AudienceCount int `json:"audience_count"` Lifetime int `json:"lifetime"` FileSource bool `json:"file_source"` ApiSource bool `json:"api_source"` LookalikeSource bool `json:"lookalike_source"` Pixel string `json:"pixel"` Domain string `json:"domain"` }
id (integer) — идентификатор аудитории; name (string) — название аудитории ретаргетинга; last_updated (integer) — дата и время последнего пополнения аудитории в формате Unixtime; is_audience (integer, 1) — 1, если группа является аудиторией (т.е.может быть пополнена при помощи пикселя); is_shared (integer, 1) — 1, если группа является копией (см. метод ads.shareTargetGroup); audience_count (integer) — приблизительное количество пользователей, входящих в аудиторию; lifetime (integer) — количество дней, через которое пользователи, добавляемые в аудиторию ретаргетинга, будут автоматически исключены из неё; file_source (integer, 1) — признак пополнения аудитории через файл; api_source (integer, 1) — признак пополнения аудитории через метод ads.importTargetContacts; lookalike_source (integer, 1) — признак аудитории, полученной при помощи Look-a-Like.
pixel (string) — код для размещения на сайте рекламодателя. Возвращается, если параметр extended = 1 (только для старых групп). domain (string) — домен сайта, где размещен код учета пользователей (только для старых групп).
type TokenOptions ¶
type Topic ¶
type Topic struct { ID int `json:"id"` Title string `json:"title"` Created int64 `json:"created"` CreatedBy int `json:"created_by"` Updated int64 `json:"updated"` UpdatedBy int `json:"updated_by"` IsClosed int `json:"is_closed"` IsFixed int `json:"is_fixed"` Comments int `json:"comments"` FirstComment string `json:"first_comment"` LastComment string `json:"last_comment"` }
type TopicComment ¶
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"` 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) BoardAddTopic ¶
func (*VKClient) BoardCloseTopic ¶
func (*VKClient) BoardCreateComment ¶
func (*VKClient) BoardDeleteComment ¶
func (*VKClient) BoardDeleteTopic ¶
func (*VKClient) BoardEditComment ¶
func (*VKClient) BoardEditTopic ¶
func (*VKClient) BoardFixTopic ¶
func (*VKClient) BoardGetComments ¶
func (*VKClient) BoardGetTopics ¶
func (*VKClient) BoardOpenTopic ¶
func (*VKClient) BoardRestoreComment ¶
func (*VKClient) BoardUnfixTopic ¶
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 VKGroupBot ¶
func NewVKGroupBot ¶
func NewVKGroupBot(token string, options *TokenOptions) (*VKGroupBot, error)
func (*VKGroupBot) AddBotsLongpollCallback ¶
func (client *VKGroupBot) AddBotsLongpollCallback(name string, f func(*BotsLongPollObject))
func (*VKGroupBot) DeleteBotsLongpollCallback ¶
func (client *VKGroupBot) DeleteBotsLongpollCallback(name string)
func (*VKGroupBot) ListenBotsLongPollServer ¶
func (client *VKGroupBot) ListenBotsLongPollServer()
func (*VKGroupBot) ListenBotsLongPollServerWithCancel ¶
func (client *VKGroupBot) ListenBotsLongPollServerWithCancel(cancelCtx context.Context)
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"` }