Compare commits
47 Commits
usemautrix
...
v1.22.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e45bbe4571 | ||
|
|
fb5a84212c | ||
|
|
dedc1c45a1 | ||
|
|
6a12f9ff84 | ||
|
|
641ed1873b | ||
|
|
1d50da4b1c | ||
|
|
c7897cca5d | ||
|
|
4091b6f6b4 | ||
|
|
766f35554e | ||
|
|
c86137449e | ||
|
|
efec01a92f | ||
|
|
4fcad8e04b | ||
|
|
4b4b2d790e | ||
|
|
ec6ae343dd | ||
|
|
b9fb361959 | ||
|
|
a189298ab0 | ||
|
|
714a2ad730 | ||
|
|
fa8b96dfa1 | ||
|
|
01955a0df8 | ||
|
|
ac4aee39e3 | ||
|
|
a0bca42a7a | ||
|
|
af543dcd05 | ||
|
|
af77109a47 | ||
|
|
b979aff270 | ||
|
|
b293e3fa75 | ||
|
|
21eb37e471 | ||
|
|
d3b60cc445 | ||
|
|
7466e1d014 | ||
|
|
2a7f28606c | ||
|
|
0450482e6e | ||
|
|
ee5d9b43b5 | ||
|
|
3a8857c8c9 | ||
|
|
be3dfb251d | ||
|
|
4e11e29f70 | ||
|
|
763bb95cea | ||
|
|
668e7407e6 | ||
|
|
c147ba1da1 | ||
|
|
10f044c3dd | ||
|
|
ce5140febd | ||
|
|
858cdc86f5 | ||
|
|
9a25297d51 | ||
|
|
e24f7f5151 | ||
|
|
eff5f1e119 | ||
|
|
afcd362cd1 | ||
|
|
0452be0cb3 | ||
|
|
1624f10773 | ||
|
|
8764be7461 |
15
.github/workflows/development.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
||||
test-build-upload:
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.14.x, 1.15.x]
|
||||
go-version: [1.15.x, 1.16.x]
|
||||
platform: [ubuntu-latest]
|
||||
runs-on: ${{ matrix.platform }}
|
||||
steps:
|
||||
@@ -24,6 +24,7 @@ jobs:
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
stable: false
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
@@ -34,23 +35,23 @@ jobs:
|
||||
run: |
|
||||
mkdir -p output/{win,lin,arm,mac}
|
||||
VERSION=$(git describe --tags)
|
||||
GOOS=linux GOARCH=amd64 go build -mod=vendor -ldflags "-s -X main.githash=$(git log --pretty=format:'%h' -n 1)" -o output/lin/matterbridge-$VERSION-linux-amd64
|
||||
GOOS=windows GOARCH=amd64 go build -mod=vendor -ldflags "-s -X main.githash=$(git log --pretty=format:'%h' -n 1)" -o output/win/matterbridge-$VERSION-windows-amd64.exe
|
||||
GOOS=darwin GOARCH=amd64 go build -mod=vendor -ldflags "-s -X main.githash=$(git log --pretty=format:'%h' -n 1)" -o output/mac/matterbridge-$VERSION-darwin-amd64
|
||||
GOOS=linux GOARCH=amd64 go build -ldflags "-s -X main.githash=$(git log --pretty=format:'%h' -n 1)" -o output/lin/matterbridge-$VERSION-linux-amd64
|
||||
GOOS=windows GOARCH=amd64 go build -ldflags "-s -X main.githash=$(git log --pretty=format:'%h' -n 1)" -o output/win/matterbridge-$VERSION-windows-amd64.exe
|
||||
GOOS=darwin GOARCH=amd64 go build -ldflags "-s -X main.githash=$(git log --pretty=format:'%h' -n 1)" -o output/mac/matterbridge-$VERSION-darwin-amd64
|
||||
- name: Upload linux 64-bit
|
||||
if: startsWith(matrix.go-version,'1.15')
|
||||
if: startsWith(matrix.go-version,'1.16')
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: matterbridge-linux-64bit
|
||||
path: output/lin
|
||||
- name: Upload windows 64-bit
|
||||
if: startsWith(matrix.go-version,'1.15')
|
||||
if: startsWith(matrix.go-version,'1.16')
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: matterbridge-windows-64bit
|
||||
path: output/win
|
||||
- name: Upload darwin 64-bit
|
||||
if: startsWith(matrix.go-version,'1.15')
|
||||
if: startsWith(matrix.go-version,'1.16')
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: matterbridge-darwin-64bit
|
||||
|
||||
21
README.md
@@ -102,6 +102,7 @@ And more...
|
||||
- Not supported anymore, see [here](https://github.com/Philipp15b/go-steam/issues/94) for more info.
|
||||
- [Telegram](https://telegram.org)
|
||||
- [Twitch](https://twitch.tv)
|
||||
- [VK](https://vk.com/)
|
||||
- [WhatsApp](https://www.whatsapp.com/)
|
||||
- [XMPP](https://xmpp.org)
|
||||
- [Zulip](https://zulipchat.com)
|
||||
@@ -109,9 +110,11 @@ And more...
|
||||
### 3rd party via matterbridge api
|
||||
|
||||
- [Discourse](https://github.com/DeclanHoare/matterbabble)
|
||||
- [Facebook messenger](https://github.com/powerjungle/fbridge-asyncio)
|
||||
- [Facebook messenger](https://github.com/VictorNine/fbridge)
|
||||
- [Minecraft](https://github.com/elytra/MatterLink)
|
||||
- [Minecraft](https://github.com/raws/mattercraft)
|
||||
- [Minecraft](https://gitlab.com/Programie/MatterBukkit)
|
||||
- [Reddit](https://github.com/bonehurtingjuice/mattereddit)
|
||||
- [Counter-Strike, half-life and more](https://forums.alliedmods.net/showthread.php?t=319430)
|
||||
- [MatterAMXX](https://github.com/GabeIggy/MatterAMXX)
|
||||
@@ -124,10 +127,12 @@ More info and examples on the [wiki](https://github.com/42wim/matterbridge/wiki/
|
||||
|
||||
Used by the projects below. Feel free to make a PR to add your project to this list.
|
||||
|
||||
- [MatterLink](https://github.com/elytra/MatterLink) (Matterbridge link for Minecraft Server chat)
|
||||
- [Minecraft](https://github.com/raws/mattercraft) (Matterbridge link for Minecraft Server chat)
|
||||
- [MatterLink](https://github.com/elytra/MatterLink) (Matterbridge link for Minecraft Forge server chat, archived)
|
||||
- [MatterCraft](https://github.com/raws/mattercraft) (Matterbridge link for Minecraft Forge server chat)
|
||||
- [MatterBukkit](https://gitlab.com/Programie/MatterBukkit) (Matterbridge link for Minecraft Bukkit/Spigot server chat)
|
||||
- [pyCord](https://github.com/NikkyAI/pyCord) (crossplatform chatbot)
|
||||
- [Mattereddit](https://github.com/bonehurtingjuice/mattereddit) (Reddit chat support)
|
||||
- [fbridge-asyncio](https://github.com/powerjungle/fbridge-asyncio) (Facebook messenger support)
|
||||
- [fbridge](https://github.com/VictorNine/fbridge) (Facebook messenger support)
|
||||
- [matterbabble](https://github.com/DeclanHoare/matterbabble) (Discourse support)
|
||||
- [MatterAMXX](https://forums.alliedmods.net/showthread.php?t=319430) (Counter-Strike, half-life and more via AMXX mod)
|
||||
@@ -158,7 +163,7 @@ See <https://github.com/42wim/matterbridge/wiki>
|
||||
|
||||
### Binaries
|
||||
|
||||
- Latest stable release [v1.21.0](https://github.com/42wim/matterbridge/releases/latest)
|
||||
- Latest stable release [v1.22.3](https://github.com/42wim/matterbridge/releases/latest)
|
||||
- Development releases (follows master) can be downloaded [here](https://github.com/42wim/matterbridge/actions) selecting the latest green build and then artifacts.
|
||||
|
||||
To install or upgrade just download the latest [binary](https://github.com/42wim/matterbridge/releases/latest). On \*nix platforms you may need to make the binary executable - you can do this by running `chmod a+x` on the binary (example: `chmod a+x matterbridge-1.20.0-linux-64bit`). After downloading (and making the binary executable, if necessary), follow the instructions on the [howto](https://github.com/42wim/matterbridge/wiki/How-to-create-your-config) for a step by step walkthrough for creating your configuration.
|
||||
@@ -167,6 +172,7 @@ To install or upgrade just download the latest [binary](https://github.com/42wim
|
||||
|
||||
- [Overview](https://repology.org/metapackage/matterbridge/versions)
|
||||
- [snap](https://snapcraft.io/matterbridge)
|
||||
- [scoop](https://github.com/42wim/scoop-bucket)
|
||||
|
||||
## Building
|
||||
|
||||
@@ -206,8 +212,8 @@ All possible [settings](https://github.com/42wim/matterbridge/wiki/Settings) for
|
||||
|
||||
```toml
|
||||
[irc]
|
||||
[irc.freenode]
|
||||
Server="irc.freenode.net:6667"
|
||||
[irc.libera]
|
||||
Server="irc.libera.chat:6667"
|
||||
Nick="yourbotname"
|
||||
|
||||
[mattermost]
|
||||
@@ -223,7 +229,7 @@ All possible [settings](https://github.com/42wim/matterbridge/wiki/Settings) for
|
||||
name="mygateway"
|
||||
enable=true
|
||||
[[gateway.inout]]
|
||||
account="irc.freenode"
|
||||
account="irc.libera"
|
||||
channel="#testing"
|
||||
|
||||
[[gateway.inout]]
|
||||
@@ -348,6 +354,7 @@ Matterbridge wouldn't exist without these libraries:
|
||||
- steam - <https://github.com/Philipp15b/go-steam>
|
||||
- telegram - <https://github.com/go-telegram-bot-api/telegram-bot-api>
|
||||
- tengo - <https://github.com/d5/tengo>
|
||||
- vk - <https://github.com/SevereCloud/vksdk>
|
||||
- whatsapp - <https://github.com/Rhymen/go-whatsapp>
|
||||
- xmpp - <https://github.com/mattn/go-xmpp>
|
||||
- zulip - <https://github.com/ifo/gozulipbot>
|
||||
@@ -356,7 +363,7 @@ Matterbridge wouldn't exist without these libraries:
|
||||
|
||||
[mb-discord]: https://discord.gg/AkKPtrQ
|
||||
[mb-gitter]: https://gitter.im/42wim/matterbridge
|
||||
[mb-irc]: https://webchat.freenode.net/?channels=matterbridgechat
|
||||
[mb-irc]: https://web.libera.chat/#matterbridge
|
||||
[mb-keybase]: https://keybase.io/team/matterbridge
|
||||
[mb-matrix]: https://riot.im/app/#/room/#matterbridge:matrix.org
|
||||
[mb-mattermost]: https://framateam.org/signup_user_complete/?id=tfqm33ggop8x3qgu4boeieta6e
|
||||
|
||||
@@ -85,27 +85,28 @@ type ChannelMember struct {
|
||||
type ChannelMembers []ChannelMember
|
||||
|
||||
type Protocol struct {
|
||||
AuthCode string // steam
|
||||
BindAddress string // mattermost, slack // DEPRECATED
|
||||
Buffer int // api
|
||||
Charset string // irc
|
||||
ClientID string // msteams
|
||||
ColorNicks bool // only irc for now
|
||||
Debug bool // general
|
||||
DebugLevel int // only for irc now
|
||||
DisableWebPagePreview bool // telegram
|
||||
EditSuffix string // mattermost, slack, discord, telegram, gitter
|
||||
EditDisable bool // mattermost, slack, discord, telegram, gitter
|
||||
HTMLDisable bool // matrix
|
||||
IconURL string // mattermost, slack
|
||||
IgnoreFailureOnStart bool // general
|
||||
IgnoreNicks string // all protocols
|
||||
IgnoreMessages string // all protocols
|
||||
Jid string // xmpp
|
||||
JoinDelay string // all protocols
|
||||
Label string // all protocols
|
||||
Login string // mattermost, matrix
|
||||
LogFile string // general
|
||||
AllowMention []string // discord
|
||||
AuthCode string // steam
|
||||
BindAddress string // mattermost, slack // DEPRECATED
|
||||
Buffer int // api
|
||||
Charset string // irc
|
||||
ClientID string // msteams
|
||||
ColorNicks bool // only irc for now
|
||||
Debug bool // general
|
||||
DebugLevel int // only for irc now
|
||||
DisableWebPagePreview bool // telegram
|
||||
EditSuffix string // mattermost, slack, discord, telegram, gitter
|
||||
EditDisable bool // mattermost, slack, discord, telegram, gitter
|
||||
HTMLDisable bool // matrix
|
||||
IconURL string // mattermost, slack
|
||||
IgnoreFailureOnStart bool // general
|
||||
IgnoreNicks string // all protocols
|
||||
IgnoreMessages string // all protocols
|
||||
Jid string // xmpp
|
||||
JoinDelay string // all protocols
|
||||
Label string // all protocols
|
||||
Login string // mattermost, matrix
|
||||
LogFile string // general
|
||||
MediaDownloadBlackList []string
|
||||
MediaDownloadPath string // Basically MediaServerUpload, but instead of uploading it, just write it to a file on the same server.
|
||||
MediaDownloadSize int // all protocols
|
||||
@@ -119,6 +120,7 @@ type Protocol struct {
|
||||
MessageQueue int // IRC, size of message queue for flood control
|
||||
MessageSplit bool // IRC, split long messages with newlines on MessageLength instead of clipping
|
||||
Muc string // xmpp
|
||||
MxID string // matrix
|
||||
Name string // all protocols
|
||||
Nick string // all protocols
|
||||
NickFormatter string // mattermost, slack
|
||||
@@ -141,7 +143,7 @@ type Protocol struct {
|
||||
ReplaceNicks [][]string // all protocols
|
||||
RemoteNickFormat string // all protocols
|
||||
RunCommands []string // IRC
|
||||
Server string // IRC,mattermost,XMPP,discord
|
||||
Server string // IRC,mattermost,XMPP,discord,matrix
|
||||
SessionFile string // msteams,whatsapp
|
||||
ShowJoinPart bool // all protocols
|
||||
ShowTopicChange bool // slack
|
||||
@@ -156,7 +158,7 @@ type Protocol struct {
|
||||
Team string // mattermost, keybase
|
||||
TeamID string // msteams
|
||||
TenantID string // msteams
|
||||
Token string // gitter, slack, discord, api
|
||||
Token string // gitter, slack, discord, api, matrix
|
||||
Topic string // zulip
|
||||
URL string // mattermost, slack // DEPRECATED
|
||||
UseAPI bool // mattermost, slack
|
||||
|
||||
@@ -75,6 +75,11 @@ func (b *Bdiscord) Connect() error {
|
||||
b.c.AddHandler(b.messageDeleteBulk)
|
||||
b.c.AddHandler(b.memberAdd)
|
||||
b.c.AddHandler(b.memberRemove)
|
||||
// Add privileged intent for guild member tracking. This is needed to track nicks
|
||||
// for display names and @mention translation
|
||||
b.c.Identify.Intents = discordgo.MakeIntent(discordgo.IntentsAllWithoutPrivileged |
|
||||
discordgo.IntentsGuildMembers)
|
||||
|
||||
err = b.c.Open()
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -278,7 +283,7 @@ func (b *Bdiscord) handleEventBotUser(msg *config.Message, channelID string) (st
|
||||
// Upload a file if it exists
|
||||
if msg.Extra != nil {
|
||||
for _, rmsg := range helper.HandleExtra(msg, b.General) {
|
||||
rmsg.Text = helper.ClipMessage(rmsg.Text, MessageLength)
|
||||
rmsg.Text = helper.ClipMessage(rmsg.Text, MessageLength, b.GetString("MessageClipped"))
|
||||
if _, err := b.c.ChannelMessageSend(channelID, rmsg.Username+rmsg.Text); err != nil {
|
||||
b.Log.Errorf("Could not send message %#v: %s", rmsg, err)
|
||||
}
|
||||
@@ -289,7 +294,7 @@ func (b *Bdiscord) handleEventBotUser(msg *config.Message, channelID string) (st
|
||||
}
|
||||
}
|
||||
|
||||
msg.Text = helper.ClipMessage(msg.Text, MessageLength)
|
||||
msg.Text = helper.ClipMessage(msg.Text, MessageLength, b.GetString("MessageClipped"))
|
||||
msg.Text = b.replaceUserMentions(msg.Text)
|
||||
|
||||
// Edit message
|
||||
@@ -299,7 +304,8 @@ func (b *Bdiscord) handleEventBotUser(msg *config.Message, channelID string) (st
|
||||
}
|
||||
|
||||
m := discordgo.MessageSend{
|
||||
Content: msg.Username + msg.Text,
|
||||
Content: msg.Username + msg.Text,
|
||||
AllowedMentions: b.getAllowedMentions(),
|
||||
}
|
||||
|
||||
if msg.ParentValid() {
|
||||
@@ -330,8 +336,9 @@ func (b *Bdiscord) handleUploadFile(msg *config.Message, channelID string) (stri
|
||||
Reader: bytes.NewReader(*fi.Data),
|
||||
}
|
||||
m := discordgo.MessageSend{
|
||||
Content: msg.Username + fi.Comment,
|
||||
Files: []*discordgo.File{&file},
|
||||
Content: msg.Username + fi.Comment,
|
||||
Files: []*discordgo.File{&file},
|
||||
AllowedMentions: b.getAllowedMentions(),
|
||||
}
|
||||
_, err = b.c.ChannelMessageSendComplex(channelID, &m)
|
||||
if err != nil {
|
||||
|
||||
@@ -9,6 +9,30 @@ import (
|
||||
"github.com/matterbridge/discordgo"
|
||||
)
|
||||
|
||||
func (b *Bdiscord) getAllowedMentions() *discordgo.MessageAllowedMentions {
|
||||
// If AllowMention is not specified, then allow all mentions (default Discord behavior)
|
||||
if !b.IsKeySet("AllowMention") {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Otherwise, allow only the mentions that are specified
|
||||
allowedMentionTypes := make([]discordgo.AllowedMentionType, 0, 3)
|
||||
for _, m := range b.GetStringSlice("AllowMention") {
|
||||
switch m {
|
||||
case "everyone":
|
||||
allowedMentionTypes = append(allowedMentionTypes, discordgo.AllowedMentionTypeEveryone)
|
||||
case "roles":
|
||||
allowedMentionTypes = append(allowedMentionTypes, discordgo.AllowedMentionTypeRoles)
|
||||
case "users":
|
||||
allowedMentionTypes = append(allowedMentionTypes, discordgo.AllowedMentionTypeUsers)
|
||||
}
|
||||
}
|
||||
|
||||
return &discordgo.MessageAllowedMentions{
|
||||
Parse: allowedMentionTypes,
|
||||
}
|
||||
}
|
||||
|
||||
func (b *Bdiscord) getNick(user *discordgo.User, guildID string) string {
|
||||
b.membersMutex.RLock()
|
||||
defer b.membersMutex.RUnlock()
|
||||
|
||||
@@ -58,7 +58,7 @@ func New(session *discordgo.Session, guild string, title string, autoCreate bool
|
||||
|
||||
channelWebhooks: make(map[string]*discordgo.Webhook),
|
||||
|
||||
Log: log.NewEntry(nil),
|
||||
Log: log.NewEntry(log.StandardLogger()),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -253,6 +253,5 @@ func (t *Transmitter) assignHooksByAppID(hooks []*discordgo.Webhook, appID strin
|
||||
"name": wh.Name,
|
||||
"channel": wh.ChannelID,
|
||||
}).Println(logLine)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,9 +63,10 @@ func (b *Bdiscord) webhookSend(msg *config.Message, channelID string) (*discordg
|
||||
res, err = b.transmitter.Send(
|
||||
channelID,
|
||||
&discordgo.WebhookParams{
|
||||
Content: msg.Text,
|
||||
Username: msg.Username,
|
||||
AvatarURL: msg.Avatar,
|
||||
Content: msg.Text,
|
||||
Username: msg.Username,
|
||||
AvatarURL: msg.Avatar,
|
||||
AllowedMentions: b.getAllowedMentions(),
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
@@ -88,10 +89,11 @@ func (b *Bdiscord) webhookSend(msg *config.Message, channelID string) (*discordg
|
||||
_, e2 := b.transmitter.Send(
|
||||
channelID,
|
||||
&discordgo.WebhookParams{
|
||||
Username: msg.Username,
|
||||
AvatarURL: msg.Avatar,
|
||||
File: &file,
|
||||
Content: content,
|
||||
Username: msg.Username,
|
||||
AvatarURL: msg.Avatar,
|
||||
File: &file,
|
||||
Content: content,
|
||||
AllowedMentions: b.getAllowedMentions(),
|
||||
},
|
||||
)
|
||||
if e2 != nil {
|
||||
@@ -114,7 +116,7 @@ func (b *Bdiscord) handleEventWebhook(msg *config.Message, channelID string) (st
|
||||
return "", nil
|
||||
}
|
||||
|
||||
msg.Text = helper.ClipMessage(msg.Text, MessageLength)
|
||||
msg.Text = helper.ClipMessage(msg.Text, MessageLength, b.GetString("MessageClipped"))
|
||||
msg.Text = b.replaceUserMentions(msg.Text)
|
||||
// discord username must be [0..32] max
|
||||
if len(msg.Username) > 32 {
|
||||
@@ -124,8 +126,9 @@ func (b *Bdiscord) handleEventWebhook(msg *config.Message, channelID string) (st
|
||||
if msg.ID != "" {
|
||||
b.Log.Debugf("Editing webhook message")
|
||||
err := b.transmitter.Edit(channelID, msg.ID, &discordgo.WebhookParams{
|
||||
Content: msg.Text,
|
||||
Username: msg.Username,
|
||||
Content: msg.Text,
|
||||
Username: msg.Username,
|
||||
AllowedMentions: b.getAllowedMentions(),
|
||||
})
|
||||
if err == nil {
|
||||
return msg.ID, nil
|
||||
|
||||
@@ -51,6 +51,30 @@ func DownloadFileAuth(url string, auth string) (*[]byte, error) {
|
||||
return &data, nil
|
||||
}
|
||||
|
||||
// DownloadFileAuthRocket downloads the given URL using the specified Rocket user ID and authentication token.
|
||||
func DownloadFileAuthRocket(url, token, userID string) (*[]byte, error) {
|
||||
var buf bytes.Buffer
|
||||
client := &http.Client{
|
||||
Timeout: time.Second * 5,
|
||||
}
|
||||
req, err := http.NewRequest("GET", url, nil)
|
||||
|
||||
req.Header.Add("X-Auth-Token", token)
|
||||
req.Header.Add("X-User-Id", userID)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resp, err := client.Do(req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
_, err = io.Copy(&buf, resp.Body)
|
||||
data := buf.Bytes()
|
||||
return &data, err
|
||||
}
|
||||
|
||||
// GetSubLines splits messages in newline-delimited lines. If maxLineLength is
|
||||
// specified as non-zero GetSubLines will also clip long lines to the maximum
|
||||
// length and insert a warning marker that the line was clipped.
|
||||
@@ -58,8 +82,10 @@ func DownloadFileAuth(url string, auth string) (*[]byte, error) {
|
||||
// TODO: The current implementation has the inconvenient that it disregards
|
||||
// word boundaries when splitting but this is hard to solve without potentially
|
||||
// breaking formatting and other stylistic effects.
|
||||
func GetSubLines(message string, maxLineLength int) []string {
|
||||
const clippingMessage = " <clipped message>"
|
||||
func GetSubLines(message string, maxLineLength int, clippingMessage string) []string {
|
||||
if clippingMessage == "" {
|
||||
clippingMessage = " <clipped message>"
|
||||
}
|
||||
|
||||
var lines []string
|
||||
for _, line := range strings.Split(strings.TrimSpace(message), "\n") {
|
||||
@@ -169,8 +195,11 @@ func RemoveEmptyNewLines(msg string) string {
|
||||
|
||||
// ClipMessage trims a message to the specified length if it exceeds it and adds a warning
|
||||
// to the message in case it does so.
|
||||
func ClipMessage(text string, length int) string {
|
||||
const clippingMessage = " <clipped message>"
|
||||
func ClipMessage(text string, length int, clippingMessage string) string {
|
||||
if clippingMessage == "" {
|
||||
clippingMessage = " <clipped message>"
|
||||
}
|
||||
|
||||
if len(text) > length {
|
||||
text = text[:length-len(clippingMessage)]
|
||||
if r, size := utf8.DecodeLastRuneInString(text); r == utf8.RuneError {
|
||||
@@ -224,35 +253,52 @@ func CanConvertTgsToX() error {
|
||||
// This relies on an external command, which is ugly, but works.
|
||||
func ConvertTgsToX(data *[]byte, outputFormat string, logger *logrus.Entry) error {
|
||||
// lottie can't handle input from a pipe, so write to a temporary file:
|
||||
tmpFile, err := ioutil.TempFile(os.TempDir(), "matterbridge-lottie-*.tgs")
|
||||
tmpInFile, err := ioutil.TempFile(os.TempDir(), "matterbridge-lottie-input-*.tgs")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
tmpFileName := tmpFile.Name()
|
||||
tmpInFileName := tmpInFile.Name()
|
||||
defer func() {
|
||||
if removeErr := os.Remove(tmpFileName); removeErr != nil {
|
||||
logger.Errorf("Could not delete temporary file %s: %v", tmpFileName, removeErr)
|
||||
if removeErr := os.Remove(tmpInFileName); removeErr != nil {
|
||||
logger.Errorf("Could not delete temporary (input) file %s: %v", tmpInFileName, removeErr)
|
||||
}
|
||||
}()
|
||||
// lottie can handle writing to a pipe, but there is no way to do that platform-independently.
|
||||
// "/dev/stdout" won't work on Windows, and "-" upsets Cairo for some reason. So we need another file:
|
||||
tmpOutFile, err := ioutil.TempFile(os.TempDir(), "matterbridge-lottie-output-*.data")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
tmpOutFileName := tmpOutFile.Name()
|
||||
defer func() {
|
||||
if removeErr := os.Remove(tmpOutFileName); removeErr != nil {
|
||||
logger.Errorf("Could not delete temporary (output) file %s: %v", tmpOutFileName, removeErr)
|
||||
}
|
||||
}()
|
||||
|
||||
if _, writeErr := tmpFile.Write(*data); writeErr != nil {
|
||||
if _, writeErr := tmpInFile.Write(*data); writeErr != nil {
|
||||
return writeErr
|
||||
}
|
||||
// Must close before calling lottie to avoid data races:
|
||||
if closeErr := tmpFile.Close(); closeErr != nil {
|
||||
if closeErr := tmpInFile.Close(); closeErr != nil {
|
||||
return closeErr
|
||||
}
|
||||
|
||||
// Call lottie to transform:
|
||||
cmd := exec.Command("lottie_convert.py", "--input-format", "lottie", "--output-format", outputFormat, tmpFileName, "/dev/stdout")
|
||||
cmd := exec.Command("lottie_convert.py", "--input-format", "lottie", "--output-format", outputFormat, tmpInFileName, tmpOutFileName)
|
||||
cmd.Stdout = nil
|
||||
cmd.Stderr = nil
|
||||
// NB: lottie writes progress into to stderr in all cases.
|
||||
stdout, stderr := cmd.Output()
|
||||
_, stderr := cmd.Output()
|
||||
if stderr != nil {
|
||||
// 'stderr' already contains some parts of Stderr, because it was set to 'nil'.
|
||||
return stderr
|
||||
}
|
||||
dataContents, err := ioutil.ReadFile(tmpOutFileName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
*data = stdout
|
||||
*data = dataContents
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -10,98 +10,96 @@ import (
|
||||
|
||||
const testLineLength = 64
|
||||
|
||||
var (
|
||||
lineSplittingTestCases = map[string]struct {
|
||||
input string
|
||||
splitOutput []string
|
||||
nonSplitOutput []string
|
||||
}{
|
||||
"Short single-line message": {
|
||||
input: "short",
|
||||
splitOutput: []string{"short"},
|
||||
nonSplitOutput: []string{"short"},
|
||||
var lineSplittingTestCases = map[string]struct {
|
||||
input string
|
||||
splitOutput []string
|
||||
nonSplitOutput []string
|
||||
}{
|
||||
"Short single-line message": {
|
||||
input: "short",
|
||||
splitOutput: []string{"short"},
|
||||
nonSplitOutput: []string{"short"},
|
||||
},
|
||||
"Long single-line message": {
|
||||
input: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
|
||||
splitOutput: []string{
|
||||
"Lorem ipsum dolor sit amet, consectetur adipis <clipped message>",
|
||||
"cing elit, sed do eiusmod tempor incididunt ut <clipped message>",
|
||||
" labore et dolore magna aliqua.",
|
||||
},
|
||||
"Long single-line message": {
|
||||
input: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
|
||||
splitOutput: []string{
|
||||
"Lorem ipsum dolor sit amet, consectetur adipis <clipped message>",
|
||||
"cing elit, sed do eiusmod tempor incididunt ut <clipped message>",
|
||||
" labore et dolore magna aliqua.",
|
||||
},
|
||||
nonSplitOutput: []string{"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."},
|
||||
nonSplitOutput: []string{"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."},
|
||||
},
|
||||
"Short multi-line message": {
|
||||
input: "I\ncan't\nget\nno\nsatisfaction!",
|
||||
splitOutput: []string{
|
||||
"I",
|
||||
"can't",
|
||||
"get",
|
||||
"no",
|
||||
"satisfaction!",
|
||||
},
|
||||
"Short multi-line message": {
|
||||
input: "I\ncan't\nget\nno\nsatisfaction!",
|
||||
splitOutput: []string{
|
||||
"I",
|
||||
"can't",
|
||||
"get",
|
||||
"no",
|
||||
"satisfaction!",
|
||||
},
|
||||
nonSplitOutput: []string{
|
||||
"I",
|
||||
"can't",
|
||||
"get",
|
||||
"no",
|
||||
"satisfaction!",
|
||||
},
|
||||
nonSplitOutput: []string{
|
||||
"I",
|
||||
"can't",
|
||||
"get",
|
||||
"no",
|
||||
"satisfaction!",
|
||||
},
|
||||
"Long multi-line message": {
|
||||
input: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n" +
|
||||
"Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n" +
|
||||
"Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n" +
|
||||
"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
|
||||
splitOutput: []string{
|
||||
"Lorem ipsum dolor sit amet, consectetur adipis <clipped message>",
|
||||
"cing elit, sed do eiusmod tempor incididunt ut <clipped message>",
|
||||
" labore et dolore magna aliqua.",
|
||||
"Ut enim ad minim veniam, quis nostrud exercita <clipped message>",
|
||||
"tion ullamco laboris nisi ut aliquip ex ea com <clipped message>",
|
||||
"modo consequat.",
|
||||
"Duis aute irure dolor in reprehenderit in volu <clipped message>",
|
||||
"ptate velit esse cillum dolore eu fugiat nulla <clipped message>",
|
||||
" pariatur.",
|
||||
"Excepteur sint occaecat cupidatat non proident <clipped message>",
|
||||
", sunt in culpa qui officia deserunt mollit an <clipped message>",
|
||||
"im id est laborum.",
|
||||
},
|
||||
nonSplitOutput: []string{
|
||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
|
||||
"Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
|
||||
"Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.",
|
||||
"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
|
||||
},
|
||||
},
|
||||
"Long multi-line message": {
|
||||
input: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n" +
|
||||
"Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n" +
|
||||
"Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n" +
|
||||
"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
|
||||
splitOutput: []string{
|
||||
"Lorem ipsum dolor sit amet, consectetur adipis <clipped message>",
|
||||
"cing elit, sed do eiusmod tempor incididunt ut <clipped message>",
|
||||
" labore et dolore magna aliqua.",
|
||||
"Ut enim ad minim veniam, quis nostrud exercita <clipped message>",
|
||||
"tion ullamco laboris nisi ut aliquip ex ea com <clipped message>",
|
||||
"modo consequat.",
|
||||
"Duis aute irure dolor in reprehenderit in volu <clipped message>",
|
||||
"ptate velit esse cillum dolore eu fugiat nulla <clipped message>",
|
||||
" pariatur.",
|
||||
"Excepteur sint occaecat cupidatat non proident <clipped message>",
|
||||
", sunt in culpa qui officia deserunt mollit an <clipped message>",
|
||||
"im id est laborum.",
|
||||
},
|
||||
"Message ending with new-line.": {
|
||||
input: "Newline ending\n",
|
||||
splitOutput: []string{"Newline ending"},
|
||||
nonSplitOutput: []string{"Newline ending"},
|
||||
nonSplitOutput: []string{
|
||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
|
||||
"Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
|
||||
"Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.",
|
||||
"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
|
||||
},
|
||||
"Long message containing UTF-8 multi-byte runes": {
|
||||
input: "不布人個我此而及單石業喜資富下我河下日沒一我臺空達的常景便物沒為……子大我別名解成?生賣的全直黑,我自我結毛分洲了世當,是政福那是東;斯說",
|
||||
splitOutput: []string{
|
||||
"不布人個我此而及單石業喜資富下 <clipped message>",
|
||||
"我河下日沒一我臺空達的常景便物 <clipped message>",
|
||||
"沒為……子大我別名解成?生賣的 <clipped message>",
|
||||
"全直黑,我自我結毛分洲了世當, <clipped message>",
|
||||
"是政福那是東;斯說",
|
||||
},
|
||||
nonSplitOutput: []string{"不布人個我此而及單石業喜資富下我河下日沒一我臺空達的常景便物沒為……子大我別名解成?生賣的全直黑,我自我結毛分洲了世當,是政福那是東;斯說"},
|
||||
},
|
||||
"Message ending with new-line.": {
|
||||
input: "Newline ending\n",
|
||||
splitOutput: []string{"Newline ending"},
|
||||
nonSplitOutput: []string{"Newline ending"},
|
||||
},
|
||||
"Long message containing UTF-8 multi-byte runes": {
|
||||
input: "不布人個我此而及單石業喜資富下我河下日沒一我臺空達的常景便物沒為……子大我別名解成?生賣的全直黑,我自我結毛分洲了世當,是政福那是東;斯說",
|
||||
splitOutput: []string{
|
||||
"不布人個我此而及單石業喜資富下 <clipped message>",
|
||||
"我河下日沒一我臺空達的常景便物 <clipped message>",
|
||||
"沒為……子大我別名解成?生賣的 <clipped message>",
|
||||
"全直黑,我自我結毛分洲了世當, <clipped message>",
|
||||
"是政福那是東;斯說",
|
||||
},
|
||||
}
|
||||
)
|
||||
nonSplitOutput: []string{"不布人個我此而及單石業喜資富下我河下日沒一我臺空達的常景便物沒為……子大我別名解成?生賣的全直黑,我自我結毛分洲了世當,是政福那是東;斯說"},
|
||||
},
|
||||
}
|
||||
|
||||
func TestGetSubLines(t *testing.T) {
|
||||
for testname, testcase := range lineSplittingTestCases {
|
||||
splitLines := GetSubLines(testcase.input, testLineLength)
|
||||
splitLines := GetSubLines(testcase.input, testLineLength, "")
|
||||
assert.Equalf(t, testcase.splitOutput, splitLines, "'%s' testcase should give expected lines with splitting.", testname)
|
||||
for _, splitLine := range splitLines {
|
||||
byteLength := len([]byte(splitLine))
|
||||
assert.True(t, byteLength <= testLineLength, "Splitted line '%s' of testcase '%s' should not exceed the maximum byte-length (%d vs. %d).", splitLine, testcase, byteLength, testLineLength)
|
||||
}
|
||||
|
||||
nonSplitLines := GetSubLines(testcase.input, 0)
|
||||
nonSplitLines := GetSubLines(testcase.input, 0, "")
|
||||
assert.Equalf(t, testcase.nonSplitOutput, nonSplitLines, "'%s' testcase should give expected lines without splitting.", testname)
|
||||
}
|
||||
}
|
||||
@@ -110,16 +108,19 @@ func TestConvertWebPToPNG(t *testing.T) {
|
||||
if os.Getenv("LOCAL_TEST") == "" {
|
||||
t.Skip()
|
||||
}
|
||||
|
||||
input, err := ioutil.ReadFile("test.webp")
|
||||
if err != nil {
|
||||
t.Fail()
|
||||
}
|
||||
|
||||
d := &input
|
||||
err = ConvertWebPToPNG(d)
|
||||
if err != nil {
|
||||
t.Fail()
|
||||
}
|
||||
err = ioutil.WriteFile("test.png", *d, 0644)
|
||||
|
||||
err = ioutil.WriteFile("test.png", *d, 0o644) // nolint:gosec
|
||||
if err != nil {
|
||||
t.Fail()
|
||||
}
|
||||
|
||||
@@ -167,9 +167,9 @@ func (b *Birc) Send(msg config.Message) (string, error) {
|
||||
}
|
||||
|
||||
if b.GetBool("MessageSplit") {
|
||||
msgLines = helper.GetSubLines(msg.Text, b.MessageLength)
|
||||
msgLines = helper.GetSubLines(msg.Text, b.MessageLength, b.GetString("MessageClipped"))
|
||||
} else {
|
||||
msgLines = helper.GetSubLines(msg.Text, 0)
|
||||
msgLines = helper.GetSubLines(msg.Text, 0, b.GetString("MessageClipped"))
|
||||
}
|
||||
for i := range msgLines {
|
||||
if len(b.Local) >= b.MessageQueue {
|
||||
@@ -316,12 +316,16 @@ func (b *Birc) endNames(client *girc.Client, event girc.Event) {
|
||||
sort.Strings(b.names[channel])
|
||||
maxNamesPerPost := (300 / b.nicksPerRow()) * b.nicksPerRow()
|
||||
for len(b.names[channel]) > maxNamesPerPost {
|
||||
b.Remote <- config.Message{Username: b.Nick, Text: b.formatnicks(b.names[channel][0:maxNamesPerPost]),
|
||||
Channel: channel, Account: b.Account}
|
||||
b.Remote <- config.Message{
|
||||
Username: b.Nick, Text: b.formatnicks(b.names[channel][0:maxNamesPerPost]),
|
||||
Channel: channel, Account: b.Account,
|
||||
}
|
||||
b.names[channel] = b.names[channel][maxNamesPerPost:]
|
||||
}
|
||||
b.Remote <- config.Message{Username: b.Nick, Text: b.formatnicks(b.names[channel]),
|
||||
Channel: channel, Account: b.Account}
|
||||
b.Remote <- config.Message{
|
||||
Username: b.Nick, Text: b.formatnicks(b.names[channel]),
|
||||
Channel: channel, Account: b.Account,
|
||||
}
|
||||
b.names[channel] = nil
|
||||
b.i.Handlers.Clear(girc.RPL_NAMREPLY)
|
||||
b.i.Handlers.Clear(girc.RPL_ENDOFNAMES)
|
||||
|
||||
@@ -75,22 +75,33 @@ func New(cfg *bridge.Config) bridge.Bridger {
|
||||
func (b *Bmatrix) Connect() error {
|
||||
var err error
|
||||
b.Log.Infof("Connecting %s", b.GetString("Server"))
|
||||
b.mc, err = matrix.NewClient(b.GetString("Server"), "", "")
|
||||
if err != nil {
|
||||
return err
|
||||
if b.GetString("MxID") != "" && b.GetString("Token") != "" {
|
||||
b.mc, err = matrix.NewClient(
|
||||
b.GetString("Server"), b.GetString("MxID"), b.GetString("Token"),
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
b.UserID = b.GetString("MxID")
|
||||
b.Log.Info("Using existing Matrix credentials")
|
||||
} else {
|
||||
b.mc, err = matrix.NewClient(b.GetString("Server"), "", "")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
resp, err := b.mc.Login(&matrix.ReqLogin{
|
||||
Type: "m.login.password",
|
||||
User: b.GetString("Login"),
|
||||
Password: b.GetString("Password"),
|
||||
Identifier: matrix.NewUserIdentifier(b.GetString("Login")),
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
b.mc.SetCredentials(resp.UserID, resp.AccessToken)
|
||||
b.UserID = resp.UserID
|
||||
b.Log.Info("Connection succeeded")
|
||||
}
|
||||
resp, err := b.mc.Login(&matrix.ReqLogin{
|
||||
Type: "m.login.password",
|
||||
User: b.GetString("Login"),
|
||||
Password: b.GetString("Password"),
|
||||
Identifier: matrix.NewUserIdentifier(b.GetString("Login")),
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
b.mc.SetCredentials(resp.UserID, resp.AccessToken)
|
||||
b.UserID = resp.UserID
|
||||
b.Log.Info("Connection succeeded")
|
||||
go b.handlematrix()
|
||||
return nil
|
||||
}
|
||||
@@ -357,13 +368,6 @@ func (b *Bmatrix) handleEvent(ev *matrix.Event) {
|
||||
Avatar: b.getAvatarURL(ev.Sender),
|
||||
}
|
||||
|
||||
// Text must be a string
|
||||
if rmsg.Text, ok = ev.Content["body"].(string); !ok {
|
||||
b.Log.Errorf("Content[body] is not a string: %T\n%#v",
|
||||
ev.Content["body"], ev.Content)
|
||||
return
|
||||
}
|
||||
|
||||
// Remove homeserver suffix if configured
|
||||
if b.GetBool("NoHomeServerSuffix") {
|
||||
re := regexp.MustCompile("(.*?):.*")
|
||||
@@ -379,6 +383,13 @@ func (b *Bmatrix) handleEvent(ev *matrix.Event) {
|
||||
return
|
||||
}
|
||||
|
||||
// Text must be a string
|
||||
if rmsg.Text, ok = ev.Content["body"].(string); !ok {
|
||||
b.Log.Errorf("Content[body] is not a string: %T\n%#v",
|
||||
ev.Content["body"], ev.Content)
|
||||
return
|
||||
}
|
||||
|
||||
// Do we have a /me action
|
||||
if ev.Content["msgtype"].(string) == "m.emote" {
|
||||
rmsg.Event = config.EventUserAction
|
||||
|
||||
@@ -248,9 +248,9 @@ func (b *Bmumble) processMessage(msg *config.Message) {
|
||||
// If there is a maximum message length, split and truncate the lines
|
||||
var msgLines []string
|
||||
if maxLength := b.serverConfig.MaximumMessageLength; maxLength != nil {
|
||||
msgLines = helper.GetSubLines(msg.Text, *maxLength-len(msg.Username))
|
||||
msgLines = helper.GetSubLines(msg.Text, *maxLength-len(msg.Username), b.GetString("MessageClipped"))
|
||||
} else {
|
||||
msgLines = helper.GetSubLines(msg.Text, 0)
|
||||
msgLines = helper.GetSubLines(msg.Text, 0, b.GetString("MessageClipped"))
|
||||
}
|
||||
// Send the individual lindes
|
||||
for i := range msgLines {
|
||||
|
||||
@@ -74,12 +74,6 @@ func (b *Btalk) JoinChannel(channel config.ChannelInfo) error {
|
||||
}
|
||||
b.rooms = append(b.rooms, newRoom)
|
||||
|
||||
// Config
|
||||
guestSuffix := " (Guest)"
|
||||
if b.IsKeySet("GuestSuffix") {
|
||||
guestSuffix = b.GetString("GuestSuffix")
|
||||
}
|
||||
|
||||
go func() {
|
||||
for msg := range c {
|
||||
msg := msg
|
||||
@@ -90,35 +84,23 @@ func (b *Btalk) JoinChannel(channel config.ChannelInfo) error {
|
||||
return
|
||||
}
|
||||
|
||||
// ignore messages that are one of the following
|
||||
// * not a message from a user
|
||||
// * from ourselves
|
||||
if msg.MessageType != ocs.MessageComment || msg.ActorID == b.user.User {
|
||||
continue
|
||||
}
|
||||
remoteMessage := config.Message{
|
||||
Text: formatRichObjectString(msg.Message, msg.MessageParameters),
|
||||
Channel: newRoom.room.Token,
|
||||
Username: DisplayName(msg, guestSuffix),
|
||||
UserID: msg.ActorID,
|
||||
Account: b.Account,
|
||||
}
|
||||
// It is possible for the ID to not be set on older versions of Talk so we only set it if
|
||||
// the ID is not blank
|
||||
if msg.ID != 0 {
|
||||
remoteMessage.ID = strconv.Itoa(msg.ID)
|
||||
}
|
||||
|
||||
// Handle Files
|
||||
err = b.handleFiles(&remoteMessage, &msg)
|
||||
if err != nil {
|
||||
b.Log.Errorf("Error handling file: %#v", msg)
|
||||
|
||||
// Ignore messages that are from the bot user
|
||||
if msg.ActorID == b.user.User {
|
||||
continue
|
||||
}
|
||||
|
||||
// Handle deleting messages
|
||||
if msg.MessageType == ocs.MessageSystem && msg.Parent != nil && msg.Parent.MessageType == ocs.MessageDelete {
|
||||
b.handleDeletingMessage(&msg, &newRoom)
|
||||
continue
|
||||
}
|
||||
|
||||
// Handle sending messages
|
||||
if msg.MessageType == ocs.MessageComment {
|
||||
b.handleSendingMessage(&msg, &newRoom)
|
||||
continue
|
||||
}
|
||||
|
||||
b.Log.Debugf("<= Message is %#v", remoteMessage)
|
||||
b.Remote <- remoteMessage
|
||||
}
|
||||
}()
|
||||
return nil
|
||||
@@ -131,16 +113,40 @@ func (b *Btalk) Send(msg config.Message) (string, error) {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
// Talk currently only supports sending normal messages
|
||||
if msg.Event != "" {
|
||||
return "", nil
|
||||
// Standard Message Send
|
||||
if msg.Event == "" {
|
||||
// Handle sending files if they are included
|
||||
err := b.handleSendingFile(&msg, r)
|
||||
if err != nil {
|
||||
b.Log.Errorf("Could not send files in message to room %v from %v: %v", msg.Channel, msg.Username, err)
|
||||
|
||||
return "", nil
|
||||
}
|
||||
|
||||
sentMessage, err := r.room.SendMessage(msg.Username + msg.Text)
|
||||
if err != nil {
|
||||
b.Log.Errorf("Could not send message to room %v from %v: %v", msg.Channel, msg.Username, err)
|
||||
|
||||
return "", nil
|
||||
}
|
||||
return strconv.Itoa(sentMessage.ID), nil
|
||||
}
|
||||
sentMessage, err := r.room.SendMessage(msg.Username + msg.Text)
|
||||
if err != nil {
|
||||
b.Log.Errorf("Could not send message to room %v from %v: %v", msg.Channel, msg.Username, err)
|
||||
return "", nil
|
||||
|
||||
// Message Deletion
|
||||
if msg.Event == config.EventMsgDelete {
|
||||
messageID, err := strconv.Atoi(msg.ID)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
data, err := r.room.DeleteMessage(messageID)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return strconv.Itoa(data.ID), nil
|
||||
}
|
||||
return strconv.Itoa(sentMessage.ID), nil
|
||||
|
||||
// Message is not a type that is currently supported
|
||||
return "", nil
|
||||
}
|
||||
|
||||
func (b *Btalk) getRoom(token string) *Broom {
|
||||
@@ -177,6 +183,74 @@ func (b *Btalk) handleFiles(mmsg *config.Message, message *ocs.TalkRoomMessageDa
|
||||
return nil
|
||||
}
|
||||
|
||||
func (b *Btalk) handleSendingFile(msg *config.Message, r *Broom) error {
|
||||
for _, f := range msg.Extra["file"] {
|
||||
fi := f.(config.FileInfo)
|
||||
if fi.URL == "" {
|
||||
continue
|
||||
}
|
||||
|
||||
message := msg.Username
|
||||
if fi.Comment != "" {
|
||||
message += fi.Comment + " "
|
||||
}
|
||||
message += fi.URL
|
||||
_, err := r.room.SendMessage(message)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (b *Btalk) handleSendingMessage(msg *ocs.TalkRoomMessageData, r *Broom) {
|
||||
remoteMessage := config.Message{
|
||||
Text: formatRichObjectString(msg.Message, msg.MessageParameters),
|
||||
Channel: r.room.Token,
|
||||
Username: DisplayName(msg, b.guestSuffix()),
|
||||
UserID: msg.ActorID,
|
||||
Account: b.Account,
|
||||
}
|
||||
// It is possible for the ID to not be set on older versions of Talk so we only set it if
|
||||
// the ID is not blank
|
||||
if msg.ID != 0 {
|
||||
remoteMessage.ID = strconv.Itoa(msg.ID)
|
||||
}
|
||||
|
||||
// Handle Files
|
||||
err := b.handleFiles(&remoteMessage, msg)
|
||||
if err != nil {
|
||||
b.Log.Errorf("Error handling file: %#v", msg)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
b.Log.Debugf("<= Message is %#v", remoteMessage)
|
||||
b.Remote <- remoteMessage
|
||||
}
|
||||
|
||||
func (b *Btalk) handleDeletingMessage(msg *ocs.TalkRoomMessageData, r *Broom) {
|
||||
remoteMessage := config.Message{
|
||||
Event: config.EventMsgDelete,
|
||||
Text: config.EventMsgDelete,
|
||||
Channel: r.room.Token,
|
||||
ID: strconv.Itoa(msg.Parent.ID),
|
||||
Account: b.Account,
|
||||
}
|
||||
b.Log.Debugf("<= Message being deleted is %#v", remoteMessage)
|
||||
b.Remote <- remoteMessage
|
||||
}
|
||||
|
||||
func (b *Btalk) guestSuffix() string {
|
||||
guestSuffix := " (Guest)"
|
||||
if b.IsKeySet("GuestSuffix") {
|
||||
guestSuffix = b.GetString("GuestSuffix")
|
||||
}
|
||||
|
||||
return guestSuffix
|
||||
}
|
||||
|
||||
// Spec: https://github.com/nextcloud/server/issues/1706#issue-182308785
|
||||
func formatRichObjectString(message string, parameters map[string]ocs.RichObjectString) string {
|
||||
for id, parameter := range parameters {
|
||||
@@ -197,7 +271,7 @@ func formatRichObjectString(message string, parameters map[string]ocs.RichObject
|
||||
return message
|
||||
}
|
||||
|
||||
func DisplayName(msg ocs.TalkRoomMessageData, suffix string) string {
|
||||
func DisplayName(msg *ocs.TalkRoomMessageData, suffix string) string {
|
||||
if msg.ActorType == ocs.ActorGuest {
|
||||
if msg.ActorDisplayName == "" {
|
||||
return "Guest"
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package brocketchat
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/42wim/matterbridge/bridge/config"
|
||||
"github.com/42wim/matterbridge/bridge/helper"
|
||||
"github.com/matterbridge/Rocket.Chat.Go.SDK/models"
|
||||
)
|
||||
|
||||
@@ -58,6 +61,7 @@ func (b *Brocketchat) handleStatusEvent(ev models.Message, rmsg *config.Message)
|
||||
|
||||
func (b *Brocketchat) handleRocketClient(messages chan *config.Message) {
|
||||
for message := range b.messageChan {
|
||||
message := message
|
||||
// skip messages with same ID, apparently messages get duplicated for an unknown reason
|
||||
if _, ok := b.cache.Get(message.ID); ok {
|
||||
continue
|
||||
@@ -76,8 +80,11 @@ func (b *Brocketchat) handleRocketClient(messages chan *config.Message) {
|
||||
Account: b.Account,
|
||||
UserID: message.User.ID,
|
||||
ID: message.ID,
|
||||
Extra: make(map[string][]interface{}),
|
||||
}
|
||||
|
||||
b.handleAttachments(&message, rmsg)
|
||||
|
||||
// handleStatusEvent returns false if the message should be dropped
|
||||
// in that case it is probably some modification to the channel we do not want to relay
|
||||
if b.handleStatusEvent(m, rmsg) {
|
||||
@@ -86,6 +93,38 @@ func (b *Brocketchat) handleRocketClient(messages chan *config.Message) {
|
||||
}
|
||||
}
|
||||
|
||||
func (b *Brocketchat) handleAttachments(message *models.Message, rmsg *config.Message) {
|
||||
if rmsg.Text == "" {
|
||||
for _, attachment := range message.Attachments {
|
||||
if attachment.Title != "" {
|
||||
rmsg.Text = attachment.Title + "\n"
|
||||
}
|
||||
if attachment.Title != "" && attachment.Text != "" {
|
||||
rmsg.Text += "\n"
|
||||
}
|
||||
if attachment.Text != "" {
|
||||
rmsg.Text += attachment.Text
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for i := range message.Attachments {
|
||||
if err := b.handleDownloadFile(rmsg, &message.Attachments[i]); err != nil {
|
||||
b.Log.Errorf("Could not download incoming file: %#v", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (b *Brocketchat) handleDownloadFile(rmsg *config.Message, file *models.Attachment) error {
|
||||
downloadURL := b.GetString("server") + file.TitleLink
|
||||
data, err := helper.DownloadFileAuthRocket(downloadURL, b.user.Token, b.user.ID)
|
||||
if err != nil {
|
||||
return fmt.Errorf("download %s failed %#v", downloadURL, err)
|
||||
}
|
||||
helper.HandleDownloadData(b.Log, rmsg, file.Title, rmsg.Text, downloadURL, data, b.General)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (b *Brocketchat) handleUploadFile(msg *config.Message) error {
|
||||
for _, f := range msg.Extra["file"] {
|
||||
fi := f.(config.FileInfo)
|
||||
|
||||
@@ -156,7 +156,7 @@ func (b *Bslack) JoinChannel(channel config.ChannelInfo) error {
|
||||
|
||||
// try to join a channel when in legacy
|
||||
if b.legacy {
|
||||
_, err := b.sc.JoinChannel(channel.Name)
|
||||
_, _, _, err := b.sc.JoinConversation(channel.Name)
|
||||
if err != nil {
|
||||
switch err.Error() {
|
||||
case "name_taken", "restricted_action":
|
||||
@@ -195,7 +195,7 @@ func (b *Bslack) Send(msg config.Message) (string, error) {
|
||||
b.Log.Debugf("=> Receiving %#v", msg)
|
||||
}
|
||||
|
||||
msg.Text = helper.ClipMessage(msg.Text, messageLength)
|
||||
msg.Text = helper.ClipMessage(msg.Text, messageLength, b.GetString("MessageClipped"))
|
||||
msg.Text = b.replaceCodeFence(msg.Text)
|
||||
|
||||
// Make a action /me of the message
|
||||
|
||||
@@ -283,7 +283,7 @@ func (b *channels) populateChannels(wait bool) {
|
||||
// We only retrieve public and private channels, not IMs
|
||||
// and MPIMs as those do not have a channel name.
|
||||
queryParams := &slack.GetConversationsParameters{
|
||||
ExcludeArchived: "true",
|
||||
ExcludeArchived: true,
|
||||
Types: []string{"public_channel,private_channel"},
|
||||
}
|
||||
for {
|
||||
|
||||
@@ -2,7 +2,7 @@ package btelegram
|
||||
|
||||
import (
|
||||
"html"
|
||||
"regexp"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
"unicode/utf16"
|
||||
@@ -181,13 +181,15 @@ func (b *Btelegram) handleRecv(updates <-chan tgbotapi.Update) {
|
||||
// sends a EVENT_AVATAR_DOWNLOAD message to the gateway if successful.
|
||||
// logs an error message if it fails
|
||||
func (b *Btelegram) handleDownloadAvatar(userid int, channel string) {
|
||||
rmsg := config.Message{Username: "system",
|
||||
Text: "avatar",
|
||||
Channel: channel,
|
||||
Account: b.Account,
|
||||
UserID: strconv.Itoa(userid),
|
||||
Event: config.EventAvatarDownload,
|
||||
Extra: make(map[string][]interface{})}
|
||||
rmsg := config.Message{
|
||||
Username: "system",
|
||||
Text: "avatar",
|
||||
Channel: channel,
|
||||
Account: b.Account,
|
||||
UserID: strconv.Itoa(userid),
|
||||
Event: config.EventAvatarDownload,
|
||||
Extra: make(map[string][]interface{}),
|
||||
}
|
||||
|
||||
if _, ok := b.avatarMap[strconv.Itoa(userid)]; !ok {
|
||||
photos, err := b.c.GetUserProfilePhotos(tgbotapi.UserProfilePhotosConfig{UserID: userid, Limit: 1})
|
||||
@@ -389,21 +391,32 @@ func (b *Btelegram) handleUploadFile(msg *config.Message, chatid int64) string {
|
||||
Name: fi.Name,
|
||||
Bytes: *fi.Data,
|
||||
}
|
||||
re := regexp.MustCompile(".(jpg|jpe|png)$")
|
||||
if re.MatchString(fi.Name) {
|
||||
c = tgbotapi.NewPhotoUpload(chatid, file)
|
||||
} else {
|
||||
c = tgbotapi.NewDocumentUpload(chatid, file)
|
||||
switch filepath.Ext(fi.Name) {
|
||||
case ".jpg", ".jpe", ".png":
|
||||
pc := tgbotapi.NewPhotoUpload(chatid, file)
|
||||
pc.Caption, pc.ParseMode = TGGetParseMode(b, msg.Username, fi.Comment)
|
||||
c = pc
|
||||
case ".mp4", ".m4v":
|
||||
vc := tgbotapi.NewVideoUpload(chatid, file)
|
||||
vc.Caption, vc.ParseMode = TGGetParseMode(b, msg.Username, fi.Comment)
|
||||
c = vc
|
||||
case ".mp3", ".oga":
|
||||
ac := tgbotapi.NewAudioUpload(chatid, file)
|
||||
ac.Caption, ac.ParseMode = TGGetParseMode(b, msg.Username, fi.Comment)
|
||||
c = ac
|
||||
case ".ogg":
|
||||
voc := tgbotapi.NewVoiceUpload(chatid, file)
|
||||
voc.Caption, voc.ParseMode = TGGetParseMode(b, msg.Username, fi.Comment)
|
||||
c = voc
|
||||
default:
|
||||
dc := tgbotapi.NewDocumentUpload(chatid, file)
|
||||
dc.Caption, dc.ParseMode = TGGetParseMode(b, msg.Username, fi.Comment)
|
||||
c = dc
|
||||
}
|
||||
_, err := b.c.Send(c)
|
||||
if err != nil {
|
||||
b.Log.Errorf("file upload failed: %#v", err)
|
||||
}
|
||||
if fi.Comment != "" {
|
||||
if _, err := b.sendMessage(chatid, msg.Username, fi.Comment); err != nil {
|
||||
b.Log.Errorf("posting file comment %s failed: %s", fi.Comment, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
@@ -413,7 +426,7 @@ func (b *Btelegram) handleQuote(message, quoteNick, quoteMessage string) string
|
||||
if format == "" {
|
||||
format = "{MESSAGE} (re @{QUOTENICK}: {QUOTEMESSAGE})"
|
||||
}
|
||||
quoteMessagelength := len(quoteMessage)
|
||||
quoteMessagelength := len([]rune(quoteMessage))
|
||||
if b.GetInt("QuoteLengthLimit") != 0 && quoteMessagelength >= b.GetInt("QuoteLengthLimit") {
|
||||
runes := []rune(quoteMessage)
|
||||
quoteMessage = string(runes[0:b.GetInt("QuoteLengthLimit")])
|
||||
|
||||
@@ -69,6 +69,28 @@ func (b *Btelegram) JoinChannel(channel config.ChannelInfo) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func TGGetParseMode(b *Btelegram, username string, text string) (textout string, parsemode string) {
|
||||
textout = username + text
|
||||
if b.GetString("MessageFormat") == HTMLFormat {
|
||||
b.Log.Debug("Using mode HTML")
|
||||
parsemode = tgbotapi.ModeHTML
|
||||
}
|
||||
if b.GetString("MessageFormat") == "Markdown" {
|
||||
b.Log.Debug("Using mode markdown")
|
||||
parsemode = tgbotapi.ModeMarkdown
|
||||
}
|
||||
if b.GetString("MessageFormat") == MarkdownV2 {
|
||||
b.Log.Debug("Using mode MarkdownV2")
|
||||
parsemode = MarkdownV2
|
||||
}
|
||||
if strings.ToLower(b.GetString("MessageFormat")) == HTMLNick {
|
||||
b.Log.Debug("Using mode HTML - nick only")
|
||||
textout = username + html.EscapeString(text)
|
||||
parsemode = tgbotapi.ModeHTML
|
||||
}
|
||||
return textout, parsemode
|
||||
}
|
||||
|
||||
func (b *Btelegram) Send(msg config.Message) (string, error) {
|
||||
b.Log.Debugf("=> Receiving %#v", msg)
|
||||
|
||||
@@ -131,24 +153,7 @@ func (b *Btelegram) getFileDirectURL(id string) string {
|
||||
|
||||
func (b *Btelegram) sendMessage(chatid int64, username, text string) (string, error) {
|
||||
m := tgbotapi.NewMessage(chatid, "")
|
||||
m.Text = username + text
|
||||
if b.GetString("MessageFormat") == HTMLFormat {
|
||||
b.Log.Debug("Using mode HTML")
|
||||
m.ParseMode = tgbotapi.ModeHTML
|
||||
}
|
||||
if b.GetString("MessageFormat") == "Markdown" {
|
||||
b.Log.Debug("Using mode markdown")
|
||||
m.ParseMode = tgbotapi.ModeMarkdown
|
||||
}
|
||||
if b.GetString("MessageFormat") == MarkdownV2 {
|
||||
b.Log.Debug("Using mode MarkdownV2")
|
||||
m.ParseMode = MarkdownV2
|
||||
}
|
||||
if strings.ToLower(b.GetString("MessageFormat")) == HTMLNick {
|
||||
b.Log.Debug("Using mode HTML - nick only")
|
||||
m.Text = username + html.EscapeString(text)
|
||||
m.ParseMode = tgbotapi.ModeHTML
|
||||
}
|
||||
m.Text, m.ParseMode = TGGetParseMode(b, username, text)
|
||||
|
||||
m.DisableWebPagePreview = b.GetBool("DisableWebPagePreview")
|
||||
|
||||
|
||||
327
bridge/vk/vk.go
Normal file
@@ -0,0 +1,327 @@
|
||||
package bvk
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/42wim/matterbridge/bridge"
|
||||
"github.com/42wim/matterbridge/bridge/config"
|
||||
"github.com/42wim/matterbridge/bridge/helper"
|
||||
|
||||
"github.com/SevereCloud/vksdk/v2/api"
|
||||
"github.com/SevereCloud/vksdk/v2/events"
|
||||
longpoll "github.com/SevereCloud/vksdk/v2/longpoll-bot"
|
||||
"github.com/SevereCloud/vksdk/v2/object"
|
||||
)
|
||||
|
||||
const (
|
||||
audioMessage = "audio_message"
|
||||
document = "doc"
|
||||
photo = "photo"
|
||||
video = "video"
|
||||
graffiti = "graffiti"
|
||||
sticker = "sticker"
|
||||
wall = "wall"
|
||||
)
|
||||
|
||||
type user struct {
|
||||
lastname, firstname, avatar string
|
||||
}
|
||||
|
||||
type Bvk struct {
|
||||
c *api.VK
|
||||
usernamesMap map[int]user // cache of user names and avatar URLs
|
||||
*bridge.Config
|
||||
}
|
||||
|
||||
func New(cfg *bridge.Config) bridge.Bridger {
|
||||
return &Bvk{usernamesMap: make(map[int]user), Config: cfg}
|
||||
}
|
||||
|
||||
func (b *Bvk) Connect() error {
|
||||
b.Log.Info("Connecting")
|
||||
b.c = api.NewVK(b.GetString("Token"))
|
||||
lp, err := longpoll.NewLongPoll(b.c, b.GetInt("GroupID"))
|
||||
if err != nil {
|
||||
b.Log.Debugf("%#v", err)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
lp.MessageNew(func(ctx context.Context, obj events.MessageNewObject) {
|
||||
b.handleMessage(obj.Message, false)
|
||||
})
|
||||
|
||||
b.Log.Info("Connection succeeded")
|
||||
|
||||
go func() {
|
||||
err := lp.Run()
|
||||
if err != nil {
|
||||
b.Log.Fatal("Enable longpoll in group management")
|
||||
}
|
||||
}()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (b *Bvk) Disconnect() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (b *Bvk) JoinChannel(channel config.ChannelInfo) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (b *Bvk) Send(msg config.Message) (string, error) {
|
||||
b.Log.Debugf("=> Receiving %#v", msg)
|
||||
|
||||
peerID, err := strconv.Atoi(msg.Channel)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
params := api.Params{}
|
||||
|
||||
text := msg.Username + msg.Text
|
||||
|
||||
if msg.Extra != nil {
|
||||
if len(msg.Extra["file"]) > 0 {
|
||||
// generate attachments string
|
||||
attachment, urls := b.uploadFiles(msg.Extra, peerID)
|
||||
params["attachment"] = attachment
|
||||
text += urls
|
||||
}
|
||||
}
|
||||
|
||||
params["message"] = text
|
||||
|
||||
if msg.ID == "" {
|
||||
// New message
|
||||
params["random_id"] = time.Now().Unix()
|
||||
params["peer_ids"] = msg.Channel
|
||||
|
||||
res, e := b.c.MessagesSendPeerIDs(params)
|
||||
if e != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return strconv.Itoa(res[0].ConversationMessageID), nil
|
||||
}
|
||||
// Edit message
|
||||
messageID, err := strconv.ParseInt(msg.ID, 10, 64)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
params["peer_id"] = peerID
|
||||
params["conversation_message_id"] = messageID
|
||||
|
||||
_, err = b.c.MessagesEdit(params)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return msg.ID, nil
|
||||
}
|
||||
|
||||
func (b *Bvk) getUser(id int) user {
|
||||
u, found := b.usernamesMap[id]
|
||||
if !found {
|
||||
b.Log.Debug("Fetching username for ", id)
|
||||
|
||||
if id >= 0 {
|
||||
result, _ := b.c.UsersGet(api.Params{
|
||||
"user_ids": id,
|
||||
"fields": "photo_200",
|
||||
})
|
||||
|
||||
resUser := result[0]
|
||||
u = user{lastname: resUser.LastName, firstname: resUser.FirstName, avatar: resUser.Photo200}
|
||||
b.usernamesMap[id] = u
|
||||
} else {
|
||||
result, _ := b.c.GroupsGetByID(api.Params{
|
||||
"group_id": id * -1,
|
||||
})
|
||||
|
||||
resGroup := result[0]
|
||||
u = user{lastname: resGroup.Name, avatar: resGroup.Photo200}
|
||||
}
|
||||
}
|
||||
|
||||
return u
|
||||
}
|
||||
|
||||
func (b *Bvk) handleMessage(msg object.MessagesMessage, isFwd bool) {
|
||||
b.Log.Debug("ChatID: ", msg.PeerID)
|
||||
// fetch user info
|
||||
u := b.getUser(msg.FromID)
|
||||
|
||||
rmsg := config.Message{
|
||||
Text: msg.Text,
|
||||
Username: u.firstname + " " + u.lastname,
|
||||
Avatar: u.avatar,
|
||||
Channel: strconv.Itoa(msg.PeerID),
|
||||
Account: b.Account,
|
||||
UserID: strconv.Itoa(msg.FromID),
|
||||
ID: strconv.Itoa(msg.ConversationMessageID),
|
||||
Extra: make(map[string][]interface{}),
|
||||
}
|
||||
|
||||
if msg.ReplyMessage != nil {
|
||||
ur := b.getUser(msg.ReplyMessage.FromID)
|
||||
rmsg.Text = "Re: " + ur.firstname + " " + ur.lastname + "\n" + rmsg.Text
|
||||
}
|
||||
|
||||
if isFwd {
|
||||
rmsg.Username = "Fwd: " + rmsg.Username
|
||||
}
|
||||
|
||||
if len(msg.Attachments) > 0 {
|
||||
urls, text := b.getFiles(msg.Attachments)
|
||||
|
||||
if text != "" {
|
||||
rmsg.Text += "\n" + text
|
||||
}
|
||||
|
||||
// download
|
||||
b.downloadFiles(&rmsg, urls)
|
||||
}
|
||||
|
||||
if len(msg.FwdMessages) > 0 {
|
||||
rmsg.Text += strconv.Itoa(len(msg.FwdMessages)) + " forwarded messages"
|
||||
}
|
||||
|
||||
b.Remote <- rmsg
|
||||
|
||||
if len(msg.FwdMessages) > 0 {
|
||||
// recursive processing of forwarded messages
|
||||
for _, m := range msg.FwdMessages {
|
||||
m.PeerID = msg.PeerID
|
||||
b.handleMessage(m, true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (b *Bvk) uploadFiles(extra map[string][]interface{}, peerID int) (string, string) {
|
||||
var attachments []string
|
||||
text := ""
|
||||
|
||||
for _, f := range extra["file"] {
|
||||
fi := f.(config.FileInfo)
|
||||
|
||||
if fi.Comment != "" {
|
||||
text += fi.Comment + "\n"
|
||||
}
|
||||
a, err := b.uploadFile(fi, peerID)
|
||||
if err != nil {
|
||||
b.Log.Error("File upload error ", fi.Name)
|
||||
}
|
||||
|
||||
attachments = append(attachments, a)
|
||||
}
|
||||
|
||||
return strings.Join(attachments, ","), text
|
||||
}
|
||||
|
||||
func (b *Bvk) uploadFile(file config.FileInfo, peerID int) (string, error) {
|
||||
r := bytes.NewReader(*file.Data)
|
||||
|
||||
photoRE := regexp.MustCompile(".(jpg|jpe|png)$")
|
||||
if photoRE.MatchString(file.Name) {
|
||||
p, err := b.c.UploadMessagesPhoto(peerID, r)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return photo + strconv.Itoa(p[0].OwnerID) + "_" + strconv.Itoa(p[0].ID), nil
|
||||
}
|
||||
|
||||
var doctype string
|
||||
if strings.Contains(file.Name, ".ogg") {
|
||||
doctype = audioMessage
|
||||
} else {
|
||||
doctype = document
|
||||
}
|
||||
|
||||
doc, err := b.c.UploadMessagesDoc(peerID, doctype, file.Name, "", r)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
switch doc.Type {
|
||||
case audioMessage:
|
||||
return document + strconv.Itoa(doc.AudioMessage.OwnerID) + "_" + strconv.Itoa(doc.AudioMessage.ID), nil
|
||||
case document:
|
||||
return document + strconv.Itoa(doc.Doc.OwnerID) + "_" + strconv.Itoa(doc.Doc.ID), nil
|
||||
}
|
||||
|
||||
return "", nil
|
||||
}
|
||||
|
||||
func (b *Bvk) getFiles(attachments []object.MessagesMessageAttachment) ([]string, string) {
|
||||
var urls []string
|
||||
var text []string
|
||||
|
||||
for _, a := range attachments {
|
||||
switch a.Type {
|
||||
case photo:
|
||||
var resolution float64 = 0
|
||||
url := a.Photo.Sizes[0].URL
|
||||
for _, size := range a.Photo.Sizes {
|
||||
r := size.Height * size.Width
|
||||
if resolution < r {
|
||||
resolution = r
|
||||
url = size.URL
|
||||
}
|
||||
}
|
||||
|
||||
urls = append(urls, url)
|
||||
|
||||
case document:
|
||||
urls = append(urls, a.Doc.URL)
|
||||
|
||||
case graffiti:
|
||||
urls = append(urls, a.Graffiti.URL)
|
||||
|
||||
case audioMessage:
|
||||
urls = append(urls, a.AudioMessage.DocsDocPreviewAudioMessage.LinkOgg)
|
||||
|
||||
case sticker:
|
||||
var resolution float64 = 0
|
||||
url := a.Sticker.Images[0].URL
|
||||
for _, size := range a.Sticker.Images {
|
||||
r := size.Height * size.Width
|
||||
if resolution < r {
|
||||
resolution = r
|
||||
url = size.URL
|
||||
}
|
||||
}
|
||||
urls = append(urls, url+".png")
|
||||
case video:
|
||||
text = append(text, "https://vk.com/video"+strconv.Itoa(a.Video.OwnerID)+"_"+strconv.Itoa(a.Video.ID))
|
||||
|
||||
case wall:
|
||||
text = append(text, "https://vk.com/wall"+strconv.Itoa(a.Wall.FromID)+"_"+strconv.Itoa(a.Wall.ID))
|
||||
|
||||
default:
|
||||
text = append(text, "This attachment is not supported ("+a.Type+")")
|
||||
}
|
||||
}
|
||||
|
||||
return urls, strings.Join(text, "\n")
|
||||
}
|
||||
|
||||
func (b *Bvk) downloadFiles(rmsg *config.Message, urls []string) {
|
||||
for _, url := range urls {
|
||||
data, err := helper.DownloadFile(url)
|
||||
if err == nil {
|
||||
urlPart := strings.Split(url, "/")
|
||||
name := strings.Split(urlPart[len(urlPart)-1], "?")[0]
|
||||
helper.HandleDownloadData(b.Log, rmsg, name, "", url, data, b.General)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -175,6 +175,11 @@ func (b *Bwhatsapp) HandleImageMessage(message whatsapp.ImageMessage) {
|
||||
fileExt[0] = ".jpg"
|
||||
}
|
||||
|
||||
// rename .jpe to .jpg https://github.com/42wim/matterbridge/issues/1463
|
||||
if fileExt[0] == ".jpe" {
|
||||
fileExt[0] = ".jpg"
|
||||
}
|
||||
|
||||
filename := fmt.Sprintf("%v%v", message.Info.Id, fileExt[0])
|
||||
|
||||
b.Log.Debugf("Trying to download %s with type %s", filename, message.Type)
|
||||
@@ -232,6 +237,10 @@ func (b *Bwhatsapp) HandleVideoMessage(message whatsapp.VideoMessage) {
|
||||
return
|
||||
}
|
||||
|
||||
if len(fileExt) == 0 {
|
||||
fileExt = append(fileExt, ".mp4")
|
||||
}
|
||||
|
||||
filename := fmt.Sprintf("%v%v", message.Info.Id, fileExt[0])
|
||||
|
||||
b.Log.Debugf("Trying to download %s with size %#v and type %s", filename, message.Length, message.Type)
|
||||
@@ -289,6 +298,10 @@ func (b *Bwhatsapp) HandleAudioMessage(message whatsapp.AudioMessage) {
|
||||
return
|
||||
}
|
||||
|
||||
if len(fileExt) == 0 {
|
||||
fileExt = append(fileExt, ".ogg")
|
||||
}
|
||||
|
||||
filename := fmt.Sprintf("%v%v", message.Info.Id, fileExt[0])
|
||||
|
||||
b.Log.Debugf("Trying to download %s with size %#v and type %s", filename, message.Length, message.Type)
|
||||
@@ -308,3 +321,60 @@ func (b *Bwhatsapp) HandleAudioMessage(message whatsapp.AudioMessage) {
|
||||
|
||||
b.Remote <- rmsg
|
||||
}
|
||||
|
||||
// HandleDocumentMessage downloads documents
|
||||
func (b *Bwhatsapp) HandleDocumentMessage(message whatsapp.DocumentMessage) {
|
||||
if message.Info.FromMe || message.Info.Timestamp < b.startedAt {
|
||||
return
|
||||
}
|
||||
|
||||
senderJID := message.Info.SenderJid
|
||||
if len(message.Info.SenderJid) == 0 && message.Info.Source != nil && message.Info.Source.Participant != nil {
|
||||
senderJID = *message.Info.Source.Participant
|
||||
}
|
||||
|
||||
senderName := b.getSenderName(message.Info.SenderJid)
|
||||
if senderName == "" {
|
||||
senderName = "Someone" // don't expose telephone number
|
||||
}
|
||||
|
||||
rmsg := config.Message{
|
||||
UserID: senderJID,
|
||||
Username: senderName,
|
||||
Channel: message.Info.RemoteJid,
|
||||
Account: b.Account,
|
||||
Protocol: b.Protocol,
|
||||
Extra: make(map[string][]interface{}),
|
||||
ID: message.Info.Id,
|
||||
}
|
||||
|
||||
if avatarURL, exists := b.userAvatars[senderJID]; exists {
|
||||
rmsg.Avatar = avatarURL
|
||||
}
|
||||
|
||||
fileExt, err := mime.ExtensionsByType(message.Type)
|
||||
if err != nil {
|
||||
b.Log.Errorf("Mimetype detection error: %s", err)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
filename := fmt.Sprintf("%v", message.FileName)
|
||||
|
||||
b.Log.Debugf("Trying to download %s with extension %s and type %s", filename, fileExt, message.Type)
|
||||
|
||||
data, err := message.Download()
|
||||
if err != nil {
|
||||
b.Log.Errorf("Download document message failed: %s", err)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// Move file to bridge storage
|
||||
helper.HandleDownloadData(b.Log, &rmsg, filename, "document", "", &data, b.General)
|
||||
|
||||
b.Log.Debugf("<= Sending message from %s on %s to gateway", senderJID, b.Account)
|
||||
b.Log.Debugf("<= Message is %#v", rmsg)
|
||||
|
||||
b.Remote <- rmsg
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
@@ -157,9 +158,14 @@ func (b *Bxmpp) postSlackCompatibleWebhook(msg config.Message) error {
|
||||
return err
|
||||
}
|
||||
|
||||
resp, err := http.Post(b.GetString("WebhookURL")+"/"+msg.Channel, "application/json", bytes.NewReader(webhookBody))
|
||||
resp, err := http.Post(b.GetString("WebhookURL")+"/"+url.QueryEscape(msg.Channel), "application/json", bytes.NewReader(webhookBody))
|
||||
if err != nil {
|
||||
b.Log.Errorf("Failed to POST webhook: %s", err)
|
||||
return err
|
||||
}
|
||||
|
||||
resp.Body.Close()
|
||||
return err
|
||||
return nil
|
||||
}
|
||||
|
||||
func (b *Bxmpp) createXMPP() error {
|
||||
|
||||
1289
changelog.md
11
gateway/bridgemap/bvk.go
Normal file
@@ -0,0 +1,11 @@
|
||||
// +build !novk
|
||||
|
||||
package bridgemap
|
||||
|
||||
import (
|
||||
bvk "github.com/42wim/matterbridge/bridge/vk"
|
||||
)
|
||||
|
||||
func init() {
|
||||
FullMap["vk"] = bvk.New
|
||||
}
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
"github.com/d5/tengo/v2"
|
||||
"github.com/d5/tengo/v2/stdlib"
|
||||
lru "github.com/hashicorp/golang-lru"
|
||||
"github.com/matterbridge/emoji"
|
||||
"github.com/kyokomi/emoji/v2"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
@@ -127,7 +127,7 @@ func (gw *Gateway) AddConfig(cfg *config.Gateway) error {
|
||||
gw.logger.Errorf("mapChannels() failed: %s", err)
|
||||
}
|
||||
for _, br := range append(gw.MyConfig.In, append(gw.MyConfig.InOut, gw.MyConfig.Out...)...) {
|
||||
br := br //scopelint
|
||||
br := br // scopelint
|
||||
err := gw.AddBridge(&br)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -386,6 +386,7 @@ func (gw *Gateway) modifyMessage(msg *config.Message) {
|
||||
}
|
||||
|
||||
// replace :emoji: to unicode
|
||||
emoji.ReplacePadding = ""
|
||||
msg.Text = emoji.Sprint(msg.Text)
|
||||
|
||||
br := gw.Bridges[msg.Account]
|
||||
@@ -496,7 +497,7 @@ func (gw *Gateway) SendMessage(
|
||||
if mID != "" {
|
||||
gw.logger.Debugf("mID %s: %s", dest.Account, mID)
|
||||
return mID, nil
|
||||
//brMsgIDs = append(brMsgIDs, &BrMsgID{dest, dest.Protocol + " " + mID, channel.ID})
|
||||
// brMsgIDs = append(brMsgIDs, &BrMsgID{dest, dest.Protocol + " " + mID, channel.ID})
|
||||
}
|
||||
return "", nil
|
||||
}
|
||||
|
||||
52
go.mod
@@ -3,62 +3,58 @@ module github.com/42wim/matterbridge
|
||||
require (
|
||||
github.com/42wim/go-gitter v0.0.0-20170828205020-017310c2d557
|
||||
github.com/Baozisoftware/qrcode-terminal-go v0.0.0-20170407111555-c0650d8dff0f
|
||||
github.com/Jeffail/gabs v1.4.0 // indirect
|
||||
github.com/Philipp15b/go-steam v1.0.1-0.20200727090957-6ae9b3c0a560
|
||||
github.com/Rhymen/go-whatsapp v0.1.2-0.20201226125722-8029c28f5c5a
|
||||
github.com/RocketChat/Rocket.Chat.Go.SDK v0.0.0-20200922220614-e4a51dfb52e4 // indirect
|
||||
github.com/d5/tengo/v2 v2.6.2
|
||||
github.com/Rhymen/go-whatsapp v0.1.2-0.20210615184944-2b8a3e9b8aa2
|
||||
github.com/SevereCloud/vksdk/v2 v2.10.0
|
||||
github.com/d5/tengo/v2 v2.7.0
|
||||
github.com/davecgh/go-spew v1.1.1
|
||||
github.com/fsnotify/fsnotify v1.4.9
|
||||
github.com/go-telegram-bot-api/telegram-bot-api v1.0.1-0.20200524105306-7434b0456e81
|
||||
github.com/gomarkdown/markdown v0.0.0-20201113031856-722100d81a8e
|
||||
github.com/google/gops v0.3.14
|
||||
github.com/gomarkdown/markdown v0.0.0-20210514010506-3b9f47219fe7
|
||||
github.com/google/gops v0.3.18
|
||||
github.com/gopackage/ddp v0.0.0-20170117053602-652027933df4 // indirect
|
||||
github.com/gorilla/schema v1.2.0
|
||||
github.com/gorilla/websocket v1.4.2
|
||||
github.com/hashicorp/golang-lru v0.5.4
|
||||
github.com/jpillora/backoff v1.0.0
|
||||
github.com/keybase/go-keybase-chat-bot v0.0.0-20200505163032-5cacf52379da
|
||||
github.com/labstack/echo/v4 v4.1.17
|
||||
github.com/lrstanley/girc v0.0.0-20190801035559-4fc93959e1a7
|
||||
github.com/matrix-org/gomatrix v0.0.0-20200827122206-7dd5e2a05bcd
|
||||
github.com/matterbridge/Rocket.Chat.Go.SDK v0.0.0-20201206215757-c1d86d75b9f8
|
||||
github.com/matterbridge/discordgo v0.22.1
|
||||
github.com/matterbridge/emoji v2.1.1-0.20191117213217-af507f6b02db+incompatible
|
||||
github.com/kyokomi/emoji/v2 v2.2.8
|
||||
github.com/labstack/echo/v4 v4.3.0
|
||||
github.com/lrstanley/girc v0.0.0-20210611213246-771323f1624b
|
||||
github.com/matrix-org/gomatrix v0.0.0-20210324163249-be2af5ef2e16
|
||||
github.com/matterbridge/Rocket.Chat.Go.SDK v0.0.0-20210403163225-761e8622445d
|
||||
github.com/matterbridge/discordgo v0.21.2-0.20210201201054-fb39a175b4f7
|
||||
github.com/matterbridge/go-xmpp v0.0.0-20200418225040-c8a3a57b4050
|
||||
github.com/matterbridge/gozulipbot v0.0.0-20200820220548-be5824faa913
|
||||
github.com/matterbridge/logrus-prefixed-formatter v0.5.3-0.20200523233437-d971309a77ba
|
||||
github.com/mattermost/mattermost-server/v5 v5.30.1
|
||||
github.com/mattn/godown v0.0.1
|
||||
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect
|
||||
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
|
||||
github.com/missdeer/golib v1.0.4
|
||||
github.com/mitchellh/mapstructure v1.3.3 // indirect
|
||||
github.com/mreiferson/go-httpclient v0.0.0-20160630210159-31f0106b4474 // indirect
|
||||
github.com/mreiferson/go-httpclient v0.0.0-20201222173833-5e475fde3a4d // indirect
|
||||
github.com/mrexodia/wray v0.0.0-20160318003008-78a2c1f284ff // indirect
|
||||
github.com/nelsonken/gomf v0.0.0-20180504123937-a9dd2f9deae9
|
||||
github.com/paulrosania/go-charset v0.0.0-20190326053356-55c9d7a5834c
|
||||
github.com/rs/xid v1.2.1
|
||||
github.com/rs/xid v1.3.0
|
||||
github.com/russross/blackfriday v1.6.0
|
||||
github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca
|
||||
github.com/shazow/ssh-chat v1.10.1
|
||||
github.com/sirupsen/logrus v1.7.0
|
||||
github.com/sirupsen/logrus v1.8.1
|
||||
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e // indirect
|
||||
github.com/slack-go/slack v0.7.4
|
||||
github.com/spf13/afero v1.3.4 // indirect
|
||||
github.com/spf13/cast v1.3.1 // indirect
|
||||
github.com/spf13/jwalterweatherman v1.1.0 // indirect
|
||||
github.com/spf13/viper v1.7.1
|
||||
github.com/stretchr/testify v1.6.1
|
||||
github.com/slack-go/slack v0.9.1
|
||||
github.com/spf13/viper v1.8.0
|
||||
github.com/stretchr/testify v1.7.0
|
||||
github.com/vincent-petithory/dataurl v0.0.0-20191104211930-d1553a71de50
|
||||
github.com/writeas/go-strip-markdown v2.0.1+incompatible
|
||||
github.com/x-cray/logrus-prefixed-formatter v0.5.2 // indirect
|
||||
github.com/yaegashi/msgraph.go v0.1.4
|
||||
github.com/zfjagann/golang-ring v0.0.0-20190304061218-d34796e0a6c2
|
||||
golang.org/x/image v0.0.0-20201208152932-35266b937fa6
|
||||
golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5
|
||||
gomod.garykim.dev/nc-talk v0.1.7
|
||||
github.com/zfjagann/golang-ring v0.0.0-20210116075443-7c86fdb43134
|
||||
golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9
|
||||
golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1
|
||||
gomod.garykim.dev/nc-talk v0.2.2
|
||||
gopkg.in/olahol/melody.v1 v1.0.0-20170518105555-d52139073376
|
||||
layeh.com/gumble v0.0.0-20200818122324-146f9205029b
|
||||
)
|
||||
|
||||
replace github.com/Rhymen/go-whatsapp => github.com/tulir/go-whatsapp v0.3.16
|
||||
|
||||
go 1.15
|
||||
|
||||
330
go.sum
@@ -16,6 +16,11 @@ cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKV
|
||||
cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs=
|
||||
cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc=
|
||||
cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY=
|
||||
cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI=
|
||||
cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk=
|
||||
cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg=
|
||||
cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8=
|
||||
cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0=
|
||||
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
|
||||
cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
|
||||
cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
|
||||
@@ -76,14 +81,15 @@ github.com/Philipp15b/go-steam v1.0.1-0.20200727090957-6ae9b3c0a560 h1:ItnC9PEEM
|
||||
github.com/Philipp15b/go-steam v1.0.1-0.20200727090957-6ae9b3c0a560/go.mod h1:o38AwUFFS4gzbjSoyIgrZ1h9UeDrKwcci1Pj6baifvI=
|
||||
github.com/PuerkitoBio/goquery v1.4.1/go.mod h1:T9ezsOHcCrDCgA8aF1Cqr3sSYbO/xgdy8/R/XiIMAhA=
|
||||
github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc=
|
||||
github.com/Rhymen/go-whatsapp v0.1.2-0.20210615184944-2b8a3e9b8aa2 h1:xEhWgQl3hCOtFph6nWpTjVgAdPmAk0zUTENPDb3HJ7Y=
|
||||
github.com/Rhymen/go-whatsapp v0.1.2-0.20210615184944-2b8a3e9b8aa2/go.mod h1:DNSFRLFDFIqm2+0aJzSOVfn25020vldM4SRqz6YtLgI=
|
||||
github.com/RoaringBitmap/roaring v0.4.23/go.mod h1:D0gp8kJQgE1A4LQ5wFLggQEyvDi06Mq5mKs52e1TwOo=
|
||||
github.com/RoaringBitmap/roaring v0.5.1/go.mod h1:D0gp8kJQgE1A4LQ5wFLggQEyvDi06Mq5mKs52e1TwOo=
|
||||
github.com/RocketChat/Rocket.Chat.Go.SDK v0.0.0-20200922220614-e4a51dfb52e4 h1:u7UvmSK6McEMXFZB310/YZ6uvfDaSFrSoqWoy/qaOW0=
|
||||
github.com/RocketChat/Rocket.Chat.Go.SDK v0.0.0-20200922220614-e4a51dfb52e4/go.mod h1:wVff6N8s2foRPCYeynerOM/FF44uyI60/HMiboL0SXw=
|
||||
github.com/SevereCloud/vksdk/v2 v2.10.0 h1:HFTKrRmWaPuRn46PtWjHFlJNElyWrNP3+J2b4j9ztpY=
|
||||
github.com/SevereCloud/vksdk/v2 v2.10.0/go.mod h1:jCicWsIOXu4bfbGGuvVw4dM/EbrC8dOyA+0ccvhiFEo=
|
||||
github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0=
|
||||
github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
|
||||
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
|
||||
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d h1:G0m3OIz70MZUWq3EgK3CesDbo8upS2Vm9/P3FtgI+Jk=
|
||||
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
|
||||
github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g=
|
||||
github.com/advancedlogic/GoOse v0.0.0-20191112112754-e742535969c1/go.mod h1:f3HCSN1fBWjcpGtXyM119MJgeQl838v6so/PQOqvE1w=
|
||||
@@ -95,13 +101,13 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy
|
||||
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
|
||||
github.com/alexcesaro/log v0.0.0-20150915221235-61e686294e58 h1:MkpmYfld/S8kXqTYI68DfL8/hHXjHogL120Dy00TIxc=
|
||||
github.com/alexcesaro/log v0.0.0-20150915221235-61e686294e58/go.mod h1:YNfsMyWSs+h+PaYkxGeMVmVCX75Zj/pqdjbu12ciCYE=
|
||||
github.com/andybalholm/brotli v1.0.0/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y=
|
||||
github.com/andybalholm/cascadia v1.0.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y=
|
||||
github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y=
|
||||
github.com/andybalholm/cascadia v1.2.0/go.mod h1:YCyR8vOZT9aZ1CHEd8ap0gMVm2aFgxBp0T0eFw1RUQY=
|
||||
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
|
||||
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
|
||||
github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
|
||||
github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
|
||||
github.com/araddon/dateparse v0.0.0-20180729174819-cfd92a431d0e/go.mod h1:SLqhdZcd+dF3TEVL2RMoob5bBP5R1P1qkox+HtCBgGI=
|
||||
@@ -124,7 +130,7 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24
|
||||
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
|
||||
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
||||
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
|
||||
github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84=
|
||||
github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM=
|
||||
github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ=
|
||||
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
|
||||
github.com/blevesearch/bleve v1.0.12/go.mod h1:G0ErXWdIrUSYZLPoMpS9Z3saTnTsk4ebhPsVv/+0nxk=
|
||||
@@ -155,19 +161,21 @@ github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp
|
||||
github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE=
|
||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
|
||||
github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
|
||||
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
|
||||
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
|
||||
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
|
||||
github.com/codegangsta/cli v1.20.0/go.mod h1:/qJNoX69yVSKu5o4jLyXAENLRyk1uhi7zkbQ3slBdOA=
|
||||
github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM=
|
||||
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
|
||||
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
|
||||
github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
|
||||
github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=
|
||||
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
|
||||
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
|
||||
github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
||||
github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
||||
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
||||
github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
|
||||
github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
|
||||
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
|
||||
github.com/corpix/uarand v0.1.1/go.mod h1:SFKZvkcRoLqVRFZ4u25xPmp6m9ktANfbpXZ7SJ0/FNU=
|
||||
@@ -182,8 +190,8 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3
|
||||
github.com/cznic/b v0.0.0-20181122101859-a26611c4d92d/go.mod h1:URriBxXwVq5ijiJ12C7iIZqlA69nTlI+LgI6/pwftG8=
|
||||
github.com/cznic/mathutil v0.0.0-20181122101859-297441e03548/go.mod h1:e6NPNENfs9mPDVNRekM7lKScauxd5kXTr1Mfyig6TDM=
|
||||
github.com/cznic/strutil v0.0.0-20181122101858-275e90344537/go.mod h1:AHHPPPXTw0h6pVabbcbyGRK1DckRn7r/STdZEeIDzZc=
|
||||
github.com/d5/tengo/v2 v2.6.2 h1:AnPhA/Y5qrNLb5QSWHU9uXq25T3QTTdd2waTgsAHMdc=
|
||||
github.com/d5/tengo/v2 v2.6.2/go.mod h1:XRGjEs5I9jYIKTxly6HCF8oiiilk5E/RYXOZ5b0DZC8=
|
||||
github.com/d5/tengo/v2 v2.7.0 h1:oAGQ+gcas0/T0bdqvNxfKzjOJhpQRwceWIF5gldB3aM=
|
||||
github.com/d5/tengo/v2 v2.7.0/go.mod h1:XRGjEs5I9jYIKTxly6HCF8oiiilk5E/RYXOZ5b0DZC8=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
@@ -215,6 +223,9 @@ github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4s
|
||||
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
|
||||
github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po=
|
||||
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
|
||||
github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
|
||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||
github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw=
|
||||
github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64=
|
||||
@@ -264,7 +275,6 @@ github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9
|
||||
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
|
||||
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
|
||||
github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8=
|
||||
github.com/go-ole/go-ole v1.2.4 h1:nNBDSCOigTSiarFpYE9J/KtEA1IOW4CNeqT9TQDqCxI=
|
||||
github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM=
|
||||
github.com/go-redis/redis/v8 v8.0.0/go.mod h1:isLoQT/NFSP7V67lyvM9GmdvLdyZ7pEhsXvvyQtnQTo=
|
||||
github.com/go-resty/resty/v2 v2.0.0/go.mod h1:dZGr0i9PLlaaTD4H/hoZIDjQ+r6xq8mgbRzHZf7f2J8=
|
||||
@@ -279,10 +289,12 @@ github.com/go-test/deep v1.0.4/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3a
|
||||
github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo=
|
||||
github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw=
|
||||
github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM=
|
||||
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||
github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
|
||||
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
|
||||
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
||||
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
@@ -298,9 +310,9 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt
|
||||
github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
|
||||
github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
|
||||
github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
|
||||
github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
|
||||
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
|
||||
github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
|
||||
@@ -311,13 +323,17 @@ github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrU
|
||||
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
|
||||
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
|
||||
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
|
||||
github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=
|
||||
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||
github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM=
|
||||
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
|
||||
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/golang/snappy v0.0.2/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/gomarkdown/markdown v0.0.0-20201113031856-722100d81a8e h1:/Y3B7hM9H3TOWPhe8eWGBGS4r09pjvS5Z0uoPADyjmU=
|
||||
github.com/gomarkdown/markdown v0.0.0-20201113031856-722100d81a8e/go.mod h1:aii0r/K0ZnHv7G0KF7xy1v0A7s2Ljrb5byB7MO5p6TU=
|
||||
github.com/gomarkdown/markdown v0.0.0-20210514010506-3b9f47219fe7 h1:oKYOfNR7Hp6XpZ4JqolL5u642Js5Z0n7psPVl+S5heo=
|
||||
github.com/gomarkdown/markdown v0.0.0-20210514010506-3b9f47219fe7/go.mod h1:aii0r/K0ZnHv7G0KF7xy1v0A7s2Ljrb5byB7MO5p6TU=
|
||||
github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4=
|
||||
github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4=
|
||||
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
@@ -325,21 +341,23 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ
|
||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
|
||||
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k=
|
||||
github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM=
|
||||
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
|
||||
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/gops v0.3.14 h1:4Gpv4sABlEsVqrtKxiSynzD0//kzjTIUwUm5UgkGILI=
|
||||
github.com/google/gops v0.3.14/go.mod h1:zjT9F4XsKzazOvdVad3+Zwga79UHKziX3r9TN05rVN8=
|
||||
github.com/google/gops v0.3.18 h1:my259V+172PVFmduS2RAsq4FKH+HjKqdh7pLr17Ot8c=
|
||||
github.com/google/gops v0.3.18/go.mod h1:Pfp8hWGIFdV/7rY9/O/U5WgdjYQXf/GiEK4NVuVd2ZE=
|
||||
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
||||
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
|
||||
github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
|
||||
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||
github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
@@ -347,9 +365,12 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf
|
||||
github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||
github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||
github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||
github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
||||
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
|
||||
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y=
|
||||
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
@@ -359,9 +380,7 @@ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+
|
||||
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
|
||||
github.com/gopackage/ddp v0.0.0-20170117053602-652027933df4 h1:4EZlYQIiyecYJlUbVkFXCXHz1QPhVXcHnQKAzBTPfQo=
|
||||
github.com/gopackage/ddp v0.0.0-20170117053602-652027933df4/go.mod h1:lEO7XoHJ/xNRBCxrn4h/CEB67h0kW1B0t4ooP2yrjUA=
|
||||
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
|
||||
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
||||
github.com/gopherjs/gopherjs v0.0.0-20190910122728-9d188e94fb99 h1:twflg0XRTjwKpxb/jFExr4HGq6on2dEOmnL6FV+fgPw=
|
||||
github.com/gopherjs/gopherjs v0.0.0-20190910122728-9d188e94fb99/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
||||
github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00 h1:l5lAOZEym3oK3SQ2HBHWsJUfbNBiTXJDeW2QDxw9AQ0=
|
||||
github.com/gopherjs/gopherjs v0.0.0-20200217142428-fce0ec30dd00/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
||||
@@ -374,6 +393,7 @@ github.com/gorilla/schema v1.2.0 h1:YufUaxZYCKGFuAq3c96BOhjgd5nmXiOY9NGzF247Tsc=
|
||||
github.com/gorilla/schema v1.2.0/go.mod h1:kgLaKoK1FELgZqMAVxx/5cbj0kT+57qxUrAlIO2eleU=
|
||||
github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
|
||||
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
|
||||
github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
|
||||
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
|
||||
@@ -387,13 +407,13 @@ github.com/grpc-ecosystem/grpc-gateway v1.6.2/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpg
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
|
||||
github.com/h2non/go-is-svg v0.0.0-20160927212452-35e8c4b0612c/go.mod h1:ObS/W+h8RYb1Y7fYivughjxojTmIu5iAIjSrSLCLeqE=
|
||||
github.com/hako/durafmt v0.0.0-20200710122514-c0fb7b4da026/go.mod h1:5Scbynm8dF1XAPwIwkGPqzkM/shndPm79Jd1003hTjE=
|
||||
github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q=
|
||||
github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE=
|
||||
github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
|
||||
github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8=
|
||||
github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA=
|
||||
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
|
||||
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
@@ -432,10 +452,10 @@ github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/J
|
||||
github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM=
|
||||
github.com/hashicorp/yamux v0.0.0-20200609203250-aecfd211c9ce/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM=
|
||||
github.com/howeyc/gopass v0.0.0-20190910152052-7cb4b85ec19c/go.mod h1:lADxMC39cJJqL93Duh1xhAs4I2Zs8mKS89XWXFGp9cs=
|
||||
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg=
|
||||
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
||||
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
||||
github.com/icrowley/fake v0.0.0-20180203215853-4178557ae428/go.mod h1:uhpZMVGznybq1itEKXj6RYw9I71qK4kH+OGMjRC4KEo=
|
||||
github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA=
|
||||
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
|
||||
@@ -466,6 +486,7 @@ github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u
|
||||
github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||
github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||
github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
|
||||
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
|
||||
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
|
||||
@@ -482,9 +503,9 @@ github.com/kataras/neffos v0.0.10/go.mod h1:ZYmJC07hQPW67eKuzlfY7SO3bC0mw83A3j6i
|
||||
github.com/kataras/pio v0.0.0-20190103105442-ea782b38602d/go.mod h1:NV88laa9UiiDuX9AhMbDPkGYSPugBOV6yTZB1l2K9Z0=
|
||||
github.com/keybase/go-keybase-chat-bot v0.0.0-20200505163032-5cacf52379da h1:LK+8uBG3kNikj664cjFt88RBmuGmonxkXv2rUVfbqz4=
|
||||
github.com/keybase/go-keybase-chat-bot v0.0.0-20200505163032-5cacf52379da/go.mod h1:xJA+X9ZVyT/irGldcb7q1XnJBq5F9s5H9h2L44Y+poY=
|
||||
github.com/keybase/go-ps v0.0.0-20190827175125-91aafc93ba19 h1:WjT3fLi9n8YWh/Ih8Q1LHAPsTqGddPcHqscN+PJ3i68=
|
||||
github.com/keybase/go-ps v0.0.0-20190827175125-91aafc93ba19/go.mod h1:hY+WOq6m2FpbvyrI93sMaypsttvaIL5nhVR92dTMUcQ=
|
||||
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
|
||||
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
|
||||
github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
|
||||
@@ -501,19 +522,19 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
|
||||
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
|
||||
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs=
|
||||
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/kyokomi/emoji/v2 v2.2.8 h1:jcofPxjHWEkJtkIbcLHvZhxKgCPl6C7MyjTrD4KDqUE=
|
||||
github.com/kyokomi/emoji/v2 v2.2.8/go.mod h1:JUcn42DTdsXJo1SWanHh4HKDEyPaR5CqkmoirZZP9qE=
|
||||
github.com/labstack/echo/v4 v4.1.11/go.mod h1:i541M3Fj6f76NZtHSj7TXnyM8n2gaodfvfxNnFqi74g=
|
||||
github.com/labstack/echo/v4 v4.1.17 h1:PQIBaRplyRy3OjwILGkPg89JRtH2x5bssi59G2EL3fo=
|
||||
github.com/labstack/echo/v4 v4.1.17/go.mod h1:Tn2yRQL/UclUalpb5rPdXDevbkJ+lp/2svdyFBg6CHQ=
|
||||
github.com/labstack/echo/v4 v4.3.0 h1:DCP6cbtT+Zu++K6evHOJzSgA2115cPMuCx0xg55q1EQ=
|
||||
github.com/labstack/echo/v4 v4.3.0/go.mod h1:PvmtTvhVqKDzDQy4d3bWzPjZLzom4iQbAZy2sgZ/qI8=
|
||||
github.com/labstack/gommon v0.3.0 h1:JEeO0bvc78PKdyHxloTKiF8BD5iGrH8T6MSeGvSgob0=
|
||||
github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k=
|
||||
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o=
|
||||
@@ -525,24 +546,22 @@ github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||
github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||
github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM=
|
||||
github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4=
|
||||
github.com/lrstanley/girc v0.0.0-20190801035559-4fc93959e1a7 h1:BS9tqL0OCiOGuy/CYYk2gc33fxqaqh5/rhqMKu4tcYA=
|
||||
github.com/lrstanley/girc v0.0.0-20190801035559-4fc93959e1a7/go.mod h1:liX5MxHPrwgHaKowoLkYGwbXfYABh1jbZ6FpElbGF1I=
|
||||
github.com/lrstanley/girc v0.0.0-20210611213246-771323f1624b h1:jrLvME7VuLW6NRysbiZtenTB9QcNlR9RPKK4LFfZn60=
|
||||
github.com/lrstanley/girc v0.0.0-20210611213246-771323f1624b/go.mod h1:liX5MxHPrwgHaKowoLkYGwbXfYABh1jbZ6FpElbGF1I=
|
||||
github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI=
|
||||
github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ=
|
||||
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
|
||||
github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4=
|
||||
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
|
||||
github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls=
|
||||
github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
|
||||
github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
||||
github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
|
||||
github.com/marstr/guid v0.0.0-20170427235115-8bdf7d1a087c/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho=
|
||||
github.com/matrix-org/gomatrix v0.0.0-20200827122206-7dd5e2a05bcd h1:xVrqJK3xHREMNjwjljkAUaadalWc0rRbmVuQatzmgwg=
|
||||
github.com/matrix-org/gomatrix v0.0.0-20200827122206-7dd5e2a05bcd/go.mod h1:/gBX06Kw0exX1HrwmoBibFA98yBk/jxKpGVeyQbff+s=
|
||||
github.com/matterbridge/Rocket.Chat.Go.SDK v0.0.0-20201206215757-c1d86d75b9f8 h1:2iHni9FGPRRnaZrknLp+Kyr1CWbRIRUjp89TNpkqy3I=
|
||||
github.com/matterbridge/Rocket.Chat.Go.SDK v0.0.0-20201206215757-c1d86d75b9f8/go.mod h1:c6MxwqHD+0HvtAJjsHMIdPCiAwGiQwPRPTp69ACMg8A=
|
||||
github.com/matterbridge/discordgo v0.22.1 h1:Wh2NXfvF4egJDxX7jEvtgxJgT/ZOqD/5tfcIsNnHJ9o=
|
||||
github.com/matterbridge/discordgo v0.22.1/go.mod h1:411nZYv0UMMrtppR5glXop1foboJiFAowy+42U+Ahvw=
|
||||
github.com/matterbridge/emoji v2.1.1-0.20191117213217-af507f6b02db+incompatible h1:oaOqwbg5HxHRxvAbd84ks0Okwoc1ISyUZ87EiVJFhGI=
|
||||
github.com/matterbridge/emoji v2.1.1-0.20191117213217-af507f6b02db+incompatible/go.mod h1:igE6rUAn3jai2wCdsjFHfhUoekjrFthoEjFObKKwSb4=
|
||||
github.com/matrix-org/gomatrix v0.0.0-20210324163249-be2af5ef2e16 h1:ZtO5uywdd5dLDCud4r0r55eP4j9FuUNpl60Gmntcop4=
|
||||
github.com/matrix-org/gomatrix v0.0.0-20210324163249-be2af5ef2e16/go.mod h1:/gBX06Kw0exX1HrwmoBibFA98yBk/jxKpGVeyQbff+s=
|
||||
github.com/matterbridge/Rocket.Chat.Go.SDK v0.0.0-20210403163225-761e8622445d h1:Csy27nDj00vRGp2+QvwSanaW0RA60SZUHXCk4BBT0AU=
|
||||
github.com/matterbridge/Rocket.Chat.Go.SDK v0.0.0-20210403163225-761e8622445d/go.mod h1:c6MxwqHD+0HvtAJjsHMIdPCiAwGiQwPRPTp69ACMg8A=
|
||||
github.com/matterbridge/discordgo v0.21.2-0.20210201201054-fb39a175b4f7 h1:4J2YZuY8dIYrxbLMsWGqPZb/B59ygCwSBkyZHez5PSY=
|
||||
github.com/matterbridge/discordgo v0.21.2-0.20210201201054-fb39a175b4f7/go.mod h1:411nZYv0UMMrtppR5glXop1foboJiFAowy+42U+Ahvw=
|
||||
github.com/matterbridge/go-xmpp v0.0.0-20200418225040-c8a3a57b4050 h1:kWkP1lXpkvtoNL08jkP3XQH/zvDOEXJpdCJd/DlIvMw=
|
||||
github.com/matterbridge/go-xmpp v0.0.0-20200418225040-c8a3a57b4050/go.mod h1:ECDRehsR9TYTKCAsRS8/wLeOk6UUqDydw47ln7wG41Q=
|
||||
github.com/matterbridge/gozulipbot v0.0.0-20200820220548-be5824faa913 h1:5UGr9fLsvAvhjP6i5XJmd0ZIwYVR2gZCzU1lJZ7wfLY=
|
||||
@@ -563,8 +582,6 @@ github.com/mattermost/rsc v0.0.0-20160330161541-bbaefb05eaa0/go.mod h1:nV5bfVpT/
|
||||
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
|
||||
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
||||
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
||||
github.com/mattn/go-colorable v0.1.7 h1:bQGKb3vps/j0E9GfJQ03JyhRuxsvdAanXlT9BTw3mdw=
|
||||
github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8=
|
||||
github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
||||
@@ -579,7 +596,6 @@ github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Ky
|
||||
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
|
||||
github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
|
||||
github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
|
||||
github.com/mattn/go-runewidth v0.0.8 h1:3tS41NlGYSmhhe/8fhGRzc+z3AYCw1Fe1WAyLuujKs0=
|
||||
github.com/mattn/go-runewidth v0.0.8/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
|
||||
github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
|
||||
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
|
||||
@@ -591,8 +607,8 @@ github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpe
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
|
||||
github.com/mediocregopher/mediocre-go-lib v0.0.0-20181029021733-cb65787f37ed/go.mod h1:dSsfyI2zABAdhcbvkXqgxOxrCsbYeHCPgrZkku60dSg=
|
||||
github.com/mediocregopher/radix/v3 v3.3.0/go.mod h1:EmfVyvspXz1uZEyPBMyGK+kjWiKQGvsUt6O3Pj+LDCQ=
|
||||
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4=
|
||||
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
|
||||
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI=
|
||||
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
|
||||
github.com/mholt/archiver/v3 v3.4.0/go.mod h1:00RcBMhNszoMqnda/5VHHL9+cBoTgj+AkLnmwr3HGrA=
|
||||
github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4=
|
||||
github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc=
|
||||
@@ -615,10 +631,9 @@ github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUb
|
||||
github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg=
|
||||
github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY=
|
||||
github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||
github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=
|
||||
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||
github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8=
|
||||
github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
||||
github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag=
|
||||
github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||
@@ -626,8 +641,8 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb
|
||||
github.com/monaco-io/request v1.0.5 h1:QAJb5m1pCPZUGv3zzTZn7GlQI3q+uJWi7fH9QxDGbm4=
|
||||
github.com/monaco-io/request v1.0.5/go.mod h1:EmggwHktBsbJmCgwZXqy7o0H1NNsAstQBWZrFVd3xtQ=
|
||||
github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ=
|
||||
github.com/mreiferson/go-httpclient v0.0.0-20160630210159-31f0106b4474 h1:oKIteTqeSpenyTrOVj5zkiyCaflLa8B+CD0324otT+o=
|
||||
github.com/mreiferson/go-httpclient v0.0.0-20160630210159-31f0106b4474/go.mod h1:OQA4XLvDbMgS8P0CevmM4m9Q3Jq4phKUzcocxuGJ5m8=
|
||||
github.com/mreiferson/go-httpclient v0.0.0-20201222173833-5e475fde3a4d h1:tLWCMSjfL8XyZwpu1RzI2UpJSPbZCOZ6DVHQFnlpL7A=
|
||||
github.com/mreiferson/go-httpclient v0.0.0-20201222173833-5e475fde3a4d/go.mod h1:OQA4XLvDbMgS8P0CevmM4m9Q3Jq4phKUzcocxuGJ5m8=
|
||||
github.com/mrexodia/wray v0.0.0-20160318003008-78a2c1f284ff h1:HLGD5/9UxxfEuO9DtP8gnTmNtMxbPyhYltfxsITel8g=
|
||||
github.com/mrexodia/wray v0.0.0-20160318003008-78a2c1f284ff/go.mod h1:B8jLfIIPn2sKyWr0D7cL2v7tnrDD5z291s2Zypdu89E=
|
||||
github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg=
|
||||
@@ -662,22 +677,17 @@ github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:v
|
||||
github.com/olekukonko/tablewriter v0.0.0-20180506121414-d4647c9c7a84/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
|
||||
github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA=
|
||||
github.com/olivere/elastic v6.2.35+incompatible/go.mod h1:J+q1zQJTgAz9woqsbVRqGeB5G1iqDKVBWLNSYW8yfJ8=
|
||||
github.com/onsi/ginkgo v1.6.0 h1:Ix8l273rp3QzYgXSR+c8d1fTG7UPgYkOSELPhiY/YGw=
|
||||
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs=
|
||||
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
|
||||
github.com/onsi/ginkgo v1.13.0 h1:M76yO2HkZASFjXL0HSoZJ1AYEmQxNJmY41Jx1zNUq1Y=
|
||||
github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0=
|
||||
github.com/onsi/ginkgo v1.14.1 h1:jMU0WaQrP0a/YAEq8eJmJKjBoMs+pClEr1vDMlM/Do4=
|
||||
github.com/onsi/ginkgo v1.14.1/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
|
||||
github.com/onsi/gomega v1.4.3 h1:RE1xgDvH7imwFD45h+u2SgIfERHlS2yNG4DObb5BSKU=
|
||||
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||
github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
|
||||
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
|
||||
github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE=
|
||||
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
|
||||
github.com/onsi/gomega v1.10.2 h1:aY/nuoWlKJud2J6U0E3NWsjlg+0GtwXxgEqthRdzlcs=
|
||||
github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
|
||||
@@ -702,14 +712,13 @@ github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FI
|
||||
github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
|
||||
github.com/paulrosania/go-charset v0.0.0-20190326053356-55c9d7a5834c h1:P6XGcuPTigoHf4TSu+3D/7QOQ1MbL6alNwrGhcW7sKw=
|
||||
github.com/paulrosania/go-charset v0.0.0-20190326053356-55c9d7a5834c/go.mod h1:YnNlZP7l4MhyGQ4CBRwv6ohZTPrUJJZtEv4ZgADkbs4=
|
||||
github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g=
|
||||
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
|
||||
github.com/pborman/uuid v1.2.1 h1:+ZZIw58t/ozdjRaXh/3awHfmWRbzYxJoAdNJxe/3pvw=
|
||||
github.com/pborman/uuid v1.2.1/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
|
||||
github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc=
|
||||
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
|
||||
github.com/pelletier/go-toml v1.8.1 h1:1Nf83orprkJyknT6h7zbuEGUEjcyVlCxSUGTENmNCRM=
|
||||
github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc=
|
||||
github.com/pelletier/go-toml v1.9.3 h1:zeC5b1GviRUyKYd6OJPvBU/mcVDVoL1OhT17FCt5dSQ=
|
||||
github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
|
||||
github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac=
|
||||
github.com/peterbourgon/diskv v0.0.0-20171120014656-2973218375c3/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
|
||||
github.com/philhofer/fwd v1.0.0 h1:UbZqGr5Y38ApvM/V/jEljVxwocdweyH+vmYvRPBnbqQ=
|
||||
@@ -720,7 +729,6 @@ github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi
|
||||
github.com/pierrec/lz4/v3 v3.3.2/go.mod h1:280XNCGS8jAcG++AHdd6SeWnzyJ1w9oow2vbORyey8Q=
|
||||
github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8=
|
||||
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
|
||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
@@ -771,13 +779,14 @@ github.com/rickb777/date v1.12.4/go.mod h1:xP0eo/I5qmUt97yRGClHZfyLZ3ikMw6v6SU5M
|
||||
github.com/rickb777/plural v1.2.0 h1:5tvEc7UBCZ7l8h/2UeybSkt/uu1DQsZFOFdNevmUhlE=
|
||||
github.com/rickb777/plural v1.2.0/go.mod h1:UdpyWFCGbo3mvK3f/PfZOAOrkjzJlYN/sD46XNWJ+Es=
|
||||
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
|
||||
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
|
||||
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||
github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
|
||||
github.com/rs/xid v1.2.1 h1:mhH9Nq+C1fY2l1XIpgxIiUOfNpRBYH1kKcr+qfKgjRc=
|
||||
github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
|
||||
github.com/rs/xid v1.3.0 h1:6NjYksEUlhurdVehpc7S7dk6DAmcKv8V9gG0FsVN2U4=
|
||||
github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
|
||||
github.com/rudderlabs/analytics-go v3.2.1+incompatible/go.mod h1:LF8/ty9kUX4PTY3l5c97K3nZZaX5Hwsvt+NBaRL/f30=
|
||||
github.com/russellhaering/goxmldsig v1.1.0/go.mod h1:QK8GhXPB3+AfuCrfo0oRISa9NfzeCpWmxeGnqEpDF9o=
|
||||
github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo=
|
||||
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
|
||||
github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww=
|
||||
github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY=
|
||||
@@ -798,8 +807,7 @@ github.com/shazow/rateio v0.0.0-20200113175441-4461efc8bdc4 h1:zwQ1HBo5FYwn1ksMd
|
||||
github.com/shazow/rateio v0.0.0-20200113175441-4461efc8bdc4/go.mod h1:vt2jWY/3Qw1bIzle5thrJWucsLuuX9iUNnp20CqCciI=
|
||||
github.com/shazow/ssh-chat v1.10.1 h1:ePS+ngEYqm+yUuXegDPutysqLV2WoI22XDOeRgI6CE0=
|
||||
github.com/shazow/ssh-chat v1.10.1/go.mod h1:0+7szsKylcre0vljkVnbuI6q7Odtc+QCDHxa+fFNV54=
|
||||
github.com/shirou/gopsutil v2.20.4+incompatible h1:cMT4rxS55zx9NVUnCkrmXCsEB/RNfG9SwHY9evtX8Ng=
|
||||
github.com/shirou/gopsutil v2.20.4+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
|
||||
github.com/shirou/gopsutil/v3 v3.21.2/go.mod h1:ghfMypLDrFSWN2c9cDYFLHyynQ+QUht0cv/18ZqVczw=
|
||||
github.com/shurcooL/component v0.0.0-20170202220835-f88ec8f54cc4/go.mod h1:XhFIlyj5a1fBNx5aJTbKoIq0mNaPvOagO+HjB3EtxrY=
|
||||
github.com/shurcooL/events v0.0.0-20181021180414-410e4ca65f48/go.mod h1:5u70Mqkb5O5cxEA8nxTsgrgLehJeAw6Oc4Ab1c/P1HM=
|
||||
github.com/shurcooL/github_flavored_markdown v0.0.0-20181002035957-2122de532470/go.mod h1:2dOwnU2uBioM+SGy2aZoq1f/Sd1l9OkAeAUvjSyvgU0=
|
||||
@@ -827,13 +835,13 @@ github.com/simplereach/timeutils v1.2.0/go.mod h1:VVbQDfN/FHRZa1LSqcwo4kNZ62OOyq
|
||||
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
|
||||
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
|
||||
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
|
||||
github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM=
|
||||
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
|
||||
github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
|
||||
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
|
||||
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e h1:MRM5ITcdelLK2j1vwZ3Je0FKVCfqOLp5zO6trqMLYs0=
|
||||
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e/go.mod h1:XV66xRDqSt+GTGFMVlhk3ULuV0y9ZmzeVGR4mloJI3M=
|
||||
github.com/slack-go/slack v0.7.4 h1:Z+7CmUDV+ym4lYLA4NNLFIpr3+nDgViHrx8xsuXgrYs=
|
||||
github.com/slack-go/slack v0.7.4/go.mod h1:FGqNzJBmxIsZURAxh2a8D21AnOVvvXZvGligs4npPUM=
|
||||
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
|
||||
github.com/slack-go/slack v0.9.1 h1:pekQBs0RmrdAgoqzcMCzUCWSyIkhzUU3F83ExAdZrKo=
|
||||
github.com/slack-go/slack v0.9.1/go.mod h1:wWL//kk0ho+FcQXcBTmEafUI5dz4qz5f4mMk8oIkioQ=
|
||||
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
|
||||
github.com/smartystreets/assertions v1.0.0 h1:UVQPSSmc3qtTi+zPPkCXvZX9VvW/xT/NsRvKfwY81a8=
|
||||
github.com/smartystreets/assertions v1.0.0/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM=
|
||||
@@ -845,30 +853,26 @@ github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJ
|
||||
github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE=
|
||||
github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA=
|
||||
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
||||
github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI=
|
||||
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
|
||||
github.com/spf13/afero v1.3.4 h1:8q6vk3hthlpb2SouZcnBVKboxWQWMDNF38bwholZrJc=
|
||||
github.com/spf13/afero v1.3.4/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I=
|
||||
github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8=
|
||||
github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY=
|
||||
github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I=
|
||||
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
|
||||
github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng=
|
||||
github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
|
||||
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
|
||||
github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU=
|
||||
github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE=
|
||||
github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk=
|
||||
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
|
||||
github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk=
|
||||
github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
|
||||
github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
||||
github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg=
|
||||
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||
github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
|
||||
github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE=
|
||||
github.com/spf13/viper v1.7.1 h1:pM5oEahlgWv/WnHXpgbKz7iLIxRf65tye2Ci+XFK5sk=
|
||||
github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg=
|
||||
github.com/spf13/viper v1.8.0 h1:QRwDgoG8xX+kp69di68D+YYTCWfYEckbZRfUlEIAal0=
|
||||
github.com/spf13/viper v1.8.0/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns=
|
||||
github.com/splitio/go-client/v6 v6.0.0/go.mod h1:dTs/FpMfHb01sLso64uvudHFItiAW59ypqsK2Pbhuq4=
|
||||
github.com/splitio/go-split-commons/v2 v2.0.0/go.mod h1:iJVknIQ96Ezic+5FJ4vHYdqDfOV5w7s+w2wKjwgjFB0=
|
||||
github.com/splitio/go-toolkit/v3 v3.0.0/go.mod h1:HGgawLnM2RlM84zVRbATpPMjF7H6u9CUYG6RlpwOlOk=
|
||||
@@ -879,15 +883,14 @@ github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3
|
||||
github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.3.0 h1:NGXK3lHquSN08v5vWalVI/L8XU9hdzE/G6xsrze47As=
|
||||
github.com/stretchr/objx v0.3.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
|
||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
|
||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
|
||||
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
|
||||
github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ=
|
||||
@@ -899,10 +902,10 @@ github.com/throttled/throttled v2.2.5+incompatible/go.mod h1:0BjlrEGQmvxps+HuXLs
|
||||
github.com/tinylib/msgp v1.1.0/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE=
|
||||
github.com/tinylib/msgp v1.1.2 h1:gWmO7n0Ys2RBEb7GPYB9Ujq8Mk5p2U08lRnmMcGy6BQ=
|
||||
github.com/tinylib/msgp v1.1.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE=
|
||||
github.com/tklauser/go-sysconf v0.3.4/go.mod h1:Cl2c8ZRWfHD5IrfHo9VN+FX9kCFjIOyVklgXycLB6ek=
|
||||
github.com/tklauser/numcpus v0.2.1/go.mod h1:9aU+wOc6WjUIZEwWMP62PL/41d65P+iks1gBkr4QyP8=
|
||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
|
||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
|
||||
github.com/tulir/go-whatsapp v0.3.16 h1:NfcXC2DQXwls3qkAjbFqSeoMX+rUbbpBBGGvCXI3RUw=
|
||||
github.com/tulir/go-whatsapp v0.3.16/go.mod h1:U5+sm33vrv3wz62YyRM/VS7q2ObXkxU4Xqj/3KOmN9o=
|
||||
github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM=
|
||||
github.com/tylerb/graceful v1.2.15/go.mod h1:LPYTbOYmUTdabwRt0TGhLllQ0MUNbs0Y5q1WXJOI9II=
|
||||
github.com/uber/jaeger-client-go v2.25.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=
|
||||
@@ -948,7 +951,6 @@ github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:
|
||||
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
|
||||
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos=
|
||||
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
|
||||
github.com/xlab/treeprint v1.0.0 h1:J0TkWtiuYgtdlrkkrDLISYBQ92M+X5m4LrIIMKrbDTs=
|
||||
github.com/xlab/treeprint v1.0.0/go.mod h1:IoImgRak9i3zJyuxOKUP1v4UZd1tMoKkq/Cimt1uhCg=
|
||||
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
|
||||
github.com/xtgo/uuid v0.0.0-20140804021211-a0b114877d4c/go.mod h1:UrdRz5enIKZ63MEE3IF9l2/ebyx59GyGgPi+tICQdmM=
|
||||
@@ -963,13 +965,17 @@ github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de
|
||||
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/zfjagann/golang-ring v0.0.0-20190304061218-d34796e0a6c2 h1:UQwvu7FjUEdVYofx0U6bsc5odNE7wa5TSA0fl559GcA=
|
||||
github.com/zfjagann/golang-ring v0.0.0-20190304061218-d34796e0a6c2/go.mod h1:0MsIttMJIF/8Y7x0XjonJP7K99t3sR6bjj4m5S4JmqU=
|
||||
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
||||
github.com/zfjagann/golang-ring v0.0.0-20210116075443-7c86fdb43134 h1:itYC8Ycx8aVBN7a8q1Yr187W5WmQthvYU13+f4rOWkU=
|
||||
github.com/zfjagann/golang-ring v0.0.0-20210116075443-7c86fdb43134/go.mod h1:0MsIttMJIF/8Y7x0XjonJP7K99t3sR6bjj4m5S4JmqU=
|
||||
github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0=
|
||||
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
|
||||
go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
|
||||
go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
|
||||
go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg=
|
||||
go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs=
|
||||
go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g=
|
||||
go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ=
|
||||
go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA=
|
||||
go.opencensus.io v0.19.1/go.mod h1:gug0GbSHa8Pafr0d2urOSgoXHZ6x/RUlaiT0d9pqb4A=
|
||||
go.opencensus.io v0.19.2/go.mod h1:NO/8qkisMZLZ1FCsKNqtJPwc8/TaclWyY0B6wcYNg9M=
|
||||
@@ -980,29 +986,26 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
|
||||
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
|
||||
go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
|
||||
go.opentelemetry.io/otel v0.11.0/go.mod h1:G8UCk+KooF2HLkgo8RHX9epABH/aRGYET7gQOqBVdB0=
|
||||
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
|
||||
go.uber.org/atomic v1.4.0 h1:cxzIVoETapQEqDhQu3QfnvXAV4AlzcvUCxkVUFw3+EU=
|
||||
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
|
||||
go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
|
||||
go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk=
|
||||
go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
|
||||
go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw=
|
||||
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
|
||||
go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI=
|
||||
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
|
||||
go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4=
|
||||
go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A=
|
||||
go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
|
||||
go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4=
|
||||
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
|
||||
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4=
|
||||
go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA=
|
||||
go.uber.org/zap v1.10.0 h1:ORx85nbTijNz8ljznvCMR1ZBIPKFn3jQrag10X2AsuM=
|
||||
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
|
||||
go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM=
|
||||
go.uber.org/zap v1.16.0 h1:uFRZXykJGK9lLY4HtgSw44DnIcAM+kRBP7x5m+NpAOM=
|
||||
go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ=
|
||||
go.uber.org/zap v1.17.0 h1:MTjgFu6ZLKvY6Pvaqk97GlxNBuMpV4Hy/3P6tRGlI2U=
|
||||
go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo=
|
||||
go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE=
|
||||
golang.org/dl v0.0.0-20190829154251-82a15e2f2ead/go.mod h1:IUMfjQLJQd4UTqG1Z90tenwKoCX93Gn3MAQJMOSBsDQ=
|
||||
golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d/go.mod h1:OWs+y06UdEOHN4y+MfF/py+xQ/tYqIWW03b70/CG9Rw=
|
||||
@@ -1019,15 +1022,12 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U
|
||||
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899 h1:DZhuSZLsGlFL4CmhA8BcRA0mnthyA/nZ00AqCUo7vHg=
|
||||
golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a h1:vclmkQCjlDX5OydZ9wv8rBCcS0QyQY66Mpf/7BZbInM=
|
||||
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNmw2api+jEfxLoykJVice/E=
|
||||
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 h1:It14KIkyBFYkHkwZ7k45minvA9aorojkyjGk9KJ5B/w=
|
||||
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
||||
@@ -1044,10 +1044,9 @@ golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMx
|
||||
golang.org/x/image v0.0.0-20190321063152-3fc05d484e9f/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
|
||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/image v0.0.0-20200927104501-e162460cd6b5 h1:QelT11PB4FXiDEXucrfNckHoFxwt8USGY1ajP1ZF5lM=
|
||||
golang.org/x/image v0.0.0-20200927104501-e162460cd6b5/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/image v0.0.0-20201208152932-35266b937fa6 h1:nfeHNc1nAqecKCy2FCy4HY+soOOe5sDLJ/gZLbx6GYI=
|
||||
golang.org/x/image v0.0.0-20201208152932-35266b937fa6/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9 h1:D0iM1dTCbD5Dg1CbuvLC/v/agLc79efSj/L35Q3Vqhs=
|
||||
golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
|
||||
golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20181217174547-8f45f776aaf1/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
@@ -1059,20 +1058,21 @@ golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHl
|
||||
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
|
||||
golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||
golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k=
|
||||
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
|
||||
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
|
||||
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
|
||||
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
|
||||
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||
golang.org/x/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ=
|
||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=
|
||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.3.1-0.20200828183125-ce943fd02449 h1:xUIPaMhvROX9dhPvRCenIJtU78+lbEenGbgqB5hfHCQ=
|
||||
golang.org/x/mod v0.3.1-0.20200828183125-ce943fd02449/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
@@ -1108,9 +1108,7 @@ golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLL
|
||||
golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e h1:3G+cUijn7XD+S4eJFddp53Pv7+slrESplyjG25HgL+k=
|
||||
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5 h1:WQ8q63x+f/zpC8Ac1s9wLElVoHhm32p6tudrU72n1QA=
|
||||
golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
@@ -1119,12 +1117,17 @@ golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/
|
||||
golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||
golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA=
|
||||
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||
golang.org/x/net v0.0.0-20200904194848-62affa334b73 h1:MXfv8rhZWmFeqX3GNZRsd6vOLoaCHjYEX3qkRo3YBUA=
|
||||
golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||
golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0 h1:wBouT66WTYFXdxfVdz9sVWARVd/2vfGcmI45D2gj45M=
|
||||
golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc=
|
||||
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 h1:4nGaVu0QrbjT/AK2PRLuQfQuh6DJve+pELhqTdAj3x0=
|
||||
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
@@ -1132,10 +1135,16 @@ golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4Iltr
|
||||
golang.org/x/oauth2 v0.0.0-20190319182350-c85d3e98c914/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw=
|
||||
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5 h1:Lm4OryKCca1vehdsWogr9N4t7NfZxLbJoc/H0w4K4S4=
|
||||
golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1 h1:x622Z2o4hgCr/4CiKWc51jHVKaWdtVpBNmEI8wI9Qns=
|
||||
golang.org/x/oauth2 v0.0.0-20210615190721-d04028783cf1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
@@ -1145,6 +1154,9 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ
|
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
@@ -1194,34 +1206,46 @@ golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9 h1:YTzHMGlqJu67/uEo1lBv0n3wBXhXNeUbB1XfN2vmTm0=
|
||||
golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6 h1:DvY3Zkh7KabQE/kfzMvYvKirSiguP9Q/veMtkYyf0o8=
|
||||
golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201007165808-a893ed343c85/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201110211018-35f3e6cf4a65 h1:Qo9oJ566/Sq7N4hrGftVXs8GI2CXBCuOd4S2wHE/e0M=
|
||||
golang.org/x/sys v0.0.0-20201110211018-35f3e6cf4a65/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201207223542-d4d67f95c62d h1:MiWWjyhUzZ+jvhZvloX6ZrUsdEghn8a64Upd8EMHglE=
|
||||
golang.org/x/sys v0.0.0-20201207223542-d4d67f95c62d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210217105451-b926d437f341/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210510120138-977fb7262007 h1:gG67DSER+11cZvqIMb8S8bt0vZtiN6xWYARwirrOSfE=
|
||||
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc=
|
||||
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20201208040808-7e3f01d25324 h1:Hir2P/De0WpUhtrKGGjvSb2YxUgyZ7EFOSLIcSSpiwE=
|
||||
golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
@@ -1272,24 +1296,29 @@ golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWc
|
||||
golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200529172331-a64b76657301 h1:G6CNEgFU8/XwexSnuFw+Jq/WePjRitgy6ofBcPnAIPo=
|
||||
golang.org/x/tools v0.0.0-20200529172331-a64b76657301/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||
golang.org/x/tools v0.0.0-20200731060945-b5fad4ed8dd6/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||
golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||
golang.org/x/tools v0.0.0-20200825202427-b303f430e36d h1:W07d4xkoAUSNOkOzdzXCdFGxT7o2rW4q8M34tB2i//k=
|
||||
golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||
golang.org/x/tools v0.0.0-20201008025239-9df69603baec h1:RY2OghEV/7X1MLaecgm1mwFd3sGvUddm5pGVSxQvX0c=
|
||||
golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE=
|
||||
golang.org/x/tools v0.0.0-20201008025239-9df69603baec/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU=
|
||||
golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
|
||||
golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
gomod.garykim.dev/nc-talk v0.1.7 h1:G2qsiRcyaj5FEADQlulsBAFJHs27tPmH9VtKK+at9SM=
|
||||
gomod.garykim.dev/nc-talk v0.1.7/go.mod h1:DNucAJ6zeaumBEwV5NiYk+Eea8Ca+Q5f+plhz9F7d58=
|
||||
gomod.garykim.dev/nc-talk v0.2.2 h1:+U+daJFPPuwM7yRXYazeMHZgIBSGP6SeQURO0O5a32I=
|
||||
gomod.garykim.dev/nc-talk v0.2.2/go.mod h1:q/Adot/H7iqi+H4lANopV7/xcMf+sX3AZXUXqiITwok=
|
||||
google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
|
||||
google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
|
||||
google.golang.org/api v0.0.0-20181220000619-583d854617af/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
|
||||
@@ -1312,16 +1341,22 @@ google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0M
|
||||
google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
|
||||
google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM=
|
||||
google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc=
|
||||
google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg=
|
||||
google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE=
|
||||
google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8=
|
||||
google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU=
|
||||
google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94=
|
||||
google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8=
|
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.6.1 h1:QzqyMA1tlu6CgqCDUtU9V+ZKhLFT2dkJuANu5QaxI3I=
|
||||
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
|
||||
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||
google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc=
|
||||
google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
|
||||
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||
google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
@@ -1353,13 +1388,25 @@ google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfG
|
||||
google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U=
|
||||
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
|
||||
google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
|
||||
google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20201007142714-5c0e72c5e71e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A=
|
||||
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
|
||||
google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
|
||||
google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
|
||||
google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio=
|
||||
@@ -1381,36 +1428,41 @@ google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKa
|
||||
google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
|
||||
google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||
google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||
google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||
google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||
google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
|
||||
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
|
||||
google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8=
|
||||
google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
|
||||
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
|
||||
google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
|
||||
google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
|
||||
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
|
||||
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM=
|
||||
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
|
||||
google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c=
|
||||
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
|
||||
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
|
||||
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
|
||||
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
|
||||
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||
gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o=
|
||||
gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE=
|
||||
gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y=
|
||||
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
|
||||
gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno=
|
||||
gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||
gopkg.in/ini.v1 v1.57.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||
gopkg.in/ini.v1 v1.62.0 h1:duBzk771uxoUuOlyRLkHsygud9+5lrlGjdFBb4mSKDU=
|
||||
gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||
@@ -1429,16 +1481,17 @@ gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRN
|
||||
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
|
||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
|
||||
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
|
||||
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
|
||||
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o=
|
||||
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20180920025451-e3ad64cb4ed3/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
@@ -1447,15 +1500,12 @@ honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWh
|
||||
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
|
||||
honnef.co/go/tools v0.0.1-2020.1.3 h1:sXmLre5bzIR6ypkjXCDI3jHPssRhc8KD/Ome589sc3U=
|
||||
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
||||
honnef.co/go/tools v0.0.1-2020.1.4 h1:UoveltGrhghAA7ePc+e+QYDHXrBps2PqFZiHkGR/xK8=
|
||||
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
||||
layeh.com/gopus v0.0.0-20161224163843-0ebf989153aa/go.mod h1:AOef7vHz0+v4sWwJnr0jSyHiX/1NgsMoaxl+rEPz/I0=
|
||||
layeh.com/gumble v0.0.0-20200818122324-146f9205029b h1:Kne6wkHqbqrygRsqs5XUNhSs84DFG5TYMeCkCbM56sY=
|
||||
layeh.com/gumble v0.0.0-20200818122324-146f9205029b/go.mod h1:tWPVA9ZAfImNwabjcd9uDE+Mtz0Hfs7a7G3vxrnrwyc=
|
||||
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
||||
rsc.io/goversion v1.2.0 h1:SPn+NLTiAG7w30IRK/DKp1BjvpWabYgxlLp/+kx5J8w=
|
||||
rsc.io/goversion v1.2.0/go.mod h1:Eih9y/uIBS3ulggl7KNJ09xGSLcuNaLgmvvqa07sgfo=
|
||||
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
|
||||
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
|
||||
|
||||
|
Before Width: | Height: | Size: 270 KiB |
|
Before Width: | Height: | Size: 170 KiB |
|
Before Width: | Height: | Size: 282 KiB |
|
Before Width: | Height: | Size: 204 KiB |
|
Before Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 73 KiB |
|
Before Width: | Height: | Size: 62 KiB |
@@ -16,7 +16,7 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
version = "1.21.1-dev"
|
||||
version = "1.22.3"
|
||||
githash string
|
||||
|
||||
flagConfig = flag.String("conf", "matterbridge.toml", "config file")
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
[irc]
|
||||
|
||||
#You can configure multiple servers "[irc.name]" or "[irc.name2]"
|
||||
#In this example we use [irc.freenode]
|
||||
#In this example we use [irc.libera]
|
||||
#REQUIRED
|
||||
[irc.freenode]
|
||||
[irc.libera]
|
||||
#irc server to connect to.
|
||||
#REQUIRED
|
||||
Server="irc.freenode.net:6667"
|
||||
Server="irc.libera.chat:6667"
|
||||
|
||||
#Password for irc server (if necessary)
|
||||
#OPTIONAL (default "")
|
||||
@@ -24,7 +24,7 @@ Password=""
|
||||
#OPTIONAL (default false)
|
||||
UseTLS=false
|
||||
|
||||
#Enable SASL (PLAIN) authentication. (freenode requires this from eg AWS hosts)
|
||||
#Enable SASL (PLAIN) authentication. (libera requires this from eg AWS hosts)
|
||||
#It uses NickServNick and NickServPassword as login and password
|
||||
#OPTIONAL (default false)
|
||||
UseSASL=false
|
||||
@@ -55,7 +55,7 @@ Charset=""
|
||||
#REQUIRED
|
||||
Nick="matterbot"
|
||||
|
||||
#If you registered your bot with a service like Nickserv on freenode.
|
||||
#If you registered your bot with a service like Nickserv on libera.
|
||||
#Also being used when UseSASL=true
|
||||
#
|
||||
#Note: if you want do to quakenet auth, set NickServNick="Q@CServe.quakenet.org"
|
||||
@@ -76,20 +76,24 @@ MessageDelay=1300
|
||||
|
||||
#Maximum amount of messages to hold in queue. If queue is full
|
||||
#messages will be dropped.
|
||||
#<message clipped> will be add to the message that fills the queue.
|
||||
#<clipped message> will be add to the message that fills the queue.
|
||||
#OPTIONAL (default 30)
|
||||
MessageQueue=30
|
||||
|
||||
#Maximum length of message sent to irc server. If it exceeds
|
||||
#<message clipped> will be add to the message.
|
||||
#<clipped message> will be add to the message.
|
||||
#OPTIONAL (default 400)
|
||||
MessageLength=400
|
||||
|
||||
#Split messages on MessageLength instead of showing the <message clipped>
|
||||
#Split messages on MessageLength instead of showing the <clipped message>
|
||||
#WARNING: this could lead to flooding
|
||||
#OPTIONAL (default false)
|
||||
MessageSplit=false
|
||||
|
||||
#Message to show when a message is too big
|
||||
#Default "<clipped message>"
|
||||
MessageClipped="<clipped message>"
|
||||
|
||||
#Delay in seconds to rejoin a channel when kicked
|
||||
#OPTIONAL (default 0)
|
||||
RejoinDelay=0
|
||||
@@ -826,6 +830,10 @@ PreserveThreading=false
|
||||
#OPTIONAL (default false)
|
||||
ShowUserTyping=false
|
||||
|
||||
#Message to show when a message is too big
|
||||
#Default "<clipped message>"
|
||||
MessageClipped="<clipped message>"
|
||||
|
||||
###################################################################
|
||||
#discord section
|
||||
###################################################################
|
||||
@@ -848,6 +856,14 @@ Server="yourservername"
|
||||
## All settings below can be reloaded by editing the file.
|
||||
## They are also all optional.
|
||||
|
||||
# AllowMention controls which mentions are allowed. If not specified, all mentions are allowed.
|
||||
# Note that even when a mention is not allowed, it will still be displayed nicely and be clickable. It just prevents the ping/notification.
|
||||
#
|
||||
# "everyone" allows @everyone and @here mentions
|
||||
# "roles" allows @role mentions
|
||||
# "users" allows @user mentions
|
||||
AllowMention=["everyone", "roles", "users"]
|
||||
|
||||
# ShowEmbeds shows the title, description and URL of embedded messages (sent by other bots)
|
||||
ShowEmbeds=false
|
||||
|
||||
@@ -953,6 +969,10 @@ ShowTopicChange=false
|
||||
# Supported from the following bridges: slack
|
||||
SyncTopic=false
|
||||
|
||||
#Message to show when a message is too big
|
||||
#Default "<clipped message>"
|
||||
MessageClipped="<clipped message>"
|
||||
|
||||
###################################################################
|
||||
#telegram section
|
||||
###################################################################
|
||||
@@ -1011,6 +1031,13 @@ QuoteFormat="{MESSAGE} (re @{QUOTENICK}: {QUOTEMESSAGE})"
|
||||
#OPTIONAL (default false)
|
||||
MediaConvertWebPToPNG=false
|
||||
|
||||
#Convert Tgs (Telegram animated sticker) images to PNG before upload.
|
||||
#This is useful when your bridge also contains platforms that do not support animated WebP files, like Discord.
|
||||
#This requires the external dependency `lottie`, which can be installed like this:
|
||||
#`pip install lottie cairosvg`
|
||||
#https://github.com/42wim/matterbridge/issues/874
|
||||
#MediaConvertTgs="png"
|
||||
|
||||
#Disable sending of edits to other bridges
|
||||
#OPTIONAL (default false)
|
||||
EditDisable=false
|
||||
@@ -1230,12 +1257,16 @@ ShowTopicChange=false
|
||||
#REQUIRED
|
||||
Server="https://matrix.org"
|
||||
|
||||
#login/pass of your bot.
|
||||
#Authentication for your bot.
|
||||
#You can use either login/password OR mxid/token. The latter will be preferred if found.
|
||||
#Use a dedicated user for this and not your own!
|
||||
#Messages sent from this user will not be relayed to avoid loops.
|
||||
#REQUIRED
|
||||
Login="yourlogin"
|
||||
Password="yourpass"
|
||||
#OR
|
||||
MxID="@yourlogin:domain.tld"
|
||||
Token="tokenforthebotuser"
|
||||
|
||||
#Whether to send the homeserver suffix. eg ":matrix.org" in @username:matrix.org
|
||||
#to other bridges, or only send "username".(true only sends username)
|
||||
@@ -1416,9 +1447,7 @@ StripNick=false
|
||||
ShowTopicChange=false
|
||||
|
||||
###################################################################
|
||||
#
|
||||
# NCTalk (Nextcloud Talk)
|
||||
#
|
||||
###################################################################
|
||||
|
||||
[nctalk.bridge]
|
||||
@@ -1441,9 +1470,7 @@ Password = "talkuserpass"
|
||||
GuestSuffix = " (Guest)"
|
||||
|
||||
###################################################################
|
||||
#
|
||||
# Mumble
|
||||
#
|
||||
###################################################################
|
||||
|
||||
[mumble.bridge]
|
||||
@@ -1486,10 +1513,25 @@ TLSCACertificate=mumble-ca.crt
|
||||
# OPTIONAL (default false)
|
||||
SkipTLSVerify=false
|
||||
|
||||
#Message to show when a message is too big
|
||||
#Default "<clipped message>"
|
||||
MessageClipped="<clipped message>"
|
||||
|
||||
###################################################################
|
||||
#VK
|
||||
###################################################################
|
||||
#
|
||||
[vk.myvk]
|
||||
#Group access token
|
||||
#See https://vk.com/dev/bots_docs
|
||||
Token="Yourtokenhere"
|
||||
|
||||
#Group ID
|
||||
#For example in URL https://vk.com/public168963511 group ID is 168963511
|
||||
GroupID=123456789
|
||||
|
||||
###################################################################
|
||||
# WhatsApp
|
||||
#
|
||||
###################################################################
|
||||
|
||||
[whatsapp.bridge]
|
||||
@@ -1516,9 +1558,7 @@ Label="Organization"
|
||||
|
||||
|
||||
###################################################################
|
||||
#
|
||||
# zulip
|
||||
#
|
||||
###################################################################
|
||||
|
||||
[zulip]
|
||||
@@ -1807,7 +1847,7 @@ enable=true
|
||||
|
||||
# account specified above
|
||||
# REQUIRED
|
||||
account="irc.freenode"
|
||||
account="irc.libera"
|
||||
|
||||
# The channel key in each gateway is mapped to a similar group chat ID on the chat platform
|
||||
# To find the group chat ID for different platforms, refer to the table below
|
||||
@@ -1835,7 +1875,7 @@ enable=true
|
||||
# rocketchat | channel | #channel | # is required for private channels too
|
||||
# -------------------------------------------------------------------------------------------------------------------------------------
|
||||
# slack | channel name | general | Do not include the # symbol
|
||||
# | channel id | ID:C123456 | The underlying ID of a channel. This doesn't work with
|
||||
# | channel id | ID:C123456 | The underlying ID of a channel. This doesn't work with webhooks.
|
||||
# -------------------------------------------------------------------------------------------------------------------------------------
|
||||
# steam | chatid | example needed | The number in the URL when you click "enter chat room" in the browser
|
||||
# -------------------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -1843,6 +1883,8 @@ enable=true
|
||||
# -------------------------------------------------------------------------------------------------------------------------------------
|
||||
# telegram | chatid | -123456789 | A large negative number. see https://www.linkedin.com/pulse/telegram-bots-beginners-marco-frau
|
||||
# -------------------------------------------------------------------------------------------------------------------------------------
|
||||
# vk | peerid | 2000000002 | A number that starts form 2000000000. Use --debug and send any message in chat to get PeerID in the logs
|
||||
# -------------------------------------------------------------------------------------------------------------------------------------
|
||||
# whatsapp | group JID | 48111222333-123455678999@g.us | A unique group JID. If you specify an empty string, bridge will list all the possibilities
|
||||
# | "Group Name" | "Family Chat" | if you specify a group name, the bridge will find hint the JID to specify. Names can change over time and are not stable.
|
||||
# -------------------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -1863,7 +1905,7 @@ enable=true
|
||||
|
||||
#[[gateway.out]] specifies the account and channels we will sent messages to.
|
||||
[[gateway.out]]
|
||||
account="irc.freenode"
|
||||
account="irc.libera"
|
||||
channel="#testing"
|
||||
|
||||
#OPTIONAL - only used for IRC and XMPP protocols at the moment
|
||||
|
||||
@@ -1,21 +1,18 @@
|
||||
FROM alpine AS builder
|
||||
|
||||
COPY . /go/src/github.com/42wim/matterbridge
|
||||
COPY . /go/src/matterbridge
|
||||
RUN apk add \
|
||||
go \
|
||||
git \
|
||||
gcc \
|
||||
musl-dev \
|
||||
&& cd /go/src/github.com/42wim/matterbridge \
|
||||
&& export GOPATH=/go \
|
||||
&& go get \
|
||||
&& go build -x -ldflags "-X main.githash=$(git log --pretty=format:'%h' -n 1)" -o /bin/matterbridge
|
||||
&& cd /go/src/matterbridge \
|
||||
&& go build -mod vendor -ldflags "-X main.githash=$(git log --pretty=format:'%h' -n 1)" -o /bin/matterbridge
|
||||
|
||||
FROM alpine
|
||||
RUN apk --no-cache add \
|
||||
ca-certificates \
|
||||
cairo \
|
||||
libjpeg-turbo \
|
||||
libwebp-dev \
|
||||
mailcap \
|
||||
py3-webencodings \
|
||||
python3 \
|
||||
|
||||
6878
vendor/github.com/Rhymen/go-whatsapp/binary/proto/def.pb.go
generated
vendored
61
vendor/github.com/Rhymen/go-whatsapp/binary/proto/def.proto
generated
vendored
@@ -1,6 +1,12 @@
|
||||
syntax = "proto2";
|
||||
package proto;
|
||||
|
||||
message PaymentMoney {
|
||||
optional int64 value = 1;
|
||||
optional uint32 offset = 2;
|
||||
optional string currencyCode = 3;
|
||||
}
|
||||
|
||||
message HydratedQuickReplyButton {
|
||||
optional string displayText = 1;
|
||||
optional string id = 2;
|
||||
@@ -156,6 +162,9 @@ message ImageMessage {
|
||||
optional bytes midQualityFileSha256 = 23;
|
||||
optional bytes midQualityFileEncSha256 = 24;
|
||||
optional bool viewOnce = 25;
|
||||
optional string thumbnailDirectPath = 26;
|
||||
optional bytes thumbnailSha256 = 27;
|
||||
optional bytes thumbnailEncSha256 = 28;
|
||||
}
|
||||
|
||||
message InvoiceMessage {
|
||||
@@ -285,6 +294,9 @@ message VideoMessage {
|
||||
}
|
||||
optional VideoMessageAttribution gifAttribution = 19;
|
||||
optional bool viewOnce = 20;
|
||||
optional string thumbnailDirectPath = 21;
|
||||
optional bytes thumbnailSha256 = 22;
|
||||
optional bytes thumbnailEncSha256 = 23;
|
||||
}
|
||||
|
||||
message Call {
|
||||
@@ -307,6 +319,7 @@ message ProtocolMessage {
|
||||
APP_STATE_SYNC_KEY_REQUEST = 7;
|
||||
MSG_FANOUT_BACKFILL_REQUEST = 8;
|
||||
INITIAL_SECURITY_NOTIFICATION_SETTING_SYNC = 9;
|
||||
APP_STATE_FATAL_EXCEPTION_NOTIFICATION = 10;
|
||||
}
|
||||
optional ProtocolMessageType type = 2;
|
||||
optional uint32 ephemeralExpiration = 4;
|
||||
@@ -315,6 +328,7 @@ message ProtocolMessage {
|
||||
optional AppStateSyncKeyShare appStateSyncKeyShare = 7;
|
||||
optional AppStateSyncKeyRequest appStateSyncKeyRequest = 8;
|
||||
optional InitialSecurityNotificationSettingSync initialSecurityNotificationSettingSync = 9;
|
||||
optional AppStateFatalExceptionNotification appStateFatalExceptionNotification = 10;
|
||||
}
|
||||
|
||||
message HistorySyncNotification {
|
||||
@@ -364,6 +378,11 @@ message AppStateSyncKeyRequest {
|
||||
repeated AppStateSyncKeyId keyIds = 1;
|
||||
}
|
||||
|
||||
message AppStateFatalExceptionNotification {
|
||||
repeated string collectionNames = 1;
|
||||
optional int64 timestamp = 2;
|
||||
}
|
||||
|
||||
message InitialSecurityNotificationSettingSync {
|
||||
optional bool securityNotificationEnabled = 1;
|
||||
}
|
||||
@@ -447,12 +466,6 @@ message RequestPaymentMessage {
|
||||
optional PaymentMoney amount = 6;
|
||||
}
|
||||
|
||||
message PaymentMoney {
|
||||
optional int64 value = 1;
|
||||
optional uint32 offset = 2;
|
||||
optional string currencyCode = 3;
|
||||
}
|
||||
|
||||
message DeclinePaymentRequestMessage {
|
||||
optional MessageKey key = 1;
|
||||
}
|
||||
@@ -577,6 +590,8 @@ message OrderMessage {
|
||||
optional string orderTitle = 7;
|
||||
optional string sellerJid = 8;
|
||||
optional string token = 9;
|
||||
optional int64 totalAmount1000 = 10;
|
||||
optional string totalCurrencyCode = 11;
|
||||
optional ContextInfo contextInfo = 17;
|
||||
}
|
||||
|
||||
@@ -653,6 +668,11 @@ message ButtonText {
|
||||
message Button {
|
||||
optional string buttonId = 1;
|
||||
optional ButtonText buttonText = 2;
|
||||
enum ButtonType {
|
||||
UNKNOWN = 0;
|
||||
RESPONSE = 1;
|
||||
}
|
||||
optional ButtonType type = 3;
|
||||
}
|
||||
|
||||
message ButtonsMessage {
|
||||
@@ -660,8 +680,18 @@ message ButtonsMessage {
|
||||
optional string footerText = 7;
|
||||
optional ContextInfo contextInfo = 8;
|
||||
repeated Button buttons = 9;
|
||||
oneof title {
|
||||
string titleText = 1;
|
||||
enum ButtonsMessageHeaderType {
|
||||
UNKNOWN = 0;
|
||||
EMPTY = 1;
|
||||
TEXT = 2;
|
||||
DOCUMENT = 3;
|
||||
IMAGE = 4;
|
||||
VIDEO = 5;
|
||||
LOCATION = 6;
|
||||
}
|
||||
optional ButtonsMessageHeaderType headerType = 10;
|
||||
oneof header {
|
||||
string text = 1;
|
||||
DocumentMessage documentMessage = 2;
|
||||
ImageMessage imageMessage = 3;
|
||||
VideoMessage videoMessage = 4;
|
||||
@@ -671,8 +701,15 @@ message ButtonsMessage {
|
||||
|
||||
message ButtonsResponseMessage {
|
||||
optional string selectedButtonId = 1;
|
||||
optional string selectedDisplayText = 2;
|
||||
optional ContextInfo contextInfo = 3;
|
||||
enum ButtonsResponseMessageType {
|
||||
UNKNOWN = 0;
|
||||
DISPLAY_TEXT = 1;
|
||||
}
|
||||
optional ButtonsResponseMessageType type = 4;
|
||||
oneof response {
|
||||
string selectedDisplayText = 2;
|
||||
}
|
||||
}
|
||||
|
||||
message Message {
|
||||
@@ -842,6 +879,9 @@ message PaymentInfo {
|
||||
COLLECT_CANCELLING = 27;
|
||||
}
|
||||
optional PaymentInfoTxnStatus txnStatus = 10;
|
||||
optional bool useNoviFiatFormat = 11;
|
||||
optional PaymentMoney primaryAmount = 12;
|
||||
optional PaymentMoney exchangeAmount = 13;
|
||||
}
|
||||
|
||||
message WebMessageInfo {
|
||||
@@ -1007,5 +1047,4 @@ message WebMessageInfo {
|
||||
}
|
||||
optional WebMessageInfoBizPrivacyStatus bizPrivacyStatus = 36;
|
||||
optional string verifiedBizName = 37;
|
||||
}
|
||||
|
||||
}
|
||||
26
vendor/github.com/Rhymen/go-whatsapp/conn.go
generated
vendored
@@ -2,7 +2,6 @@
|
||||
package whatsapp
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"net/http"
|
||||
"net/url"
|
||||
@@ -10,6 +9,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/gorilla/websocket"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
type metric byte
|
||||
@@ -195,7 +195,7 @@ func (wac *Conn) connect() (err error) {
|
||||
headers := http.Header{"Origin": []string{"https://web.whatsapp.com"}}
|
||||
wsConn, _, err := dialer.Dial("wss://web.whatsapp.com/ws", headers)
|
||||
if err != nil {
|
||||
return fmt.Errorf("couldn't dial whatsapp web websocket: %w", err)
|
||||
return errors.Wrap(err, "couldn't dial whatsapp web websocket")
|
||||
}
|
||||
|
||||
wsConn.SetCloseHandler(func(code int, text string) error {
|
||||
@@ -221,7 +221,7 @@ func (wac *Conn) connect() (err error) {
|
||||
wac.wg = &sync.WaitGroup{}
|
||||
wac.wg.Add(2)
|
||||
go wac.readPump()
|
||||
go wac.keepAlive(20000, 55000)
|
||||
go wac.keepAlive(20000, 60000)
|
||||
|
||||
wac.loggedIn = false
|
||||
return nil
|
||||
@@ -237,10 +237,7 @@ func (wac *Conn) Disconnect() (Session, error) {
|
||||
close(wac.ws.close) //signal close
|
||||
wac.wg.Wait() //wait for close
|
||||
|
||||
var err error
|
||||
if wac.ws != nil && wac.ws.conn != nil {
|
||||
err = wac.ws.conn.Close()
|
||||
}
|
||||
err := wac.ws.conn.Close()
|
||||
wac.ws = nil
|
||||
|
||||
if wac.session == nil {
|
||||
@@ -249,20 +246,17 @@ func (wac *Conn) Disconnect() (Session, error) {
|
||||
return *wac.session, err
|
||||
}
|
||||
|
||||
func (wac *Conn) IsLoginInProgress() bool {
|
||||
return wac.sessionLock == 1
|
||||
}
|
||||
|
||||
func (wac *Conn) AdminTest() error {
|
||||
func (wac *Conn) AdminTest() (bool, error) {
|
||||
if !wac.connected {
|
||||
return ErrNotConnected
|
||||
return false, ErrNotConnected
|
||||
}
|
||||
|
||||
if !wac.loggedIn {
|
||||
return ErrInvalidSession
|
||||
return false, ErrInvalidSession
|
||||
}
|
||||
|
||||
return wac.sendAdminTest()
|
||||
result, err := wac.sendAdminTest()
|
||||
return result, err
|
||||
}
|
||||
|
||||
func (wac *Conn) keepAlive(minIntervalMs int, maxIntervalMs int) {
|
||||
@@ -271,7 +265,7 @@ func (wac *Conn) keepAlive(minIntervalMs int, maxIntervalMs int) {
|
||||
for {
|
||||
err := wac.sendKeepAlive()
|
||||
if err != nil {
|
||||
wac.handle(fmt.Errorf("keepAlive failed: %w", err))
|
||||
wac.handle(errors.Wrap(err, "keepAlive failed"))
|
||||
//TODO: Consequences?
|
||||
}
|
||||
interval := rand.Intn(maxIntervalMs-minIntervalMs) + minIntervalMs
|
||||
|
||||
124
vendor/github.com/Rhymen/go-whatsapp/contact.go
generated
vendored
@@ -2,9 +2,11 @@ package whatsapp
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/Rhymen/go-whatsapp/binary"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Rhymen/go-whatsapp/binary"
|
||||
)
|
||||
|
||||
type Presence string
|
||||
@@ -39,20 +41,20 @@ func (wac *Conn) Search(search string, count, page int) (*binary.Node, error) {
|
||||
return wac.query("search", "", "", "", "", search, count, page)
|
||||
}
|
||||
|
||||
func (wac *Conn) LoadMessages(jid string, count int) (*binary.Node, error) {
|
||||
func (wac *Conn) LoadMessages(jid, messageId string, count int) (*binary.Node, error) {
|
||||
return wac.query("message", jid, "", "before", "true", "", count, 0)
|
||||
}
|
||||
|
||||
func (wac *Conn) LoadMessagesBefore(jid, messageId string, fromMe bool, count int) (*binary.Node, error) {
|
||||
return wac.query("message", jid, messageId, "before", strconv.FormatBool(fromMe), "", count, 0)
|
||||
func (wac *Conn) LoadMessagesBefore(jid, messageId string, count int) (*binary.Node, error) {
|
||||
return wac.query("message", jid, messageId, "before", "true", "", count, 0)
|
||||
}
|
||||
|
||||
func (wac *Conn) LoadMessagesAfter(jid, messageId string, fromMe bool, count int) (*binary.Node, error) {
|
||||
return wac.query("message", jid, messageId, "after", strconv.FormatBool(fromMe), "", count, 0)
|
||||
func (wac *Conn) LoadMessagesAfter(jid, messageId string, count int) (*binary.Node, error) {
|
||||
return wac.query("message", jid, messageId, "after", "true", "", count, 0)
|
||||
}
|
||||
|
||||
func (wac *Conn) LoadMediaInfo(jid, messageId string, fromMe bool) (*binary.Node, error) {
|
||||
return wac.query("media", jid, messageId, "", strconv.FormatBool(fromMe), "", 0, 0)
|
||||
func (wac *Conn) LoadMediaInfo(jid, messageId, owner string) (*binary.Node, error) {
|
||||
return wac.query("media", jid, messageId, "", owner, "", 0, 0)
|
||||
}
|
||||
|
||||
func (wac *Conn) Presence(jid string, presence Presence) (<-chan string, error) {
|
||||
@@ -96,19 +98,11 @@ func (wac *Conn) Emoji() (*binary.Node, error) {
|
||||
}
|
||||
|
||||
func (wac *Conn) Contacts() (*binary.Node, error) {
|
||||
node, err := wac.query("contacts", "", "", "", "", "", 0, 0)
|
||||
if node != nil && node.Description == "response" && node.Attributes["type"] == "contacts" {
|
||||
wac.updateContacts(node.Content)
|
||||
}
|
||||
return node, err
|
||||
return wac.query("contacts", "", "", "", "", "", 0, 0)
|
||||
}
|
||||
|
||||
func (wac *Conn) Chats() (*binary.Node, error) {
|
||||
node, err := wac.query("chat", "", "", "", "", "", 0, 0)
|
||||
if node != nil && node.Description == "response" && node.Attributes["type"] == "chat" {
|
||||
wac.updateChats(node.Content)
|
||||
}
|
||||
return node, err
|
||||
return wac.query("chat", "", "", "", "", "", 0, 0)
|
||||
}
|
||||
|
||||
func (wac *Conn) Read(jid, id string) (<-chan string, error) {
|
||||
@@ -185,18 +179,13 @@ func (wac *Conn) query(t, jid, messageId, kind, owner, search string, count, pag
|
||||
return nil, err
|
||||
}
|
||||
|
||||
select {
|
||||
case response := <-ch:
|
||||
msg, err := wac.decryptBinaryMessage([]byte(response))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
//TODO: use parseProtoMessage
|
||||
return msg, nil
|
||||
case <-time.After(3 * time.Minute):
|
||||
return nil, ErrQueryTimeout
|
||||
msg, err := wac.decryptBinaryMessage([]byte(<-ch))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
//TODO: use parseProtoMessage
|
||||
return msg, nil
|
||||
}
|
||||
|
||||
func (wac *Conn) setGroup(t, jid, subject string, participants []string) (<-chan string, error) {
|
||||
@@ -254,3 +243,80 @@ func buildParticipantNodes(participants []string) []binary.Node {
|
||||
}
|
||||
return p
|
||||
}
|
||||
|
||||
func (wac *Conn) BlockContact(jid string) (<-chan string, error) {
|
||||
return wac.handleBlockContact("add", jid)
|
||||
}
|
||||
|
||||
func (wac *Conn) UnblockContact(jid string) (<-chan string, error) {
|
||||
return wac.handleBlockContact("remove", jid)
|
||||
}
|
||||
|
||||
func (wac *Conn) handleBlockContact(action, jid string) (<-chan string, error) {
|
||||
ts := time.Now().Unix()
|
||||
tag := fmt.Sprintf("%d.--%d", ts, wac.msgCount)
|
||||
|
||||
netsplit := strings.Split(jid, "@")
|
||||
cusjid := netsplit[0] + "@c.us"
|
||||
|
||||
n := binary.Node{
|
||||
Description: "action",
|
||||
Attributes: map[string]string{
|
||||
"type": "set",
|
||||
"epoch": strconv.Itoa(wac.msgCount),
|
||||
},
|
||||
Content: []interface{}{
|
||||
binary.Node{
|
||||
Description: "block",
|
||||
Attributes: map[string]string{
|
||||
"type": action,
|
||||
},
|
||||
Content: []binary.Node{
|
||||
{
|
||||
Description: "user",
|
||||
Attributes: map[string]string{
|
||||
"jid": cusjid,
|
||||
},
|
||||
Content: nil,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
return wac.writeBinary(n, contact, ignore, tag)
|
||||
}
|
||||
|
||||
// Search product details on order
|
||||
func (wac *Conn) SearchProductDetails(id, orderId, token string) (<-chan string, error) {
|
||||
data := []interface{}{"query", "order", map[string]string{
|
||||
"id": id,
|
||||
"orderId": orderId,
|
||||
"imageHeight": strconv.Itoa(80),
|
||||
"imageWidth": strconv.Itoa(80),
|
||||
"token": token,
|
||||
}}
|
||||
return wac.writeJson(data)
|
||||
}
|
||||
|
||||
// Order search and get product catalog reh
|
||||
func (wac *Conn) SearchOrder(catalogWid, stanzaId string) (<-chan string, error) {
|
||||
data := []interface{}{"query", "bizCatalog", map[string]string{
|
||||
"catalogWid": catalogWid,
|
||||
"limit": strconv.Itoa(10),
|
||||
"height": strconv.Itoa(100),
|
||||
"width": strconv.Itoa(100),
|
||||
"stanza_id": stanzaId,
|
||||
"type": "get_product_catalog_reh",
|
||||
}}
|
||||
return wac.writeJson(data)
|
||||
}
|
||||
|
||||
// Company details for Whatsapp Business
|
||||
func (wac *Conn) BusinessProfile(wid string) (<-chan string, error) {
|
||||
query := map[string]string{
|
||||
"wid": wid,
|
||||
}
|
||||
data := []interface{}{"query", "businessProfile", []map[string]string{query}}
|
||||
return wac.writeJson(data)
|
||||
}
|
||||
|
||||
79
vendor/github.com/Rhymen/go-whatsapp/errors.go
generated
vendored
@@ -1,46 +1,25 @@
|
||||
package whatsapp
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
var (
|
||||
ErrAlreadyConnected = errors.New("already connected")
|
||||
ErrAlreadyLoggedIn = errors.New("already logged in")
|
||||
ErrInvalidSession = errors.New("invalid session")
|
||||
ErrLoginInProgress = errors.New("login or restore already running")
|
||||
ErrNotConnected = errors.New("not connected")
|
||||
ErrInvalidWsData = errors.New("received invalid data")
|
||||
ErrInvalidWsState = errors.New("can't handle binary data when not logged in")
|
||||
ErrConnectionTimeout = errors.New("connection timed out")
|
||||
ErrMissingMessageTag = errors.New("no messageTag specified or to short")
|
||||
ErrInvalidHmac = errors.New("invalid hmac")
|
||||
ErrInvalidServerResponse = errors.New("invalid response received from server")
|
||||
ErrServerRespondedWith404 = errors.New("server responded with status 404")
|
||||
ErrMediaDownloadFailedWith404 = errors.New("download failed with status code 404")
|
||||
ErrMediaDownloadFailedWith410 = errors.New("download failed with status code 410")
|
||||
ErrLoginTimedOut = errors.New("login timed out")
|
||||
ErrQueryTimeout = errors.New("query timed out")
|
||||
|
||||
ErrBadRequest = errors.New("400 (bad request)")
|
||||
ErrUnpaired = errors.New("401 (unpaired from phone)")
|
||||
ErrAccessDenied = errors.New("403 (access denied)")
|
||||
ErrLoggedIn = errors.New("405 (already logged in)")
|
||||
ErrReplaced = errors.New("409 (logged in from another location)")
|
||||
|
||||
ErrNoURLPresent = errors.New("no url present")
|
||||
ErrFileLengthMismatch = errors.New("file length does not match")
|
||||
ErrInvalidHashLength = errors.New("hash too short")
|
||||
ErrTooShortFile = errors.New("file too short")
|
||||
ErrInvalidMediaHMAC = errors.New("invalid media hmac")
|
||||
|
||||
ErrCantGetInviteLink = errors.New("you don't have the permission to view the invite link")
|
||||
ErrJoinUnauthorized = errors.New("you're not allowed to join that group")
|
||||
|
||||
ErrInvalidWebsocket = errors.New("invalid websocket")
|
||||
|
||||
ErrAlreadyConnected = errors.New("already connected")
|
||||
ErrAlreadyLoggedIn = errors.New("already logged in")
|
||||
ErrInvalidSession = errors.New("invalid session")
|
||||
ErrLoginInProgress = errors.New("login or restore already running")
|
||||
ErrNotConnected = errors.New("not connected")
|
||||
ErrInvalidWsData = errors.New("received invalid data")
|
||||
ErrInvalidWsState = errors.New("can't handle binary data when not logged in")
|
||||
ErrConnectionTimeout = errors.New("connection timed out")
|
||||
ErrMissingMessageTag = errors.New("no messageTag specified or to short")
|
||||
ErrInvalidHmac = errors.New("invalid hmac")
|
||||
ErrInvalidServerResponse = errors.New("invalid response received from server")
|
||||
ErrServerRespondedWith404 = errors.New("server responded with status 404")
|
||||
ErrInvalidWebsocket = errors.New("invalid websocket")
|
||||
ErrMessageTypeNotImplemented = errors.New("message type not implemented")
|
||||
ErrOptionsNotProvided = errors.New("new conn options not provided")
|
||||
)
|
||||
@@ -61,31 +40,3 @@ type ErrConnectionClosed struct {
|
||||
func (e *ErrConnectionClosed) Error() string {
|
||||
return fmt.Sprintf("server closed connection,code: %d,text: %s", e.Code, e.Text)
|
||||
}
|
||||
|
||||
type StatusResponseFields struct {
|
||||
// The response status code. This is always expected to be present.
|
||||
Status int `json:"status"`
|
||||
// Some error messages include a "tos" value. If it's higher than 0, it
|
||||
// might mean the user has been banned for breaking the terms of service.
|
||||
TermsOfService int `json:"tos,omitempty"`
|
||||
// This is a timestamp that's at least present in message send responses.
|
||||
Timestamp int64 `json:"t,omitempty"`
|
||||
}
|
||||
|
||||
type StatusResponse struct {
|
||||
StatusResponseFields
|
||||
RequestType string `json:"-"`
|
||||
Extra map[string]interface{} `json:"-"`
|
||||
}
|
||||
|
||||
func (sr *StatusResponse) UnmarshalJSON(data []byte) error {
|
||||
err := json.Unmarshal(data, &sr.Extra)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return json.Unmarshal(data, &sr.StatusResponseFields)
|
||||
}
|
||||
|
||||
func (sr StatusResponse) Error() string {
|
||||
return fmt.Sprintf("%s responded with %d", sr.RequestType, sr.Status)
|
||||
}
|
||||
|
||||
13
vendor/github.com/Rhymen/go-whatsapp/go.mod
generated
vendored
@@ -1,10 +1,11 @@
|
||||
module github.com/Rhymen/go-whatsapp
|
||||
|
||||
go 1.11
|
||||
|
||||
require (
|
||||
github.com/golang/protobuf v1.4.2
|
||||
github.com/gorilla/websocket v1.4.2
|
||||
golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9
|
||||
google.golang.org/protobuf v1.24.0
|
||||
github.com/golang/protobuf v1.4.1
|
||||
github.com/gorilla/websocket v1.4.1
|
||||
github.com/pkg/errors v0.8.1
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2
|
||||
google.golang.org/protobuf v1.25.0
|
||||
)
|
||||
|
||||
go 1.13
|
||||
|
||||
23
vendor/github.com/Rhymen/go-whatsapp/go.sum
generated
vendored
@@ -13,19 +13,21 @@ github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:x
|
||||
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
|
||||
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
|
||||
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
|
||||
github.com/golang/protobuf v1.4.1 h1:ZFgWrT+bLgsYPirOnRfKLYJLvssAegOj/hgyMFdJZe0=
|
||||
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
|
||||
github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=
|
||||
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
|
||||
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w=
|
||||
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM=
|
||||
github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
|
||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9 h1:vEg9joUBmeBcK9iSJftGNf3coIG4HqZElCPehJsfAYM=
|
||||
golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||
@@ -34,19 +36,19 @@ golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73r
|
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
||||
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
@@ -62,9 +64,8 @@ google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQ
|
||||
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
|
||||
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
|
||||
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.24.0 h1:UhZDfRO8JRQru4/+LlLE0BRKGF8L+PICnvYZmx/fEGA=
|
||||
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
|
||||
google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c=
|
||||
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
|
||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
|
||||
82
vendor/github.com/Rhymen/go-whatsapp/group.go
generated
vendored
@@ -3,10 +3,7 @@ package whatsapp
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/Rhymen/go-whatsapp/binary"
|
||||
)
|
||||
|
||||
func (wac *Conn) GetGroupMetaData(jid string) (<-chan string, error) {
|
||||
@@ -60,11 +57,8 @@ func (wac *Conn) GroupInviteLink(jid string) (string, error) {
|
||||
return "", fmt.Errorf("request timed out")
|
||||
}
|
||||
|
||||
status := int(response["status"].(float64))
|
||||
if status == 401 {
|
||||
return "", ErrCantGetInviteLink
|
||||
} else if status != 200 {
|
||||
return "", fmt.Errorf("request responded with %d", status)
|
||||
if int(response["status"].(float64)) != 200 {
|
||||
return "", fmt.Errorf("request responded with %d", response["status"])
|
||||
}
|
||||
|
||||
return response["code"].(string), nil
|
||||
@@ -88,77 +82,9 @@ func (wac *Conn) GroupAcceptInviteCode(code string) (jid string, err error) {
|
||||
return "", fmt.Errorf("request timed out")
|
||||
}
|
||||
|
||||
status := int(response["status"].(float64))
|
||||
|
||||
if status == 401 {
|
||||
return "", ErrJoinUnauthorized
|
||||
} else if status != 200 {
|
||||
return "", fmt.Errorf("request responded with %d", status)
|
||||
if int(response["status"].(float64)) != 200 {
|
||||
return "", fmt.Errorf("request responded with %d", response["status"])
|
||||
}
|
||||
|
||||
return response["gid"].(string), nil
|
||||
}
|
||||
|
||||
type descriptionID struct {
|
||||
DescID string `json:"descId"`
|
||||
}
|
||||
|
||||
func (wac *Conn) getDescriptionID(jid string) (string, error) {
|
||||
data, err := wac.GetGroupMetaData(jid)
|
||||
if err != nil {
|
||||
return "none", err
|
||||
}
|
||||
var oldData descriptionID
|
||||
err = json.Unmarshal([]byte(<-data), &oldData)
|
||||
if err != nil {
|
||||
return "none", err
|
||||
}
|
||||
if oldData.DescID == "" {
|
||||
return "none", nil
|
||||
}
|
||||
return oldData.DescID, nil
|
||||
}
|
||||
|
||||
func (wac *Conn) UpdateGroupDescription(jid, description string) (<-chan string, error) {
|
||||
prevID, err := wac.getDescriptionID(jid)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
newData := map[string]string{
|
||||
"prev": prevID,
|
||||
}
|
||||
var desc interface{} = description
|
||||
if description == "" {
|
||||
newData["delete"] = "true"
|
||||
desc = nil
|
||||
} else {
|
||||
newData["id"] = fmt.Sprintf("%d-%d", time.Now().Unix(), wac.msgCount*19)
|
||||
}
|
||||
tag := fmt.Sprintf("%d.--%d", time.Now().Unix(), wac.msgCount*19)
|
||||
n := binary.Node{
|
||||
Description: "action",
|
||||
Attributes: map[string]string{
|
||||
"type": "set",
|
||||
"epoch": strconv.Itoa(wac.msgCount),
|
||||
},
|
||||
Content: []interface{}{
|
||||
binary.Node{
|
||||
Description: "group",
|
||||
Attributes: map[string]string{
|
||||
"id": tag,
|
||||
"jid": jid,
|
||||
"type": "description",
|
||||
"author": wac.Info.Wid,
|
||||
},
|
||||
Content: []binary.Node{
|
||||
{
|
||||
Description: "description",
|
||||
Attributes: newData,
|
||||
Content: desc,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
return wac.writeBinary(n, group, 136, tag)
|
||||
}
|
||||
|
||||
80
vendor/github.com/Rhymen/go-whatsapp/handler.go
generated
vendored
@@ -97,6 +97,22 @@ type ContactMessageHandler interface {
|
||||
HandleContactMessage(message ContactMessage)
|
||||
}
|
||||
|
||||
/*
|
||||
The ProductMessageHandler interface needs to be implemented to receive product messages dispatched by the dispatcher.
|
||||
*/
|
||||
type ProductMessageHandler interface {
|
||||
Handler
|
||||
HandleProductMessage(message ProductMessage)
|
||||
}
|
||||
|
||||
/*
|
||||
The OrderMessageHandler interface needs to be implemented to receive order messages dispatched by the dispatcher.
|
||||
*/
|
||||
type OrderMessageHandler interface {
|
||||
Handler
|
||||
HandleOrderMessage(message OrderMessage)
|
||||
}
|
||||
|
||||
/*
|
||||
The JsonMessageHandler interface needs to be implemented to receive json messages dispatched by the dispatcher.
|
||||
These json messages contain status updates of every kind sent by WhatsAppWeb servers. WhatsAppWeb uses these messages
|
||||
@@ -117,12 +133,6 @@ type RawMessageHandler interface {
|
||||
HandleRawMessage(message *proto.WebMessageInfo)
|
||||
}
|
||||
|
||||
// The UnknownBinaryHandler interface needs to be implemented to receive unhandled binary messages.
|
||||
type UnknownBinaryHandler interface {
|
||||
Handler
|
||||
HandleUnknownBinaryNode(message *binary.Node)
|
||||
}
|
||||
|
||||
/**
|
||||
The ContactListHandler interface needs to be implemented to applky custom actions to contact lists dispatched by the dispatcher.
|
||||
*/
|
||||
@@ -147,16 +157,6 @@ type BatteryMessageHandler interface {
|
||||
HandleBatteryMessage(battery BatteryMessage)
|
||||
}
|
||||
|
||||
type ReadMessageHandler interface {
|
||||
Handler
|
||||
HandleReadMessage(read ReadMessage)
|
||||
}
|
||||
|
||||
type ReceivedMessageHandler interface {
|
||||
Handler
|
||||
HandleReceivedMessage(received ReceivedMessage)
|
||||
}
|
||||
|
||||
/**
|
||||
The NewContactHandler interface needs to be implemented to receive the contact's name for the first time.
|
||||
*/
|
||||
@@ -202,19 +202,6 @@ func (wac *Conn) shouldCallSynchronously(handler Handler) bool {
|
||||
}
|
||||
|
||||
func (wac *Conn) handle(message interface{}) {
|
||||
defer func() {
|
||||
if errIfc := recover(); errIfc != nil {
|
||||
if err, ok := errIfc.(error); ok {
|
||||
wac.unsafeHandle(fmt.Errorf("panic in WhatsApp handler: %w", err))
|
||||
} else {
|
||||
wac.unsafeHandle(fmt.Errorf("panic in WhatsApp handler: %v", errIfc))
|
||||
}
|
||||
}
|
||||
}()
|
||||
wac.unsafeHandle(message)
|
||||
}
|
||||
|
||||
func (wac *Conn) unsafeHandle(message interface{}) {
|
||||
wac.handleWithCustomHandlers(message, wac.handler)
|
||||
}
|
||||
|
||||
@@ -330,7 +317,7 @@ func (wac *Conn) handleWithCustomHandlers(message interface{}, handlers []Handle
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
case BatteryMessage:
|
||||
for _, h := range handlers {
|
||||
if x, ok := h.(BatteryMessageHandler); ok {
|
||||
@@ -341,7 +328,7 @@ func (wac *Conn) handleWithCustomHandlers(message interface{}, handlers []Handle
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
case Contact:
|
||||
for _, h := range handlers {
|
||||
if x, ok := h.(NewContactHandler); ok {
|
||||
@@ -353,24 +340,24 @@ func (wac *Conn) handleWithCustomHandlers(message interface{}, handlers []Handle
|
||||
}
|
||||
}
|
||||
|
||||
case ReadMessage:
|
||||
case ProductMessage:
|
||||
for _, h := range handlers {
|
||||
if x, ok := h.(ReadMessageHandler); ok {
|
||||
if x, ok := h.(ProductMessageHandler); ok {
|
||||
if wac.shouldCallSynchronously(h) {
|
||||
x.HandleReadMessage(m)
|
||||
x.HandleProductMessage(m)
|
||||
} else {
|
||||
go x.HandleReadMessage(m)
|
||||
go x.HandleProductMessage(m)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
case ReceivedMessage:
|
||||
case OrderMessage:
|
||||
for _, h := range handlers {
|
||||
if x, ok := h.(ReceivedMessageHandler); ok {
|
||||
if x, ok := h.(OrderMessageHandler); ok {
|
||||
if wac.shouldCallSynchronously(h) {
|
||||
x.HandleReceivedMessage(m)
|
||||
x.HandleOrderMessage(m)
|
||||
} else {
|
||||
go x.HandleReceivedMessage(m)
|
||||
go x.HandleOrderMessage(m)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -385,17 +372,6 @@ func (wac *Conn) handleWithCustomHandlers(message interface{}, handlers []Handle
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
case *binary.Node:
|
||||
for _, h := range handlers {
|
||||
if x, ok := h.(UnknownBinaryHandler); ok {
|
||||
if wac.shouldCallSynchronously(h) {
|
||||
x.HandleUnknownBinaryNode(m)
|
||||
} else {
|
||||
go x.HandleUnknownBinaryNode(m)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -487,8 +463,6 @@ func (wac *Conn) dispatch(msg interface{}) {
|
||||
for a := range con {
|
||||
wac.handle(ParseNodeMessage(con[a]))
|
||||
}
|
||||
} else {
|
||||
wac.handle(message)
|
||||
}
|
||||
} else if message.Description == "response" && message.Attributes["type"] == "contacts" {
|
||||
wac.updateContacts(message.Content)
|
||||
@@ -496,8 +470,6 @@ func (wac *Conn) dispatch(msg interface{}) {
|
||||
} else if message.Description == "response" && message.Attributes["type"] == "chat" {
|
||||
wac.updateChats(message.Content)
|
||||
wac.handleChats(message.Content)
|
||||
} else {
|
||||
wac.handle(message)
|
||||
}
|
||||
case error:
|
||||
wac.handle(message)
|
||||
|
||||
16
vendor/github.com/Rhymen/go-whatsapp/media.go
generated
vendored
@@ -21,7 +21,7 @@ import (
|
||||
|
||||
func Download(url string, mediaKey []byte, appInfo MediaType, fileLength int) ([]byte, error) {
|
||||
if url == "" {
|
||||
return nil, ErrNoURLPresent
|
||||
return nil, fmt.Errorf("no url present")
|
||||
}
|
||||
file, mac, err := downloadMedia(url)
|
||||
if err != nil {
|
||||
@@ -39,7 +39,7 @@ func Download(url string, mediaKey []byte, appInfo MediaType, fileLength int) ([
|
||||
return nil, err
|
||||
}
|
||||
if len(data) != fileLength {
|
||||
return nil, ErrFileLengthMismatch
|
||||
return nil, fmt.Errorf("file length does not match. Expected: %v, got: %v", fileLength, len(data))
|
||||
}
|
||||
return data, nil
|
||||
}
|
||||
@@ -51,10 +51,10 @@ func validateMedia(iv []byte, file []byte, macKey []byte, mac []byte) error {
|
||||
return err
|
||||
}
|
||||
if n < 10 {
|
||||
return ErrInvalidHashLength
|
||||
return fmt.Errorf("hash to short")
|
||||
}
|
||||
if !hmac.Equal(h.Sum(nil)[:10], mac) {
|
||||
return ErrInvalidMediaHMAC
|
||||
return fmt.Errorf("invalid media hmac")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -74,16 +74,10 @@ func downloadMedia(url string) (file []byte, mac []byte, err error) {
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
if resp.StatusCode == http.StatusNotFound {
|
||||
return nil, nil, ErrMediaDownloadFailedWith404
|
||||
}
|
||||
if resp.StatusCode == http.StatusGone {
|
||||
return nil, nil, ErrMediaDownloadFailedWith410
|
||||
}
|
||||
return nil, nil, fmt.Errorf("download failed with status code %d", resp.StatusCode)
|
||||
}
|
||||
if resp.ContentLength <= 10 {
|
||||
return nil, nil, ErrTooShortFile
|
||||
return nil, nil, fmt.Errorf("file to short")
|
||||
}
|
||||
data, err := ioutil.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
|
||||
217
vendor/github.com/Rhymen/go-whatsapp/message.go
generated
vendored
@@ -12,7 +12,6 @@ import (
|
||||
|
||||
"github.com/Rhymen/go-whatsapp/binary"
|
||||
"github.com/Rhymen/go-whatsapp/binary/proto"
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
)
|
||||
|
||||
type MediaType string
|
||||
@@ -24,23 +23,6 @@ const (
|
||||
MediaDocument MediaType = "WhatsApp Document Keys"
|
||||
)
|
||||
|
||||
func (wac *Conn) SendRaw(msg *proto.WebMessageInfo, output chan<- error) {
|
||||
ch, err := wac.sendProto(msg)
|
||||
if err != nil {
|
||||
output <- fmt.Errorf("could not send proto: %w", err)
|
||||
return
|
||||
}
|
||||
response := <-ch
|
||||
resp := StatusResponse{RequestType: "message sending"}
|
||||
if err = json.Unmarshal([]byte(response), &resp); err != nil {
|
||||
output <- fmt.Errorf("error decoding sending response: %w", err)
|
||||
} else if resp.Status != 200 {
|
||||
output <- resp
|
||||
} else {
|
||||
output <- nil
|
||||
}
|
||||
}
|
||||
|
||||
func (wac *Conn) Send(msg interface{}) (string, error) {
|
||||
var msgProto *proto.WebMessageInfo
|
||||
|
||||
@@ -83,10 +65,15 @@ func (wac *Conn) Send(msg interface{}) (string, error) {
|
||||
msgProto = GetLiveLocationProto(m)
|
||||
case ContactMessage:
|
||||
msgProto = getContactMessageProto(m)
|
||||
case ProductMessage:
|
||||
msgProto = getProductMessageProto(m)
|
||||
case OrderMessage:
|
||||
msgProto = getOrderMessageProto(m)
|
||||
default:
|
||||
return "ERROR", fmt.Errorf("cannot match type %T, use message types declared in the package", msg)
|
||||
}
|
||||
|
||||
status := proto.WebMessageInfo_PENDING
|
||||
msgProto.Status = &status
|
||||
ch, err := wac.sendProto(msgProto)
|
||||
if err != nil {
|
||||
return "ERROR", fmt.Errorf("could not send proto: %v", err)
|
||||
@@ -94,16 +81,21 @@ func (wac *Conn) Send(msg interface{}) (string, error) {
|
||||
|
||||
select {
|
||||
case response := <-ch:
|
||||
resp := StatusResponse{RequestType: "message sending"}
|
||||
var resp map[string]interface{}
|
||||
if err = json.Unmarshal([]byte(response), &resp); err != nil {
|
||||
return "ERROR", fmt.Errorf("error decoding sending response: %v\n", err)
|
||||
} else if resp.Status != 200 {
|
||||
return "ERROR", resp
|
||||
}
|
||||
return getMessageInfo(msgProto).Id, nil
|
||||
if int(resp["status"].(float64)) != 200 {
|
||||
return "ERROR", fmt.Errorf("message sending responded with %v", resp["status"])
|
||||
}
|
||||
if int(resp["status"].(float64)) == 200 {
|
||||
return getMessageInfo(msgProto).Id, nil
|
||||
}
|
||||
case <-time.After(wac.msgTimeout):
|
||||
return "ERROR", fmt.Errorf("sending message timed out")
|
||||
}
|
||||
|
||||
return "ERROR", nil
|
||||
}
|
||||
|
||||
func (wac *Conn) sendProto(p *proto.WebMessageInfo) (<-chan string, error) {
|
||||
@@ -164,16 +156,21 @@ func (wac *Conn) DeleteMessage(remotejid, msgid string, fromMe bool) error {
|
||||
|
||||
select {
|
||||
case response := <-ch:
|
||||
resp := StatusResponse{RequestType: "message deletion"}
|
||||
var resp map[string]interface{}
|
||||
if err = json.Unmarshal([]byte(response), &resp); err != nil {
|
||||
return fmt.Errorf("error decoding deletion response: %v", err)
|
||||
} else if resp.Status != 200 {
|
||||
return resp
|
||||
}
|
||||
return nil
|
||||
if int(resp["status"].(float64)) != 200 {
|
||||
return fmt.Errorf("message deletion responded with %v", resp["status"])
|
||||
}
|
||||
if int(resp["status"].(float64)) == 200 {
|
||||
return nil
|
||||
}
|
||||
case <-time.After(wac.msgTimeout):
|
||||
return fmt.Errorf("deleting message timed out")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (wac *Conn) deleteChatProto(remotejid, msgid string, fromMe bool) (<-chan string, error) {
|
||||
@@ -283,20 +280,19 @@ func getInfoProto(info *MessageInfo) *proto.WebMessageInfo {
|
||||
ContextInfo represents contextinfo of every message
|
||||
*/
|
||||
type ContextInfo struct {
|
||||
QuotedMessageID string // StanzaId
|
||||
QuotedMessageID string //StanzaId
|
||||
QuotedMessage *proto.Message
|
||||
Participant string
|
||||
IsForwarded bool
|
||||
MentionedJID []string
|
||||
}
|
||||
|
||||
func getMessageContext(msg *proto.ContextInfo) ContextInfo {
|
||||
|
||||
return ContextInfo{
|
||||
QuotedMessageID: msg.GetStanzaId(), // StanzaId
|
||||
QuotedMessageID: msg.GetStanzaId(), //StanzaId
|
||||
QuotedMessage: msg.GetQuotedMessage(),
|
||||
Participant: msg.GetParticipant(),
|
||||
IsForwarded: msg.GetIsForwarded(),
|
||||
MentionedJID: msg.GetMentionedJid(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -334,6 +330,7 @@ func getTextMessage(msg *proto.WebMessageInfo) TextMessage {
|
||||
text.ContextInfo = getMessageContext(m.GetContextInfo())
|
||||
} else {
|
||||
text.Text = msg.GetMessage().GetConversation()
|
||||
|
||||
}
|
||||
|
||||
return text
|
||||
@@ -810,7 +807,115 @@ func getContactMessageProto(msg ContactMessage) *proto.WebMessageInfo {
|
||||
return p
|
||||
}
|
||||
|
||||
/*
|
||||
OrderMessage represents a order message.
|
||||
*/
|
||||
|
||||
type OrderMessage struct {
|
||||
Info MessageInfo
|
||||
OrderId string
|
||||
Thumbnail []byte
|
||||
ItemCount int32
|
||||
Status proto.OrderMessage_OrderMessageOrderStatus
|
||||
Surface proto.OrderMessage_OrderMessageOrderSurface
|
||||
Message string
|
||||
OrderTitle string
|
||||
SellerJid string
|
||||
Token string
|
||||
TotalAmount1000 int64
|
||||
TotalCurrencyCode string
|
||||
ContextInfo ContextInfo
|
||||
}
|
||||
|
||||
func getOrderMessage(msg *proto.WebMessageInfo) OrderMessage {
|
||||
order := msg.GetMessage().GetOrderMessage()
|
||||
|
||||
orderMessage := OrderMessage{
|
||||
Info: getMessageInfo(msg),
|
||||
OrderId: order.GetOrderId(),
|
||||
Thumbnail: order.GetThumbnail(),
|
||||
ItemCount: order.GetItemCount(),
|
||||
Status: order.GetStatus(),
|
||||
Surface: order.GetSurface(),
|
||||
Message: order.GetMessage(),
|
||||
OrderTitle: order.GetOrderTitle(),
|
||||
SellerJid: order.GetSellerJid(),
|
||||
Token: order.GetToken(),
|
||||
TotalAmount1000: order.GetTotalAmount1000(),
|
||||
TotalCurrencyCode: order.GetTotalCurrencyCode(),
|
||||
ContextInfo: getMessageContext(order.GetContextInfo()),
|
||||
}
|
||||
|
||||
return orderMessage
|
||||
}
|
||||
|
||||
func getOrderMessageProto(msg OrderMessage) *proto.WebMessageInfo {
|
||||
p := getInfoProto(&msg.Info)
|
||||
contextInfo := getContextInfoProto(&msg.ContextInfo)
|
||||
|
||||
p.Message = &proto.Message{
|
||||
OrderMessage: &proto.OrderMessage{
|
||||
Thumbnail: msg.Thumbnail,
|
||||
ItemCount: &msg.ItemCount,
|
||||
Status: &msg.Status,
|
||||
Surface: &msg.Surface,
|
||||
Message: &msg.Message,
|
||||
OrderTitle: &msg.OrderTitle,
|
||||
SellerJid: &msg.SellerJid,
|
||||
Token: &msg.Token,
|
||||
TotalAmount1000: &msg.TotalAmount1000,
|
||||
TotalCurrencyCode: &msg.TotalCurrencyCode,
|
||||
ContextInfo: contextInfo,
|
||||
},
|
||||
}
|
||||
|
||||
return p
|
||||
}
|
||||
|
||||
/*
|
||||
ProductMessage represents a product message.
|
||||
*/
|
||||
|
||||
type ProductMessage struct {
|
||||
Info MessageInfo
|
||||
Product *proto.ProductSnapshot
|
||||
BusinessOwnerJid string
|
||||
Catalog *proto.CatalogSnapshot
|
||||
ContextInfo ContextInfo
|
||||
}
|
||||
|
||||
func getProductMessage(msg *proto.WebMessageInfo) ProductMessage {
|
||||
prod := msg.GetMessage().GetProductMessage()
|
||||
|
||||
productMessage := ProductMessage{
|
||||
Info: getMessageInfo(msg),
|
||||
Product: prod.GetProduct(),
|
||||
BusinessOwnerJid: prod.GetBusinessOwnerJid(),
|
||||
Catalog: prod.GetCatalog(),
|
||||
ContextInfo: getMessageContext(prod.GetContextInfo()),
|
||||
}
|
||||
|
||||
return productMessage
|
||||
}
|
||||
|
||||
func getProductMessageProto(msg ProductMessage) *proto.WebMessageInfo {
|
||||
p := getInfoProto(&msg.Info)
|
||||
contextInfo := getContextInfoProto(&msg.ContextInfo)
|
||||
|
||||
p.Message = &proto.Message{
|
||||
ProductMessage: &proto.ProductMessage{
|
||||
Product: msg.Product,
|
||||
BusinessOwnerJid: &msg.BusinessOwnerJid,
|
||||
Catalog: msg.Catalog,
|
||||
ContextInfo: contextInfo,
|
||||
},
|
||||
}
|
||||
|
||||
return p
|
||||
}
|
||||
|
||||
func ParseProtoMessage(msg *proto.WebMessageInfo) interface{} {
|
||||
|
||||
switch {
|
||||
|
||||
case msg.GetMessage().GetAudioMessage() != nil:
|
||||
@@ -843,9 +948,14 @@ func ParseProtoMessage(msg *proto.WebMessageInfo) interface{} {
|
||||
case msg.GetMessage().GetContactMessage() != nil:
|
||||
return getContactMessage(msg)
|
||||
|
||||
case msg.GetMessage().GetProductMessage() != nil:
|
||||
return getProductMessage(msg)
|
||||
|
||||
case msg.GetMessage().GetOrderMessage() != nil:
|
||||
return getOrderMessage(msg)
|
||||
|
||||
default:
|
||||
// cannot match message
|
||||
spew.Dump(msg)
|
||||
//cannot match message
|
||||
return ErrMessageTypeNotImplemented
|
||||
}
|
||||
}
|
||||
@@ -881,50 +991,15 @@ func getNewContact(msg map[string]string) Contact {
|
||||
return contact
|
||||
}
|
||||
|
||||
// ReadMessage represents a chat that the user read on the WhatsApp mobile app.
|
||||
type ReadMessage struct {
|
||||
Jid string
|
||||
}
|
||||
|
||||
func getReadMessage(msg map[string]string) ReadMessage {
|
||||
return ReadMessage{
|
||||
Jid: msg["jid"],
|
||||
}
|
||||
}
|
||||
|
||||
// ReceivedMessage probably represents a message that the user read on the WhatsApp mobile app.
|
||||
type ReceivedMessage struct {
|
||||
Index string
|
||||
Jid string
|
||||
Owner bool
|
||||
Participant string
|
||||
Type string
|
||||
}
|
||||
|
||||
func getReceivedMessage(msg map[string]string) ReceivedMessage {
|
||||
owner, _ := strconv.ParseBool(msg["owner"])
|
||||
// This field might not exist
|
||||
participant, _ := msg["participant"]
|
||||
return ReceivedMessage{
|
||||
Index: msg["index"],
|
||||
Jid: msg["jid"],
|
||||
Owner: owner,
|
||||
Participant: participant,
|
||||
Type: msg["type"],
|
||||
}
|
||||
}
|
||||
|
||||
func ParseNodeMessage(msg binary.Node) interface{} {
|
||||
switch msg.Description {
|
||||
case "battery":
|
||||
return getBatteryMessage(msg.Attributes)
|
||||
case "user":
|
||||
return getNewContact(msg.Attributes)
|
||||
case "read":
|
||||
return getReadMessage(msg.Attributes)
|
||||
case "received":
|
||||
return getReceivedMessage(msg.Attributes)
|
||||
default:
|
||||
return &msg
|
||||
//cannot match message
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
24
vendor/github.com/Rhymen/go-whatsapp/profile.go
generated
vendored
@@ -2,9 +2,10 @@ package whatsapp
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/Rhymen/go-whatsapp/binary"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/Rhymen/go-whatsapp/binary"
|
||||
)
|
||||
|
||||
// Pictures must be JPG 640x640 and 96x96, respectively
|
||||
@@ -41,3 +42,24 @@ func (wac *Conn) UploadProfilePic(image, preview []byte) (<-chan string, error)
|
||||
}
|
||||
return wac.writeBinary(n, profile, 136, tag)
|
||||
}
|
||||
|
||||
func (wac *Conn) UpdateProfileName(name string) (<-chan string, error) {
|
||||
tag := fmt.Sprintf("%d.--%d", time.Now().Unix(), wac.msgCount*19)
|
||||
n := binary.Node{
|
||||
Description: "action",
|
||||
Attributes: map[string]string{
|
||||
"type": "set",
|
||||
"epoch": strconv.Itoa(wac.msgCount),
|
||||
},
|
||||
Content: []interface{}{
|
||||
binary.Node{
|
||||
Description: "profile",
|
||||
Attributes: map[string]string{
|
||||
"name": name,
|
||||
},
|
||||
Content: []binary.Node{},
|
||||
},
|
||||
},
|
||||
}
|
||||
return wac.writeBinary(n, profile, ignore, tag)
|
||||
}
|
||||
|
||||
24
vendor/github.com/Rhymen/go-whatsapp/read.go
generated
vendored
@@ -10,10 +10,10 @@ import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/gorilla/websocket"
|
||||
|
||||
"github.com/Rhymen/go-whatsapp/binary"
|
||||
"github.com/Rhymen/go-whatsapp/crypto/cbc"
|
||||
"github.com/gorilla/websocket"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
func (wac *Conn) readPump() {
|
||||
@@ -42,12 +42,12 @@ func (wac *Conn) readPump() {
|
||||
}
|
||||
msg, err := ioutil.ReadAll(reader)
|
||||
if err != nil {
|
||||
wac.handle(fmt.Errorf("error reading message from Reader: %w", err))
|
||||
wac.handle(errors.Wrap(err, "error reading message from Reader"))
|
||||
continue
|
||||
}
|
||||
err = wac.processReadData(msgType, msg)
|
||||
if err != nil {
|
||||
wac.handle(fmt.Errorf("error processing data: %w", err))
|
||||
wac.handle(errors.Wrap(err, "error processing data"))
|
||||
}
|
||||
case <-wac.ws.close:
|
||||
return
|
||||
@@ -83,10 +83,8 @@ func (wac *Conn) processReadData(msgType int, msg []byte) error {
|
||||
// chan string to something like chan map[string]interface{}. The unmarshalling
|
||||
// in several places, especially in session.go, would then be gone.
|
||||
listener <- data[1]
|
||||
|
||||
wac.listener.Lock()
|
||||
delete(wac.listener.m, data[0])
|
||||
wac.listener.Unlock()
|
||||
close(listener)
|
||||
wac.removeListener(data[0])
|
||||
} else if msgType == websocket.BinaryMessage {
|
||||
wac.loginSessionLock.RLock()
|
||||
sess := wac.session
|
||||
@@ -96,7 +94,7 @@ func (wac *Conn) processReadData(msgType int, msg []byte) error {
|
||||
}
|
||||
message, err := wac.decryptBinaryMessage([]byte(data[1]))
|
||||
if err != nil {
|
||||
return fmt.Errorf("error decoding binary: %w", err)
|
||||
return errors.Wrap(err, "error decoding binary")
|
||||
}
|
||||
wac.dispatch(message)
|
||||
} else { //RAW json status updates
|
||||
@@ -117,9 +115,7 @@ func (wac *Conn) decryptBinaryMessage(msg []byte) (*binary.Node, error) {
|
||||
if response.Status == http.StatusNotFound {
|
||||
return nil, ErrServerRespondedWith404
|
||||
}
|
||||
return nil, fmt.Errorf("server responded with %d", response.Status)
|
||||
} else {
|
||||
return nil, ErrInvalidServerResponse
|
||||
return nil, errors.New(fmt.Sprintf("server responded with %d", response.Status))
|
||||
}
|
||||
|
||||
return nil, ErrInvalidServerResponse
|
||||
@@ -133,13 +129,13 @@ func (wac *Conn) decryptBinaryMessage(msg []byte) (*binary.Node, error) {
|
||||
// message decrypt
|
||||
d, err := cbc.Decrypt(wac.session.EncKey, nil, msg[32:])
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("decrypting message with AES-CBC failed: %w", err)
|
||||
return nil, errors.Wrap(err, "decrypting message with AES-CBC failed")
|
||||
}
|
||||
|
||||
// message unmarshal
|
||||
message, err := binary.Unmarshal(d)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not decode binary: %w", err)
|
||||
return nil, errors.Wrap(err, "could not decode binary")
|
||||
}
|
||||
|
||||
return message, nil
|
||||
|
||||
133
vendor/github.com/Rhymen/go-whatsapp/session.go
generated
vendored
@@ -18,7 +18,7 @@ import (
|
||||
)
|
||||
|
||||
//represents the WhatsAppWeb client version
|
||||
var waVersion = []int{2, 2100, 6}
|
||||
var waVersion = []int{2, 2121, 6}
|
||||
|
||||
/*
|
||||
Session contains session individual information. To be able to resume the connection without scanning the qr code
|
||||
@@ -141,7 +141,7 @@ func CheckCurrentServerVersion() ([]int, error) {
|
||||
SetClientName sets the long and short client names that are sent to WhatsApp when logging in and displayed in the
|
||||
WhatsApp Web device list. As the values are only sent when logging in, changing them after logging in is not possible.
|
||||
*/
|
||||
func (wac *Conn) SetClientName(long, short, version string) error {
|
||||
func (wac *Conn) SetClientName(long, short string, version string) error {
|
||||
if wac.session != nil && (wac.session.EncKey != nil || wac.session.MacKey != nil) {
|
||||
return fmt.Errorf("cannot change client name after logging in")
|
||||
}
|
||||
@@ -157,28 +157,6 @@ func (wac *Conn) SetClientVersion(major int, minor int, patch int) {
|
||||
waVersion = []int{major, minor, patch}
|
||||
}
|
||||
|
||||
func (wac *Conn) adminInitRequest(clientId string) (string, time.Duration, error) {
|
||||
login := []interface{}{"admin", "init", waVersion, []string{wac.longClientName, wac.shortClientName, wac.clientVersion}, clientId, true}
|
||||
loginChan, err := wac.writeJson(login)
|
||||
if err != nil {
|
||||
return "", 0, fmt.Errorf("error writing login: %v\n", err)
|
||||
}
|
||||
|
||||
var r string
|
||||
select {
|
||||
case r = <-loginChan:
|
||||
case <-time.After(wac.msgTimeout):
|
||||
return "", 0, fmt.Errorf("login connection timed out")
|
||||
}
|
||||
|
||||
var resp map[string]interface{}
|
||||
if err = json.Unmarshal([]byte(r), &resp); err != nil {
|
||||
return "", 0, fmt.Errorf("error decoding login resp: %v\n", err)
|
||||
}
|
||||
|
||||
return resp["ref"].(string), time.Duration(resp["ttl"].(float64)) * time.Millisecond, nil
|
||||
}
|
||||
|
||||
// GetClientVersion returns WhatsApp client version
|
||||
func (wac *Conn) GetClientVersion() []int {
|
||||
return waVersion
|
||||
@@ -208,10 +186,6 @@ github.com/Baozisoftware/qrcode-terminal-go Example login procedure:
|
||||
fmt.Printf("login successful, session: %v\n", session)
|
||||
*/
|
||||
func (wac *Conn) Login(qrChan chan<- string) (Session, error) {
|
||||
return wac.LoginWithRetry(qrChan, 0)
|
||||
}
|
||||
|
||||
func (wac *Conn) LoginWithRetry(qrChan chan<- string, maxRetries int) (Session, error) {
|
||||
session := Session{}
|
||||
//Makes sure that only a single Login or Restore can happen at the same time
|
||||
if !atomic.CompareAndSwapUint32(&wac.sessionLock, 0, 1) {
|
||||
@@ -239,6 +213,30 @@ func (wac *Conn) LoginWithRetry(qrChan chan<- string, maxRetries int) (Session,
|
||||
}
|
||||
|
||||
session.ClientId = base64.StdEncoding.EncodeToString(clientId)
|
||||
login := []interface{}{"admin", "init", waVersion, []string{wac.longClientName, wac.shortClientName, wac.clientVersion}, session.ClientId, true}
|
||||
loginChan, err := wac.writeJson(login)
|
||||
if err != nil {
|
||||
return session, fmt.Errorf("error writing login: %v\n", err)
|
||||
}
|
||||
|
||||
var r string
|
||||
select {
|
||||
case r = <-loginChan:
|
||||
case <-time.After(wac.msgTimeout):
|
||||
return session, fmt.Errorf("login connection timed out")
|
||||
}
|
||||
|
||||
var resp map[string]interface{}
|
||||
if err = json.Unmarshal([]byte(r), &resp); err != nil {
|
||||
return session, fmt.Errorf("error decoding login resp: %v\n", err)
|
||||
}
|
||||
|
||||
var ref string
|
||||
if rref, ok := resp["ref"].(string); ok {
|
||||
ref = rref
|
||||
} else {
|
||||
return session, fmt.Errorf("error decoding login resp: invalid resp['ref']\n")
|
||||
}
|
||||
|
||||
priv, pub, err := curve25519.GenerateKey()
|
||||
if err != nil {
|
||||
@@ -251,35 +249,18 @@ func (wac *Conn) LoginWithRetry(qrChan chan<- string, maxRetries int) (Session,
|
||||
wac.listener.m["s1"] = s1
|
||||
wac.listener.Unlock()
|
||||
|
||||
ref, ttl, err := wac.adminInitRequest(session.ClientId)
|
||||
if err != nil {
|
||||
return session, err
|
||||
}
|
||||
qrChan <- fmt.Sprintf("%v,%v,%v", ref, base64.StdEncoding.EncodeToString(pub[:]), session.ClientId)
|
||||
|
||||
wac.loginSessionLock.Lock()
|
||||
defer wac.loginSessionLock.Unlock()
|
||||
var resp2 []interface{}
|
||||
For:
|
||||
for {
|
||||
select {
|
||||
case r1 := <-s1:
|
||||
if err := json.Unmarshal([]byte(r1), &resp2); err != nil {
|
||||
return session, fmt.Errorf("error decoding qr code resp: %v", err)
|
||||
}
|
||||
break For
|
||||
case <-time.After(ttl):
|
||||
maxRetries--
|
||||
if maxRetries < 0 {
|
||||
_, _ = wac.Disconnect()
|
||||
return session, ErrLoginTimedOut
|
||||
}
|
||||
ref, ttl, err = wac.adminInitRequest(session.ClientId)
|
||||
if err != nil {
|
||||
return session, err
|
||||
}
|
||||
qrChan <- fmt.Sprintf("%v,%v,%v", ref, base64.StdEncoding.EncodeToString(pub[:]), session.ClientId)
|
||||
select {
|
||||
case r1 := <-s1:
|
||||
wac.loginSessionLock.Lock()
|
||||
defer wac.loginSessionLock.Unlock()
|
||||
if err := json.Unmarshal([]byte(r1), &resp2); err != nil {
|
||||
return session, fmt.Errorf("error decoding qr code resp: %v", err)
|
||||
}
|
||||
case <-time.After(time.Duration(resp["ttl"].(float64)) * time.Millisecond):
|
||||
return session, fmt.Errorf("qr code scan timed out")
|
||||
}
|
||||
|
||||
info := resp2[1].(map[string]interface{})
|
||||
@@ -408,12 +389,14 @@ func (wac *Conn) Restore() error {
|
||||
|
||||
select {
|
||||
case r := <-initChan:
|
||||
resp := StatusResponse{RequestType: "init"}
|
||||
var resp map[string]interface{}
|
||||
if err = json.Unmarshal([]byte(r), &resp); err != nil {
|
||||
return fmt.Errorf("error decoding login connResp: %v\n", err)
|
||||
} else if resp.Status != 200 {
|
||||
}
|
||||
|
||||
if int(resp["status"].(float64)) != 200 {
|
||||
wac.timeTag = ""
|
||||
return resp
|
||||
return fmt.Errorf("init responded with %d", resp["status"])
|
||||
}
|
||||
case <-time.After(wac.msgTimeout):
|
||||
wac.timeTag = ""
|
||||
@@ -433,11 +416,12 @@ func (wac *Conn) Restore() error {
|
||||
//check for an error message
|
||||
select {
|
||||
case r := <-loginChan:
|
||||
resp := StatusResponse{RequestType: "admin login"}
|
||||
var resp map[string]interface{}
|
||||
if err = json.Unmarshal([]byte(r), &resp); err != nil {
|
||||
return fmt.Errorf("error decoding login connResp: %v\n", err)
|
||||
} else if resp.Status != 200 {
|
||||
return fmt.Errorf("admin login errored: %w", wac.getAdminLoginResponseError(resp))
|
||||
}
|
||||
if int(resp["status"].(float64)) != 200 {
|
||||
return fmt.Errorf("admin login responded with %d", int(resp["status"].(float64)))
|
||||
}
|
||||
default:
|
||||
// not even an error message – assume timeout
|
||||
@@ -472,13 +456,15 @@ func (wac *Conn) Restore() error {
|
||||
//check for login 200 --> login success
|
||||
select {
|
||||
case r := <-loginChan:
|
||||
resp := StatusResponse{RequestType: "admin login"}
|
||||
var resp map[string]interface{}
|
||||
if err = json.Unmarshal([]byte(r), &resp); err != nil {
|
||||
wac.timeTag = ""
|
||||
return fmt.Errorf("error decoding login connResp: %v\n", err)
|
||||
} else if resp.Status != 200 {
|
||||
}
|
||||
|
||||
if int(resp["status"].(float64)) != 200 {
|
||||
wac.timeTag = ""
|
||||
return fmt.Errorf("admin login errored: %w", wac.getAdminLoginResponseError(resp))
|
||||
return fmt.Errorf("admin login responded with %d", resp["status"])
|
||||
}
|
||||
case <-time.After(wac.msgTimeout):
|
||||
wac.timeTag = ""
|
||||
@@ -498,22 +484,6 @@ func (wac *Conn) Restore() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (wac *Conn) getAdminLoginResponseError(resp StatusResponse) error {
|
||||
switch resp.Status {
|
||||
case 400:
|
||||
return ErrBadRequest
|
||||
case 401:
|
||||
return ErrUnpaired
|
||||
case 403:
|
||||
return fmt.Errorf("%w - tos: %d", ErrAccessDenied, resp.TermsOfService)
|
||||
case 405:
|
||||
return ErrLoggedIn
|
||||
case 409:
|
||||
return ErrReplaced
|
||||
}
|
||||
return fmt.Errorf("%d (unknown error)", status)
|
||||
}
|
||||
|
||||
func (wac *Conn) resolveChallenge(challenge string) error {
|
||||
decoded, err := base64.StdEncoding.DecodeString(challenge)
|
||||
if err != nil {
|
||||
@@ -531,11 +501,12 @@ func (wac *Conn) resolveChallenge(challenge string) error {
|
||||
|
||||
select {
|
||||
case r := <-challengeChan:
|
||||
resp := StatusResponse{RequestType: "login challenge"}
|
||||
var resp map[string]interface{}
|
||||
if err := json.Unmarshal([]byte(r), &resp); err != nil {
|
||||
return fmt.Errorf("error decoding login resp: %v\n", err)
|
||||
} else if resp.Status != 200 {
|
||||
return resp
|
||||
}
|
||||
if int(resp["status"].(float64)) != 200 {
|
||||
return fmt.Errorf("challenge responded with %d\n", resp["status"])
|
||||
}
|
||||
case <-time.After(wac.msgTimeout):
|
||||
return fmt.Errorf("connection timed out")
|
||||
|
||||
101
vendor/github.com/Rhymen/go-whatsapp/write.go
generated
vendored
@@ -6,23 +6,39 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/gorilla/websocket"
|
||||
"time"
|
||||
|
||||
"github.com/Rhymen/go-whatsapp/binary"
|
||||
"github.com/Rhymen/go-whatsapp/crypto/cbc"
|
||||
"github.com/gorilla/websocket"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
func (wac *Conn) addListener(ch chan string, messageTag string) {
|
||||
wac.listener.Lock()
|
||||
wac.listener.m[messageTag] = ch
|
||||
wac.listener.Unlock()
|
||||
}
|
||||
|
||||
func (wac *Conn) removeListener(answerMessageTag string) {
|
||||
wac.listener.Lock()
|
||||
delete(wac.listener.m, answerMessageTag)
|
||||
wac.listener.Unlock()
|
||||
}
|
||||
|
||||
//writeJson enqueues a json message into the writeChan
|
||||
func (wac *Conn) writeJson(data []interface{}) (<-chan string, error) {
|
||||
|
||||
ch := make(chan string, 1)
|
||||
|
||||
wac.writerLock.Lock()
|
||||
defer wac.writerLock.Unlock()
|
||||
|
||||
d, err := json.Marshal(data)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
close(ch)
|
||||
return ch, err
|
||||
}
|
||||
|
||||
ts := time.Now().Unix()
|
||||
@@ -34,9 +50,13 @@ func (wac *Conn) writeJson(data []interface{}) (<-chan string, error) {
|
||||
wac.timeTag = tss[len(tss)-3:]
|
||||
}
|
||||
|
||||
ch, err := wac.write(websocket.TextMessage, messageTag, bytes)
|
||||
wac.addListener(ch, messageTag)
|
||||
|
||||
err = wac.write(websocket.TextMessage, bytes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
close(ch)
|
||||
wac.removeListener(messageTag)
|
||||
return ch, err
|
||||
}
|
||||
|
||||
wac.msgCount++
|
||||
@@ -44,8 +64,12 @@ func (wac *Conn) writeJson(data []interface{}) (<-chan string, error) {
|
||||
}
|
||||
|
||||
func (wac *Conn) writeBinary(node binary.Node, metric metric, flag flag, messageTag string) (<-chan string, error) {
|
||||
|
||||
ch := make(chan string, 1)
|
||||
|
||||
if len(messageTag) < 2 {
|
||||
return nil, ErrMissingMessageTag
|
||||
close(ch)
|
||||
return ch, ErrMissingMessageTag
|
||||
}
|
||||
|
||||
wac.writerLock.Lock()
|
||||
@@ -53,16 +77,21 @@ func (wac *Conn) writeBinary(node binary.Node, metric metric, flag flag, message
|
||||
|
||||
data, err := wac.encryptBinaryMessage(node)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("encryptBinaryMessage(node) failed: %w", err)
|
||||
close(ch)
|
||||
return ch, errors.Wrap(err, "encryptBinaryMessage(node) failed")
|
||||
}
|
||||
|
||||
bytes := []byte(messageTag + ",")
|
||||
bytes = append(bytes, byte(metric), byte(flag))
|
||||
bytes = append(bytes, data...)
|
||||
|
||||
ch, err := wac.write(websocket.BinaryMessage, messageTag, bytes)
|
||||
wac.addListener(ch, messageTag)
|
||||
|
||||
err = wac.write(websocket.BinaryMessage, bytes)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to write message: %w", err)
|
||||
close(ch)
|
||||
wac.removeListener(messageTag)
|
||||
return ch, errors.Wrap(err, "failed to write message")
|
||||
}
|
||||
|
||||
wac.msgCount++
|
||||
@@ -70,17 +99,23 @@ func (wac *Conn) writeBinary(node binary.Node, metric metric, flag flag, message
|
||||
}
|
||||
|
||||
func (wac *Conn) sendKeepAlive() error {
|
||||
|
||||
respChan := make(chan string, 1)
|
||||
wac.addListener(respChan, "!")
|
||||
|
||||
bytes := []byte("?,,")
|
||||
respChan, err := wac.write(websocket.TextMessage, "!", bytes)
|
||||
err := wac.write(websocket.TextMessage, bytes)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error sending keepAlive: %w", err)
|
||||
close(respChan)
|
||||
wac.removeListener("!")
|
||||
return errors.Wrap(err, "error sending keepAlive")
|
||||
}
|
||||
|
||||
select {
|
||||
case resp := <-respChan:
|
||||
msecs, err := strconv.ParseInt(resp, 10, 64)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Error converting time string to uint: %w", err)
|
||||
return errors.Wrap(err, "Error converting time string to uint")
|
||||
}
|
||||
wac.ServerLastSeen = time.Unix(msecs/1000, (msecs%1000)*int64(time.Millisecond))
|
||||
|
||||
@@ -95,70 +130,58 @@ func (wac *Conn) sendKeepAlive() error {
|
||||
When phone is unreachable, WhatsAppWeb sends ["admin","test"] time after time to try a successful contact.
|
||||
Tested with Airplane mode and no connection at all.
|
||||
*/
|
||||
func (wac *Conn) sendAdminTest() error {
|
||||
func (wac *Conn) sendAdminTest() (bool, error) {
|
||||
data := []interface{}{"admin", "test"}
|
||||
|
||||
r, err := wac.writeJson(data)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error sending admin test: %w", err)
|
||||
return false, errors.Wrap(err, "error sending admin test")
|
||||
}
|
||||
|
||||
var response []interface{}
|
||||
var resp string
|
||||
|
||||
select {
|
||||
case resp = <-r:
|
||||
case resp := <-r:
|
||||
if err := json.Unmarshal([]byte(resp), &response); err != nil {
|
||||
return fmt.Errorf("error decoding response message: %v\n", err)
|
||||
return false, fmt.Errorf("error decoding response message: %v\n", err)
|
||||
}
|
||||
case <-time.After(wac.msgTimeout):
|
||||
return ErrConnectionTimeout
|
||||
return false, ErrConnectionTimeout
|
||||
}
|
||||
|
||||
if len(response) == 2 && response[0].(string) == "Pong" && response[1].(bool) == true {
|
||||
return nil
|
||||
return true, nil
|
||||
} else {
|
||||
return fmt.Errorf("unexpected ping response: %s", resp)
|
||||
return false, nil
|
||||
}
|
||||
}
|
||||
|
||||
func (wac *Conn) write(messageType int, answerMessageTag string, data []byte) (<-chan string, error) {
|
||||
var ch chan string
|
||||
if answerMessageTag != "" {
|
||||
ch = make(chan string, 1)
|
||||
|
||||
wac.listener.Lock()
|
||||
wac.listener.m[answerMessageTag] = ch
|
||||
wac.listener.Unlock()
|
||||
}
|
||||
func (wac *Conn) write(messageType int, data []byte) error {
|
||||
|
||||
if wac == nil || wac.ws == nil {
|
||||
return nil, ErrInvalidWebsocket
|
||||
return ErrInvalidWebsocket
|
||||
}
|
||||
|
||||
wac.ws.Lock()
|
||||
err := wac.ws.conn.WriteMessage(messageType, data)
|
||||
wac.ws.Unlock()
|
||||
|
||||
if err != nil {
|
||||
if answerMessageTag != "" {
|
||||
wac.listener.Lock()
|
||||
delete(wac.listener.m, answerMessageTag)
|
||||
wac.listener.Unlock()
|
||||
}
|
||||
return nil, fmt.Errorf("error writing to websocket: %w", err)
|
||||
return errors.Wrap(err, "error writing to websocket")
|
||||
}
|
||||
return ch, nil
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (wac *Conn) encryptBinaryMessage(node binary.Node) (data []byte, err error) {
|
||||
b, err := binary.Marshal(node)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("binary node marshal failed: %w", err)
|
||||
return nil, errors.Wrap(err, "binary node marshal failed")
|
||||
}
|
||||
|
||||
cipher, err := cbc.Encrypt(wac.session.EncKey, nil, b)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("encrypt failed: %w", err)
|
||||
return nil, errors.Wrap(err, "encrypt failed")
|
||||
}
|
||||
|
||||
h := hmac.New(sha256.New, wac.session.MacKey)
|
||||
|
||||
5
vendor/github.com/SevereCloud/vksdk/v2/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
_vendor/
|
||||
vendor/
|
||||
*.out
|
||||
coverage.txt
|
||||
*.test
|
||||
102
vendor/github.com/SevereCloud/vksdk/v2/.golangci.yml
generated
vendored
Normal file
@@ -0,0 +1,102 @@
|
||||
---
|
||||
linters:
|
||||
disable-all: true
|
||||
enable:
|
||||
- bodyclose
|
||||
- deadcode
|
||||
- errcheck
|
||||
- gochecknoglobals
|
||||
- goconst
|
||||
- gocritic
|
||||
- gofmt
|
||||
- goimports
|
||||
- goprintffuncname
|
||||
- gosec
|
||||
- gosimple
|
||||
- govet
|
||||
- ineffassign
|
||||
- misspell
|
||||
- nakedret
|
||||
- prealloc
|
||||
- staticcheck
|
||||
- structcheck
|
||||
- stylecheck
|
||||
- typecheck
|
||||
- unconvert
|
||||
- unparam
|
||||
- unused
|
||||
- varcheck
|
||||
- whitespace
|
||||
- wsl
|
||||
- godot
|
||||
- asciicheck
|
||||
- nolintlint
|
||||
- gofumpt
|
||||
- goerr113
|
||||
- tparallel
|
||||
- errorlint
|
||||
- paralleltest
|
||||
- forbidigo
|
||||
- makezero
|
||||
- thelper
|
||||
- predeclared
|
||||
- ifshort
|
||||
- revive
|
||||
- durationcheck
|
||||
- gomoddirectives
|
||||
- importas
|
||||
- nilerr
|
||||
- revive
|
||||
- wastedassign
|
||||
|
||||
# - wrapcheck # TODO: v3 Fix
|
||||
# - testpackage # TODO: Fix testpackage
|
||||
# - nestif # TODO: Fix nestif
|
||||
# - noctx # TODO: Fix noctx
|
||||
|
||||
# don't enable:
|
||||
# - depguard
|
||||
# - dogsled
|
||||
# - dupl
|
||||
# - funlen
|
||||
# - gochecknoinits
|
||||
# - gocognit
|
||||
# - gocyclo
|
||||
# - godox
|
||||
# - gomnd
|
||||
# - lll
|
||||
# - rowserrcheck
|
||||
# - scopelint
|
||||
# - gomodguard
|
||||
# - exhaustive
|
||||
# - nlreturn
|
||||
# - gci
|
||||
# - exhaustivestruct
|
||||
# - cyclop
|
||||
# - promlinter
|
||||
# - tagliatelle
|
||||
|
||||
# depricated
|
||||
# - maligned
|
||||
# - interfacer
|
||||
# - golint
|
||||
|
||||
issues:
|
||||
exclude-rules:
|
||||
- path: _test\.go
|
||||
linters:
|
||||
- gocyclo
|
||||
- errcheck
|
||||
- dupl
|
||||
- gosec
|
||||
|
||||
- linters:
|
||||
- errcheck
|
||||
source: ".((os\\.)?std(out|err)\\..*|.*Close|.*Flush|os\\.Remove(All)?|
|
||||
.*printf?|os\\.(Un)?Setenv)."
|
||||
|
||||
- linters:
|
||||
- stylecheck
|
||||
text: "ST1003:.*(Ts|ts).*TS"
|
||||
|
||||
exclude-use-default: false
|
||||
2
vendor/github.com/SevereCloud/vksdk/v2/.markdownlint.yml
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
no-hard-tabs: false
|
||||
20
vendor/github.com/SevereCloud/vksdk/v2/.travis.yml
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
language: go
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.cache/go-build
|
||||
- $HOME/gopath/pkg/mod
|
||||
|
||||
go:
|
||||
- 1.x
|
||||
|
||||
before_script:
|
||||
- git fetch --depth=1 origin +refs/tags/*:refs/tags/*
|
||||
- git describe --tags $(git rev-list --tags --max-count=1) --always
|
||||
|
||||
script:
|
||||
- go test -v -race -coverprofile=coverage.txt -covermode=atomic -p=1 ./...
|
||||
|
||||
after_success:
|
||||
- bash <(curl -s https://codecov.io/bash)
|
||||
92
vendor/github.com/SevereCloud/vksdk/v2/CONTRIBUTING.md
generated
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
# Contributing
|
||||
|
||||
## Настройки
|
||||
|
||||
`vksdk` написан на [Go](https://golang.org/).
|
||||
|
||||
Требования:
|
||||
|
||||
- [Go 1.13+](https://golang.org/doc/install)
|
||||
- [golangci-lint](https://github.com/golangci/golangci-lint)
|
||||
- [global .gitignore](https://help.github.com/en/articles/ignoring-files#create-a-global-gitignore)
|
||||
|
||||
Сделайте fork и клонируйте `vksdk` куда угодно:
|
||||
|
||||
```sh
|
||||
git clone git@github.com:<your name>/vksdk.git
|
||||
```
|
||||
|
||||
Создайте новую ветку
|
||||
|
||||
```sh
|
||||
git checkout -b <name_of_your_new_branch>
|
||||
```
|
||||
|
||||
## Тестирование изменений
|
||||
|
||||
Для начала проверьте ваш код с помощью
|
||||
[golangci-lint](https://github.com/golangci/golangci-lint)
|
||||
|
||||
```sh
|
||||
golangci-lint run
|
||||
```
|
||||
|
||||
Затем можно запускать тесты
|
||||
|
||||
```sh
|
||||
# SERVICE_TOKEN=""
|
||||
# GROUP_TOKEN=""
|
||||
# CLIENT_SECRET=""
|
||||
# USER_TOKEN=""
|
||||
# WIDGET_TOKEN=""
|
||||
# CLIENT_ID="123456"
|
||||
# GROUP_ID="123456"
|
||||
# ACCOUNT_ID="123456"
|
||||
go test ./...
|
||||
```
|
||||
|
||||
Задавать токены не обязательно - тесты с их использованием будут пропущены.
|
||||
**Не** рекомендуется задавать свой `USER_TOKEN`, так как тесты делают много
|
||||
страшных вещей.
|
||||
|
||||
Настройки для VSCode `.vscode/setting.json`
|
||||
|
||||
```json
|
||||
{
|
||||
"go.testEnvVars": {
|
||||
"SERVICE_TOKEN": "",
|
||||
"WIDGET_TOKEN": "",
|
||||
"GROUP_TOKEN": "",
|
||||
"CLIENT_SECRET": "",
|
||||
"USER_TOKEN": "",
|
||||
"CLIENT_ID": "123456",
|
||||
"GROUP_ID": "123456",
|
||||
"ACCOUNT_ID": "123456"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Создание коммита
|
||||
|
||||
Сообщения коммитов должны быть хорошо отформатированы, и чтобы сделать их
|
||||
«стандартизированным», мы используем
|
||||
[Conventional Commits](https://www.conventionalcommits.org/ru).
|
||||
|
||||
```sh
|
||||
git add .
|
||||
git commit
|
||||
```
|
||||
|
||||
## Отправьте pull request
|
||||
|
||||
Отправьте изменения в ваш репозиторий
|
||||
|
||||
```sh
|
||||
git push origin <name_of_your_new_branch>
|
||||
```
|
||||
|
||||
Затем откройте [pull request](https://github.com/SevereCloud/vksdk/pulls)
|
||||
с веткой:
|
||||
|
||||
- `master` если это багфикс
|
||||
- `dev-v1.2.3` если это новая фича
|
||||
21
vendor/github.com/SevereCloud/vksdk/v2/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2020 Daniil Suvorov
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
125
vendor/github.com/SevereCloud/vksdk/v2/README.md
generated
vendored
Normal file
@@ -0,0 +1,125 @@
|
||||
# VK SDK for Golang
|
||||
|
||||
[](https://travis-ci.com/SevereCloud/vksdk)
|
||||
[](https://pkg.go.dev/github.com/SevereCloud/vksdk/v2?tab=subdirectories)
|
||||
[](https://vk.com/dev/)
|
||||
[](https://codecov.io/gh/SevereCloud/vksdk)
|
||||
[](https://vk.me/join/AJQ1d6Or8Q00Y_CSOESfbqGt)
|
||||
[](https://github.com/SevereCloud/vksdk/releases)
|
||||
[](https://github.com/SevereCloud/vksdk/blob/master/LICENSE)
|
||||
|
||||
**VK SDK for Golang** ready implementation of the main VK API functions for Go.
|
||||
|
||||
[Russian documentation](https://github.com/SevereCloud/vksdk/wiki)
|
||||
|
||||
## Features
|
||||
|
||||
Version API 5.131.
|
||||
|
||||
- [API](https://pkg.go.dev/github.com/SevereCloud/vksdk/v2/api)
|
||||
- 400+ methods
|
||||
- Ability to change the request handler
|
||||
- Ability to modify HTTP client
|
||||
- Request Limiter
|
||||
- Token pool
|
||||
- [Callback API](https://pkg.go.dev/github.com/SevereCloud/vksdk/v2/callback)
|
||||
- Tracking tool for users activity in your VK communities
|
||||
- Supports all events
|
||||
- Auto setting callback
|
||||
- [Bots Long Poll API](https://pkg.go.dev/github.com/SevereCloud/vksdk/v2/longpoll-bot)
|
||||
- Allows you to work with community events in real time
|
||||
- Supports all events
|
||||
- Ability to modify HTTP client
|
||||
- [User Long Poll API](https://pkg.go.dev/github.com/SevereCloud/vksdk/v2/longpoll-user)
|
||||
- Allows you to work with user events in real time
|
||||
- Ability to modify HTTP client
|
||||
- [Streaming API](https://pkg.go.dev/github.com/SevereCloud/vksdk/v2/streaming)
|
||||
- Receiving public data from VK by specified keywords
|
||||
- Ability to modify HTTP client
|
||||
- [FOAF](https://pkg.go.dev/github.com/SevereCloud/vksdk/v2/foaf)
|
||||
- Machine-readable ontology describing persons
|
||||
- Works with users and groups
|
||||
- The only place to get page creation date
|
||||
- [Games](https://pkg.go.dev/github.com/SevereCloud/vksdk/v2/games)
|
||||
- Checking launch parameters
|
||||
- Intermediate http handler
|
||||
- [VK Mini Apps](https://pkg.go.dev/github.com/SevereCloud/vksdk/v2/vkapps)
|
||||
- Checking launch parameters
|
||||
- Intermediate http handler
|
||||
- [Payments API](https://pkg.go.dev/github.com/SevereCloud/vksdk/v2/payments)
|
||||
- Processes payment notifications
|
||||
- [Marusia Skills](https://pkg.go.dev/github.com/SevereCloud/vksdk/v2/marusia)
|
||||
- For creating Marusia Skills
|
||||
- Support SSML
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
# go mod init mymodulename
|
||||
go get github.com/SevereCloud/vksdk/v2@latest
|
||||
```
|
||||
|
||||
## Use by
|
||||
|
||||
- [Joe](https://github.com/go-joe/joe) adapter: <https://github.com/tdakkota/joe-vk-adapter>
|
||||
- [Logrus](https://github.com/sirupsen/logrus) hook: <https://github.com/SevereCloud/vkrus>
|
||||
|
||||
### Example
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log"
|
||||
|
||||
"github.com/SevereCloud/vksdk/v2/api"
|
||||
"github.com/SevereCloud/vksdk/v2/api/params"
|
||||
"github.com/SevereCloud/vksdk/v2/events"
|
||||
"github.com/SevereCloud/vksdk/v2/longpoll-bot"
|
||||
)
|
||||
|
||||
func main() {
|
||||
token := "<TOKEN>" // use os.Getenv("TOKEN")
|
||||
vk := api.NewVK(token)
|
||||
|
||||
// get information about the group
|
||||
group, err := vk.GroupsGetByID(nil)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
// Initializing Long Poll
|
||||
lp, err := longpoll.NewLongPoll(vk, group[0].ID)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
// New message event
|
||||
lp.MessageNew(func(_ context.Context, obj events.MessageNewObject) {
|
||||
log.Printf("%d: %s", obj.Message.PeerID, obj.Message.Text)
|
||||
|
||||
if obj.Message.Text == "ping" {
|
||||
b := params.NewMessagesSendBuilder()
|
||||
b.Message("pong")
|
||||
b.RandomID(0)
|
||||
b.PeerID(obj.Message.PeerID)
|
||||
|
||||
_, err := vk.MessagesSend(b.Params)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// Run Bots Long Poll
|
||||
log.Println("Start Long Poll")
|
||||
if err := lp.Run(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## LICENSE
|
||||
|
||||
[](https://app.fossa.io/projects/git%2Bgithub.com%2FSevereCloud%2Fvksdk?ref=badge_large)
|
||||
555
vendor/github.com/SevereCloud/vksdk/v2/api/README.md
generated
vendored
Normal file
@@ -0,0 +1,555 @@
|
||||
# API
|
||||
|
||||
[](https://pkg.go.dev/github.com/SevereCloud/vksdk/v2/api)
|
||||
[](https://vk.com/dev/first_guide)
|
||||
|
||||
Данная библиотека поддерживает версию API **5.122**.
|
||||
|
||||
## Запросы
|
||||
|
||||
В начале необходимо инициализировать api с помощью [ключа доступа](https://vk.com/dev/access_token):
|
||||
|
||||
```go
|
||||
vk := api.NewVK("<TOKEN>")
|
||||
```
|
||||
|
||||
### Запросы к API
|
||||
|
||||
- `users.get` -> `vk.UsersGet(api.Params{})`
|
||||
- `groups.get` с extended=1 -> `vk.GroupsGetExtended(api.Params{})`
|
||||
|
||||
Список всех методов можно найти на
|
||||
[данной странице](https://pkg.go.dev/github.com/SevereCloud/vksdk/v2/api?tab=doc#VK).
|
||||
|
||||
Пример запроса [`users.get`](https://vk.com/dev/users.get)
|
||||
|
||||
```go
|
||||
users, err := vk.UsersGet(api.Params{
|
||||
"user_ids": 1,
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
```
|
||||
|
||||
### Параметры
|
||||
|
||||
[](https://pkg.go.dev/github.com/SevereCloud/vksdk/v2/api/params)
|
||||
|
||||
Модуль params предназначен для генерации параметров запроса.
|
||||
|
||||
```go
|
||||
// import "github.com/SevereCloud/vksdk/v2/api/params"
|
||||
|
||||
b := params.NewMessageSendBuilder()
|
||||
b.PeerID(123)
|
||||
b.Random(0)
|
||||
b.DontParseLinks(false)
|
||||
b.Message("Test message")
|
||||
|
||||
res, err = api.MessageSend(b.Params)
|
||||
```
|
||||
|
||||
### Обработка ошибок
|
||||
|
||||
[](https://vk.com/dev/errors)
|
||||
|
||||
Обработка ошибок полностью поддерживает методы
|
||||
[go 1.13](https://blog.golang.org/go1.13-errors)
|
||||
|
||||
```go
|
||||
if errors.Is(err, api.ErrAuth) {
|
||||
log.Println("User authorization failed")
|
||||
}
|
||||
```
|
||||
|
||||
```go
|
||||
var e *api.Error
|
||||
if errors.As(err, &e) {
|
||||
switch e.Code {
|
||||
case api.ErrCaptcha:
|
||||
log.Println("Требуется ввод кода с картинки (Captcha)")
|
||||
log.Printf("sid %s img %s", e.CaptchaSID, e.CaptchaImg)
|
||||
case 1:
|
||||
log.Println("Код ошибки 1")
|
||||
default:
|
||||
log.Printf("Ошибка %d %s", e.Code, e.Text)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Для Execute существует отдельная ошибка `ExecuteErrors`
|
||||
|
||||
### Запрос любого метода
|
||||
|
||||
Пример запроса [users.get](https://vk.com/dev/users.get)
|
||||
|
||||
```go
|
||||
// Определяем структуру, которую вернет API
|
||||
var response []object.UsersUser
|
||||
var err api.Error
|
||||
|
||||
params := api.Params{
|
||||
"user_ids": 1,
|
||||
}
|
||||
|
||||
// Делаем запрос
|
||||
err = vk.RequestUnmarshal("users.get", &response, params)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
log.Print(response)
|
||||
```
|
||||
|
||||
### Execute
|
||||
|
||||
[](https://pkg.go.dev/github.com/SevereCloud/vksdk/v2/api#VK.Execute)
|
||||
[](https://vk.com/dev/execute)
|
||||
|
||||
Универсальный метод, который позволяет запускать последовательность других
|
||||
методов, сохраняя и фильтруя промежуточные результаты.
|
||||
|
||||
```go
|
||||
var response struct {
|
||||
Text string `json:"text"`
|
||||
}
|
||||
|
||||
err = vk.Execute(`return {text: "hello"};`, &response)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
log.Print(response.Text)
|
||||
```
|
||||
|
||||
### Обработчик запросов
|
||||
|
||||
Обработчик `vk.Handler` должен возвращать структуру ответа от VK API и ошибку.
|
||||
В качестве параметров принимать название метода и параметры.
|
||||
|
||||
```go
|
||||
vk.Handler = func(method string, params ...api.Params) (api.Response, error) {
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
Это может потребоваться, если вы можете поставить свой обработчик с
|
||||
[fasthttp](https://github.com/valyala/fasthttp) и логгером.
|
||||
|
||||
Стандартный обработчик использует [encoding/json](https://pkg.go.dev/net/http)
|
||||
и [net/http](https://pkg.go.dev/net/http). В стандартном обработчике можно
|
||||
настроить ограничитель запросов и HTTP клиент.
|
||||
|
||||
#### Ограничитель запросов
|
||||
|
||||
К методам API ВКонтакте (за исключением методов из секций secure и ads) с
|
||||
ключом доступа пользователя или сервисным ключом доступа можно обращаться не
|
||||
чаще 3 раз в секунду. Для ключа доступа сообщества ограничение составляет 20
|
||||
запросов в секунду. Если логика Вашего приложения подразумевает вызов
|
||||
нескольких методов подряд, имеет смысл обратить внимание на метод execute. Он
|
||||
позволяет совершить до 25 обращений к разным методам в рамках одного запроса.
|
||||
|
||||
Для методов секции ads действуют собственные ограничения, ознакомиться с ними
|
||||
Вы можете на [этой странице](https://vk.com/dev/ads_limits).
|
||||
|
||||
Максимальное число обращений к методам секции secure зависит от числа
|
||||
пользователей, установивших приложение. Если приложение установило меньше 10
|
||||
000 человек, то можно совершать 5 запросов в секунду, до 100 000 — 8 запросов,
|
||||
до 1 000 000 — 20 запросов, больше 1 млн. — 35 запросов в секунду.
|
||||
|
||||
Если Вы превысите частотное ограничение, сервер вернет ошибку с кодом
|
||||
**6: "Too many requests per second."**.
|
||||
|
||||
С помощью параметра `vk.Limit` можно установить ограничение на определенное
|
||||
количество запросов в секунду
|
||||
|
||||
### HTTP client
|
||||
|
||||
В модуле реализована возможность изменять HTTP клиент с помощью параметра
|
||||
`vk.Client`
|
||||
|
||||
Пример прокси
|
||||
|
||||
```go
|
||||
|
||||
dialer, _ := proxy.SOCKS5("tcp", "127.0.0.1:9050", nil, proxy.Direct)
|
||||
httpTransport := &http.Transport{
|
||||
Dial: dialer.Dial,
|
||||
}
|
||||
httpTransport.Dial = dialer.Dial
|
||||
|
||||
client := &http.Client{
|
||||
Transport: httpTransport,
|
||||
}
|
||||
|
||||
vk.Client = client
|
||||
```
|
||||
|
||||
### Ошибка с Captcha
|
||||
|
||||
[](https://vk.com/dev/captcha_error)
|
||||
|
||||
Если какое-либо действие (например, отправка сообщения) выполняется
|
||||
пользователем слишком часто, то запрос к API может возвращать ошибку
|
||||
"Captcha needed". При этом пользователю понадобится ввести код с изображения
|
||||
и отправить запрос повторно с передачей введенного кода Captcha в параметрах
|
||||
запроса.
|
||||
|
||||
**Код ошибки**: 14
|
||||
**Текст ошибки**: Captcha needed
|
||||
|
||||
Если возникает данная ошибка, то в сообщении об ошибке передаются также
|
||||
следующие параметры:
|
||||
|
||||
- `err.CaptchaSID` - идентификатор captcha
|
||||
- `err.CaptchaImg` - ссылка на изображение, которое нужно показать
|
||||
пользователю, чтобы он ввел текст с этого изображения.
|
||||
|
||||
В этом случае следует запросить пользователя ввести текст с изображения
|
||||
`err.CaptchaImg` и повторить запрос, добавив в него параметры:
|
||||
|
||||
- `captcha_sid` - полученный идентификатор
|
||||
- `captcha_key` - текст, который ввел пользователь
|
||||
|
||||
## Загрузка файлов
|
||||
|
||||
[](https://vk.com/dev/upload_files)
|
||||
|
||||
### 1. Загрузка фотографий в альбом
|
||||
|
||||
Допустимые форматы: JPG, PNG, GIF.
|
||||
Файл объемом не более 50 МБ, соотношение сторон не менее 1:20
|
||||
|
||||
Загрузка фотографий в альбом для текущего пользователя:
|
||||
|
||||
```go
|
||||
photosPhoto, err = vk.UploadPhoto(albumID, response.Body)
|
||||
```
|
||||
|
||||
Загрузка фотографий в альбом для группы:
|
||||
|
||||
```go
|
||||
photosPhoto, err = vk.UploadPhotoGroup(groupID, albumID, response.Body)
|
||||
```
|
||||
|
||||
### 2. Загрузка фотографий на стену
|
||||
|
||||
Допустимые форматы: JPG, PNG, GIF.
|
||||
Файл объемом не более 50 МБ, соотношение сторон не менее 1:20
|
||||
|
||||
```go
|
||||
photosPhoto, err = vk.UploadWallPhoto(response.Body)
|
||||
```
|
||||
|
||||
Загрузка фотографий в альбом для группы:
|
||||
|
||||
```go
|
||||
photosPhoto, err = vk.UploadWallPhotoGroup(groupID, response.Body)
|
||||
```
|
||||
|
||||
### 3. Загрузка главной фотографии пользователя или сообщества
|
||||
|
||||
Допустимые форматы: JPG, PNG, GIF.
|
||||
Ограничения: размер не менее 200x200px, соотношение сторон от 0.25 до 3,
|
||||
сумма высоты и ширины не более 14000px, файл объемом не более 50 МБ,
|
||||
соотношение сторон не менее 1:20.
|
||||
|
||||
Загрузка главной фотографии пользователя
|
||||
|
||||
```go
|
||||
photosPhoto, err = vk.UploadUserPhoto(file)
|
||||
```
|
||||
|
||||
Загрузка фотографии пользователя или сообщества с миниатюрой
|
||||
|
||||
```go
|
||||
photosPhoto, err = vk.UploadOwnerPhoto(ownerID, squareСrop,file)
|
||||
```
|
||||
|
||||
Для загрузки главной фотографии сообщества необходимо передать его идентификатор
|
||||
со знаком «минус» в параметре `ownerID`.
|
||||
|
||||
Дополнительно Вы можете передать параметр `squareСrop` в формате "x,y,w" (без
|
||||
кавычек), где x и y — координаты верхнего правого угла миниатюры, а w — сторона
|
||||
квадрата. Тогда для фотографии также будет подготовлена квадратная миниатюра.
|
||||
|
||||
Загрузка фотографии пользователя или сообщества без миниатюры:
|
||||
|
||||
```go
|
||||
photosPhoto, err = vk.UploadOwnerPhoto(ownerID, "", file)
|
||||
```
|
||||
|
||||
### 4. Загрузка фотографии в личное сообщение
|
||||
|
||||
Допустимые форматы: JPG, PNG, GIF.
|
||||
Ограничения: сумма высоты и ширины не более 14000px, файл объемом
|
||||
не более 50 МБ, соотношение сторон не менее 1:20.
|
||||
|
||||
```go
|
||||
photosPhoto, err = vk.UploadMessagesPhoto(peerID, file)
|
||||
```
|
||||
|
||||
### 5. Загрузка главной фотографии для чата
|
||||
|
||||
Допустимые форматы: JPG, PNG, GIF.
|
||||
Ограничения: размер не менее 200x200px, соотношение сторон от 0.25 до 3, сумма
|
||||
высоты и ширины не более 14000px, файл объемом не более 50 МБ, соотношение
|
||||
сторон не менее 1:20.
|
||||
|
||||
Без обрезки:
|
||||
|
||||
```go
|
||||
messageInfo, err = vk.UploadChatPhoto(peerID, file)
|
||||
```
|
||||
|
||||
С обрезкой:
|
||||
|
||||
```go
|
||||
messageInfo, err = vk.UploadChatPhotoCrop(peerID, cropX, cropY, cropWidth, file)
|
||||
```
|
||||
|
||||
### 6. Загрузка фотографии для товара
|
||||
|
||||
Допустимые форматы: JPG, PNG, GIF.
|
||||
Ограничения: минимальный размер фото — 400x400px, сумма высоты и ширины
|
||||
не более 14000px, файл объемом не более 50 МБ, соотношение сторон не менее 1:20.
|
||||
|
||||
Если Вы хотите загрузить основную фотографию товара, необходимо передать
|
||||
параметр `mainPhoto = true`. Если фотография не основная, она не будет обрезаться.
|
||||
|
||||
Без обрезки:
|
||||
|
||||
```go
|
||||
photosPhoto, err = vk.UploadMarketPhoto(groupID, mainPhoto, file)
|
||||
```
|
||||
|
||||
Основную фотографию с обрезкой:
|
||||
|
||||
```go
|
||||
photosPhoto, err = vk.UploadMarketPhotoCrop(groupID, cropX, cropY, cropWidth, file)
|
||||
```
|
||||
|
||||
### 7. Загрузка фотографии для подборки товаров
|
||||
|
||||
Допустимые форматы: JPG, PNG, GIF.
|
||||
Ограничения: минимальный размер фото — 1280x720px, сумма высоты и ширины
|
||||
не более 14000px, файл объемом не более 50 МБ, соотношение сторон не менее 1:20.
|
||||
|
||||
```go
|
||||
photosPhoto, err = vk.UploadMarketAlbumPhoto(groupID, file)
|
||||
```
|
||||
|
||||
### 9. Загрузка видеозаписей
|
||||
|
||||
Допустимые форматы: AVI, MP4, 3GP, MPEG, MOV, MP3, FLV, WMV.
|
||||
|
||||
[Параметры](https://vk.com/dev/video.save)
|
||||
|
||||
```go
|
||||
videoUploadResponse, err = vk.UploadVideo(params, file)
|
||||
```
|
||||
|
||||
После загрузки видеозапись проходит обработку и в списке видеозаписей может
|
||||
появиться спустя некоторое время.
|
||||
|
||||
### 10. Загрузка документов
|
||||
|
||||
Допустимые форматы: любые форматы за исключением mp3 и исполняемых файлов.
|
||||
Ограничения: файл объемом не более 200 МБ.
|
||||
|
||||
`title` - название файла с расширением
|
||||
|
||||
`tags` - метки для поиска
|
||||
|
||||
`typeDoc` - тип документа.
|
||||
|
||||
- doc - обычный документ;
|
||||
- audio_message - голосовое сообщение
|
||||
|
||||
Загрузить документ:
|
||||
|
||||
```go
|
||||
docsDoc, err = vk.UploadDoc(title, tags, file)
|
||||
```
|
||||
|
||||
Загрузить документ в группу:
|
||||
|
||||
```go
|
||||
docsDoc, err = vk.UploadGroupDoc(groupID, title, tags, file)
|
||||
```
|
||||
|
||||
Загрузить документ, для последующей отправки документа на стену:
|
||||
|
||||
```go
|
||||
docsDoc, err = vk.UploadWallDoc(title, tags, file)
|
||||
```
|
||||
|
||||
Загрузить документ в группу, для последующей отправки документа на стену:
|
||||
|
||||
```go
|
||||
docsDoc, err = vk.UploadGroupWallDoc(groupID, title, tags, file)
|
||||
```
|
||||
|
||||
Загрузить документ в личное сообщение:
|
||||
|
||||
```go
|
||||
docsDoc, err = vk.UploadMessagesDoc(peerID, typeDoc, title, tags, file)
|
||||
```
|
||||
|
||||
### 11. Загрузка обложки сообщества
|
||||
|
||||
Допустимые форматы: JPG, PNG, GIF.
|
||||
Ограничения: минимальный размер фото — 795x200px, сумма высоты и ширины
|
||||
не более 14000px, файл объемом не более 50 МБ. Рекомендуемый размер: 1590x400px.
|
||||
В сутки можно загрузить не более 1500 обложек.
|
||||
|
||||
Необходимо указать координаты обрезки фотографии в параметрах
|
||||
`cropX`, `cropY`, `cropX2`, `cropY2`.
|
||||
|
||||
```go
|
||||
photo, err = vk.UploadOwnerCoverPhoto(groupID, cropX, cropY, cropX2, cropY2, file)
|
||||
```
|
||||
|
||||
### 12. Загрузка аудиосообщения
|
||||
|
||||
Допустимые форматы: Ogg Opus.
|
||||
Ограничения: sample rate 16kHz, variable bitrate 16 kbit/s, длительность
|
||||
не более 5 минут.
|
||||
|
||||
```go
|
||||
docsDoc, err = vk.UploadMessagesDoc(peerID, "audio_message", title, tags, file)
|
||||
```
|
||||
|
||||
### 13. Загрузка истории
|
||||
|
||||
Допустимые форматы: JPG, PNG, GIF.
|
||||
Ограничения: сумма высоты и ширины не более 14000px, файл объемом
|
||||
не более 10МБ. Формат видео: h264 video, aac audio,
|
||||
максимальное разрешение 720х1280, 30fps.
|
||||
|
||||
Загрузить историю с фотографией. [Параметры](https://vk.com/dev/stories.getPhotoUploadServer)
|
||||
|
||||
```go
|
||||
uploadInfo, err = vk.UploadStoriesPhoto(params, file)
|
||||
```
|
||||
|
||||
Загрузить историю с видео. [Параметры](https://vk.com/dev/stories.getVideoUploadServer)
|
||||
|
||||
```go
|
||||
uploadInfo, err = vk.UploadStoriesVideo(params, file)
|
||||
```
|
||||
|
||||
### Загрузка фоновой фотографии в опрос
|
||||
|
||||
Допустимые форматы: JPG, PNG, GIF.
|
||||
Ограничения: сумма высоты и ширины не более 14000px, файл объемом не более 50 МБ,
|
||||
соотношение сторон не менее 1:20.
|
||||
|
||||
```go
|
||||
photosPhoto, err = vk.UploadPollsPhoto(file)
|
||||
```
|
||||
|
||||
```go
|
||||
photosPhoto, err = vk.UploadOwnerPollsPhoto(ownerID, file)
|
||||
```
|
||||
|
||||
Для загрузки фотографии сообщества необходимо передать его идентификатор со
|
||||
знаком «минус» в параметре `ownerID`.
|
||||
|
||||
### Загрузка фотографии для карточки
|
||||
|
||||
Для карточек используются квадратные изображения минимальным размером 400х400.
|
||||
В случае загрузки неквадратного изображения, оно будет обрезано до квадратного.
|
||||
Допустимые форматы: JPG, PNG, BMP, TIFF или GIF.
|
||||
Ограничения: файл объемом не более 5 МБ.
|
||||
|
||||
```go
|
||||
photo, err = vk.UploadPrettyCardsPhoto(file)
|
||||
```
|
||||
|
||||
### Загрузка обложки для формы
|
||||
|
||||
Для форм сбора заявок используются прямоугольные изображения размером 1200х300.
|
||||
В случае загрузки изображения другого размера, оно будет автоматически обрезано
|
||||
до требуемого.
|
||||
Допустимые форматы: JPG, PNG, BMP, TIFF или GIF.
|
||||
Ограничения: файл объемом не более 5 МБ.
|
||||
|
||||
```go
|
||||
photo, err = vk.UploadLeadFormsPhoto(file)
|
||||
```
|
||||
|
||||
Полученные данные можно использовать в методах
|
||||
[leadForms.create](https://vk.com/dev/leadForms.create)
|
||||
и
|
||||
[leadForms.edit](https://vk.com/dev/leadForms.edit).
|
||||
|
||||
Полученные данные можно использовать в методах
|
||||
[prettyCards.create](https://vk.com/dev/prettyCards.create)
|
||||
и
|
||||
[prettyCards.edit](https://vk.com/dev/prettyCards.edit).
|
||||
|
||||
### Загрузки фотографии в коллекцию приложения для виджетов приложений сообществ
|
||||
|
||||
`imageType` (string) - тип изображения.
|
||||
|
||||
Возможные значения:
|
||||
|
||||
- 24x24
|
||||
- 50x50
|
||||
- 160x160
|
||||
- 160x240
|
||||
- 510x128
|
||||
|
||||
```go
|
||||
image, err = vk.UploadAppImage(imageType, file)
|
||||
```
|
||||
|
||||
### Загрузки фотографии в коллекцию сообщества для виджетов приложений сообществ
|
||||
|
||||
`imageType` (string) - тип изображения.
|
||||
|
||||
Возможные значения:
|
||||
|
||||
- 24x24
|
||||
- 50x50
|
||||
- 160x160
|
||||
- 160x240
|
||||
- 510x128
|
||||
|
||||
```go
|
||||
image, err = vk.UploadGroupAppImage(imageType, file)
|
||||
```
|
||||
|
||||
#### Примеры
|
||||
|
||||
Загрузка фотографии в альбом:
|
||||
|
||||
```go
|
||||
response, err := os.Open("photo.jpeg")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
defer response.Body.Close()
|
||||
|
||||
photo, err = vk.UploadPhoto(albumID, response.Body)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
```
|
||||
|
||||
Загрузка фотографии в альбом из интернета:
|
||||
|
||||
```go
|
||||
response, err := http.Get("https://sun9-45.userapi.com/c638629/v638629852/2afba/o-dvykjSIB4.jpg")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
defer response.Body.Close()
|
||||
|
||||
photo, err = vk.UploadPhoto(albumID, response.Body)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
```
|
||||
196
vendor/github.com/SevereCloud/vksdk/v2/api/account.go
generated
vendored
Normal file
@@ -0,0 +1,196 @@
|
||||
package api // import "github.com/SevereCloud/vksdk/v2/api"
|
||||
|
||||
import (
|
||||
"github.com/SevereCloud/vksdk/v2/object"
|
||||
)
|
||||
|
||||
// AccountBan account.ban.
|
||||
//
|
||||
// https://vk.com/dev/account.ban
|
||||
func (vk *VK) AccountBan(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("account.ban", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AccountChangePasswordResponse struct.
|
||||
type AccountChangePasswordResponse struct {
|
||||
Token string `json:"token"`
|
||||
}
|
||||
|
||||
// AccountChangePassword changes a user password after access is successfully restored with the auth.restore method.
|
||||
//
|
||||
// https://vk.com/dev/account.changePassword
|
||||
func (vk *VK) AccountChangePassword(params Params) (response AccountChangePasswordResponse, err error) {
|
||||
err = vk.RequestUnmarshal("account.changePassword", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AccountGetActiveOffersResponse struct.
|
||||
type AccountGetActiveOffersResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.AccountOffer `json:"items"`
|
||||
}
|
||||
|
||||
// AccountGetActiveOffers returns a list of active ads (offers).
|
||||
// If the user fulfill their conditions, he will be able to get
|
||||
// the appropriate number of votes to his balance.
|
||||
//
|
||||
// https://vk.com/dev/account.getActiveOffers
|
||||
func (vk *VK) AccountGetActiveOffers(params Params) (response AccountGetActiveOffersResponse, err error) {
|
||||
err = vk.RequestUnmarshal("account.getActiveOffers", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AccountGetAppPermissions gets settings of the user in this application.
|
||||
//
|
||||
// https://vk.com/dev/account.getAppPermissions
|
||||
func (vk *VK) AccountGetAppPermissions(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("account.getAppPermissions", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AccountGetBannedResponse struct.
|
||||
type AccountGetBannedResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []int `json:"items"`
|
||||
object.ExtendedResponse
|
||||
}
|
||||
|
||||
// AccountGetBanned returns a user's blacklist.
|
||||
//
|
||||
// https://vk.com/dev/account.getBanned
|
||||
func (vk *VK) AccountGetBanned(params Params) (response AccountGetBannedResponse, err error) {
|
||||
err = vk.RequestUnmarshal("account.getBanned", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AccountGetCountersResponse struct.
|
||||
type AccountGetCountersResponse object.AccountAccountCounters
|
||||
|
||||
// AccountGetCounters returns non-null values of user counters.
|
||||
//
|
||||
// https://vk.com/dev/account.getCounters
|
||||
func (vk *VK) AccountGetCounters(params Params) (response AccountGetCountersResponse, err error) {
|
||||
err = vk.RequestUnmarshal("account.getCounters", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AccountGetInfoResponse struct.
|
||||
type AccountGetInfoResponse object.AccountInfo
|
||||
|
||||
// AccountGetInfo returns current account info.
|
||||
//
|
||||
// https://vk.com/dev/account.getInfo
|
||||
func (vk *VK) AccountGetInfo(params Params) (response AccountGetInfoResponse, err error) {
|
||||
err = vk.RequestUnmarshal("account.getInfo", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AccountGetProfileInfoResponse struct.
|
||||
type AccountGetProfileInfoResponse object.AccountUserSettings
|
||||
|
||||
// AccountGetProfileInfo returns the current account info.
|
||||
//
|
||||
// https://vk.com/dev/account.getProfileInfo
|
||||
func (vk *VK) AccountGetProfileInfo(params Params) (response AccountGetProfileInfoResponse, err error) {
|
||||
err = vk.RequestUnmarshal("account.getProfileInfo", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AccountGetPushSettingsResponse struct.
|
||||
type AccountGetPushSettingsResponse object.AccountPushSettings
|
||||
|
||||
// AccountGetPushSettings account.getPushSettings Gets settings of push notifications.
|
||||
//
|
||||
// https://vk.com/dev/account.getPushSettings
|
||||
func (vk *VK) AccountGetPushSettings(params Params) (response AccountGetPushSettingsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("account.getPushSettings", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AccountRegisterDevice subscribes an iOS/Android/Windows/Mac based device to receive push notifications.
|
||||
//
|
||||
// https://vk.com/dev/account.registerDevice
|
||||
func (vk *VK) AccountRegisterDevice(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("account.registerDevice", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AccountSaveProfileInfoResponse struct.
|
||||
type AccountSaveProfileInfoResponse struct {
|
||||
Changed object.BaseBoolInt `json:"changed"`
|
||||
NameRequest object.AccountNameRequest `json:"name_request"`
|
||||
}
|
||||
|
||||
// AccountSaveProfileInfo edits current profile info.
|
||||
//
|
||||
// https://vk.com/dev/account.saveProfileInfo
|
||||
func (vk *VK) AccountSaveProfileInfo(params Params) (response AccountSaveProfileInfoResponse, err error) {
|
||||
err = vk.RequestUnmarshal("account.saveProfileInfo", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AccountSetInfo allows to edit the current account info.
|
||||
//
|
||||
// https://vk.com/dev/account.setInfo
|
||||
func (vk *VK) AccountSetInfo(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("account.setInfo", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AccountSetNameInMenu sets an application screen name
|
||||
// (up to 17 characters), that is shown to the user in the left menu.
|
||||
//
|
||||
// https://vk.com/dev/account.setNameInMenu
|
||||
func (vk *VK) AccountSetNameInMenu(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("account.setNameInMenu", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AccountSetOffline marks a current user as offline.
|
||||
//
|
||||
// https://vk.com/dev/account.setOffline
|
||||
func (vk *VK) AccountSetOffline(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("account.setOffline", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AccountSetOnline marks the current user as online for 5 minutes.
|
||||
//
|
||||
// https://vk.com/dev/account.setOnline
|
||||
func (vk *VK) AccountSetOnline(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("account.setOnline", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AccountSetPushSettings change push settings.
|
||||
//
|
||||
// https://vk.com/dev/account.setPushSettings
|
||||
func (vk *VK) AccountSetPushSettings(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("account.setPushSettings", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AccountSetSilenceMode mutes push notifications for the set period of time.
|
||||
//
|
||||
// https://vk.com/dev/account.setSilenceMode
|
||||
func (vk *VK) AccountSetSilenceMode(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("account.setSilenceMode", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AccountUnban account.unban.
|
||||
//
|
||||
// https://vk.com/dev/account.unban
|
||||
func (vk *VK) AccountUnban(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("account.unban", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AccountUnregisterDevice unsubscribes a device from push notifications.
|
||||
//
|
||||
// https://vk.com/dev/account.unregisterDevice
|
||||
func (vk *VK) AccountUnregisterDevice(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("account.unregisterDevice", &response, params)
|
||||
return
|
||||
}
|
||||
581
vendor/github.com/SevereCloud/vksdk/v2/api/ads.go
generated
vendored
Normal file
@@ -0,0 +1,581 @@
|
||||
package api // import "github.com/SevereCloud/vksdk/v2/api"
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/SevereCloud/vksdk/v2/object"
|
||||
)
|
||||
|
||||
// AdsAddOfficeUsersItem struct.
|
||||
type AdsAddOfficeUsersItem struct {
|
||||
OK object.BaseBoolInt
|
||||
Error AdsError
|
||||
}
|
||||
|
||||
// UnmarshalJSON func.
|
||||
func (r *AdsAddOfficeUsersItem) UnmarshalJSON(data []byte) (err error) {
|
||||
if r.OK.UnmarshalJSON(data) != nil {
|
||||
return json.Unmarshal(data, &r.Error)
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// AdsAddOfficeUsersResponse struct.
|
||||
type AdsAddOfficeUsersResponse []AdsAddOfficeUsersItem
|
||||
|
||||
// AdsAddOfficeUsers adds managers and/or supervisors to advertising account.
|
||||
//
|
||||
// https://vk.com/dev/ads.addOfficeUsers
|
||||
func (vk *VK) AdsAddOfficeUsers(params Params) (response AdsAddOfficeUsersResponse, err error) {
|
||||
err = vk.RequestUnmarshal("ads.addOfficeUsers", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AdsCheckLinkResponse struct.
|
||||
type AdsCheckLinkResponse struct {
|
||||
// link status
|
||||
Status object.AdsLinkStatus `json:"status"`
|
||||
|
||||
// (if status = disallowed) — description of the reason
|
||||
Description string `json:"description,omitempty"`
|
||||
|
||||
// (if the end link differs from original and status = allowed) — end link.
|
||||
RedirectURL string `json:"redirect_url,omitempty"`
|
||||
}
|
||||
|
||||
// AdsCheckLink allows to check the ad link.
|
||||
//
|
||||
// https://vk.com/dev/ads.checkLink
|
||||
func (vk *VK) AdsCheckLink(params Params) (response AdsCheckLinkResponse, err error) {
|
||||
err = vk.RequestUnmarshal("ads.checkLink", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AdsCreateAdsResponse struct.
|
||||
type AdsCreateAdsResponse []struct {
|
||||
ID int `json:"id"`
|
||||
AdsError
|
||||
}
|
||||
|
||||
// AdsCreateAds creates ads.
|
||||
//
|
||||
// Please note! Maximum allowed number of ads created in one request is 5.
|
||||
// Minimum size of ad audience is 50 people.
|
||||
//
|
||||
// https://vk.com/dev/ads.createAds
|
||||
func (vk *VK) AdsCreateAds(params Params) (response AdsCreateAdsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("ads.createAds", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AdsCreateCampaignsResponse struct.
|
||||
type AdsCreateCampaignsResponse []struct {
|
||||
ID int `json:"id"`
|
||||
AdsError
|
||||
}
|
||||
|
||||
// AdsCreateCampaigns creates advertising campaigns.
|
||||
//
|
||||
// Please note! Allowed number of campaigns created in one request is 50.
|
||||
//
|
||||
// https://vk.com/dev/ads.createCampaigns
|
||||
func (vk *VK) AdsCreateCampaigns(params Params) (response AdsCreateCampaignsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("ads.createCampaigns", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AdsCreateClientsResponse struct.
|
||||
type AdsCreateClientsResponse []struct {
|
||||
ID int `json:"id"`
|
||||
AdsError
|
||||
}
|
||||
|
||||
// AdsCreateClients creates clients of an advertising agency.
|
||||
//
|
||||
// Available only for advertising agencies.
|
||||
//
|
||||
// Please note! Allowed number of clients created in one request is 50.
|
||||
//
|
||||
// https://vk.com/dev/ads.createClients
|
||||
func (vk *VK) AdsCreateClients(params Params) (response AdsCreateClientsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("ads.createClients", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AdsCreateLookalikeRequestResponse struct.
|
||||
type AdsCreateLookalikeRequestResponse struct {
|
||||
RequestID int `json:"request_id"`
|
||||
}
|
||||
|
||||
// AdsCreateLookalikeRequest creates a request to find a similar audience.
|
||||
//
|
||||
// https://vk.com/dev/ads.createLookalikeRequest
|
||||
func (vk *VK) AdsCreateLookalikeRequest(params Params) (response AdsCreateLookalikeRequestResponse, err error) {
|
||||
err = vk.RequestUnmarshal("ads.createLookalikeRequest", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AdsCreateTargetGroupResponse struct.
|
||||
type AdsCreateTargetGroupResponse struct {
|
||||
ID int `json:"id"`
|
||||
}
|
||||
|
||||
// AdsCreateTargetGroup Creates a group to re-target ads for users who visited
|
||||
// advertiser's site (viewed information about the product, registered, etc.).
|
||||
//
|
||||
// When executed successfully this method returns user accounting code on
|
||||
// advertiser's site. You shall add this code to the site page, so users
|
||||
// registered in VK will be added to the created target group after they visit
|
||||
// this page.
|
||||
//
|
||||
// Use ads.importTargetContacts method to import existing user contacts to
|
||||
// the group.
|
||||
//
|
||||
// Please note! Maximum allowed number of groups for one advertising
|
||||
// account is 100.
|
||||
//
|
||||
// https://vk.com/dev/ads.createTargetGroup
|
||||
func (vk *VK) AdsCreateTargetGroup(params Params) (response AdsCreateTargetGroupResponse, err error) {
|
||||
err = vk.RequestUnmarshal("ads.createTargetGroup", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AdsCreateTargetPixelResponse struct.
|
||||
type AdsCreateTargetPixelResponse struct {
|
||||
ID int `json:"id"`
|
||||
Pixel string `json:"pixel"`
|
||||
}
|
||||
|
||||
// AdsCreateTargetPixel Creates retargeting pixel.
|
||||
//
|
||||
// Method returns pixel code for users accounting on the advertiser site.
|
||||
// Authorized VK users who visited the page with pixel code on it will be
|
||||
// added to retargeting audience with corresponding rules. You can also use
|
||||
// Open API, ads.importTargetContacts method and loading from file.
|
||||
//
|
||||
// Maximum pixels number per advertising account is 25.
|
||||
//
|
||||
// https://vk.com/dev/ads.createTargetPixel
|
||||
func (vk *VK) AdsCreateTargetPixel(params Params) (response AdsCreateTargetPixelResponse, err error) {
|
||||
err = vk.RequestUnmarshal("ads.createTargetPixel", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AdsDeleteAdsResponse struct.
|
||||
//
|
||||
// Each response is 0 — deleted successfully, or an error code.
|
||||
type AdsDeleteAdsResponse []ErrorType
|
||||
|
||||
// AdsDeleteAds archives ads.
|
||||
//
|
||||
// Warning! Maximum allowed number of ads archived in one request is 100.
|
||||
//
|
||||
// https://vk.com/dev/ads.deleteAds
|
||||
func (vk *VK) AdsDeleteAds(params Params) (response AdsDeleteAdsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("ads.deleteAds", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AdsDeleteCampaignsResponse struct.
|
||||
//
|
||||
// Each response is 0 — deleted successfully, or an error code.
|
||||
type AdsDeleteCampaignsResponse []ErrorType
|
||||
|
||||
// AdsDeleteCampaigns archives advertising campaigns.
|
||||
//
|
||||
//
|
||||
// Warning! Maximum allowed number of campaigns archived in one request is 100.
|
||||
//
|
||||
// https://vk.com/dev/ads.deleteCampaigns
|
||||
func (vk *VK) AdsDeleteCampaigns(params Params) (response AdsDeleteCampaignsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("ads.deleteCampaigns", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AdsDeleteClientsResponse struct.
|
||||
//
|
||||
// Each response is 0 — deleted successfully, or an error code.
|
||||
type AdsDeleteClientsResponse []ErrorType
|
||||
|
||||
// AdsDeleteClients archives clients of an advertising agency.
|
||||
//
|
||||
// Available only for advertising agencies.
|
||||
//
|
||||
// Please note! Maximum allowed number of clients edited in one request is 10.
|
||||
//
|
||||
// https://vk.com/dev/ads.deleteClients
|
||||
func (vk *VK) AdsDeleteClients(params Params) (response AdsDeleteClientsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("ads.deleteClients", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AdsDeleteTargetGroup deletes target group.
|
||||
//
|
||||
// https://vk.com/dev/ads.deleteTargetGroup
|
||||
func (vk *VK) AdsDeleteTargetGroup(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("ads.deleteTargetGroup", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AdsDeleteTargetPixel deletes target pixel.
|
||||
//
|
||||
// https://vk.com/dev/ads.deleteTargetPixel
|
||||
func (vk *VK) AdsDeleteTargetPixel(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("ads.deleteTargetPixel", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AdsGetAccountsResponse struct.
|
||||
type AdsGetAccountsResponse []object.AdsAccount
|
||||
|
||||
// AdsGetAccounts returns a list of advertising accounts.
|
||||
//
|
||||
// https://vk.com/dev/ads.getAccounts
|
||||
func (vk *VK) AdsGetAccounts(params Params) (response AdsGetAccountsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("ads.getAccounts", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AdsGetAdsResponse struct.
|
||||
type AdsGetAdsResponse []object.AdsAd
|
||||
|
||||
// AdsGetAds returns a list of ads.
|
||||
//
|
||||
// https://vk.com/dev/ads.getAds
|
||||
func (vk *VK) AdsGetAds(params Params) (response AdsGetAdsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("ads.getAds", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AdsGetAdsLayoutResponse struct.
|
||||
type AdsGetAdsLayoutResponse []object.AdsAdLayout
|
||||
|
||||
// AdsGetAdsLayout returns descriptions of ad layouts.
|
||||
//
|
||||
// https://vk.com/dev/ads.getAdsLayout
|
||||
func (vk *VK) AdsGetAdsLayout(params Params) (response AdsGetAdsLayoutResponse, err error) {
|
||||
err = vk.RequestUnmarshal("ads.getAdsLayout", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// TODO: AdsGetAdsTargetingResponse struct.
|
||||
// type AdsGetAdsTargetingResponse struct{}
|
||||
|
||||
// TODO: AdsGetAdsTargeting ...
|
||||
//
|
||||
// https://vk.com/dev/ads.getAdsTargeting
|
||||
// func (vk *VK) AdsGetAdsTargeting(params Params) (response AdsGetAdsTargetingResponse, err error) {
|
||||
// err = vk.RequestUnmarshal("ads.getAdsTargeting", &response, params)
|
||||
// return
|
||||
// }
|
||||
|
||||
// TODO: AdsGetBudgetResponse struct.
|
||||
// type AdsGetBudgetResponse struct{}
|
||||
|
||||
// TODO: AdsGetBudget ...
|
||||
//
|
||||
// https://vk.com/dev/ads.getBudget
|
||||
// func (vk *VK) AdsGetBudget(params Params) (response AdsGetBudgetResponse, err error) {
|
||||
// err = vk.RequestUnmarshal("ads.getBudget", &response, params)
|
||||
// return
|
||||
// }
|
||||
|
||||
// TODO: AdsGetCampaignsResponse struct.
|
||||
// type AdsGetCampaignsResponse struct{}
|
||||
|
||||
// TODO: AdsGetCampaigns ...
|
||||
//
|
||||
// https://vk.com/dev/ads.getCampaigns
|
||||
// func (vk *VK) AdsGetCampaigns(params Params) (response AdsGetCampaignsResponse, err error) {
|
||||
// err = vk.RequestUnmarshal("ads.getCampaigns", &response, params)
|
||||
// return
|
||||
// }
|
||||
|
||||
// TODO: AdsGetCategoriesResponse struct.
|
||||
// type AdsGetCategoriesResponse struct{}
|
||||
|
||||
// TODO: AdsGetCategories ...
|
||||
//
|
||||
// https://vk.com/dev/ads.getCategories
|
||||
// func (vk *VK) AdsGetCategories(params Params) (response AdsGetCategoriesResponse, err error) {
|
||||
// err = vk.RequestUnmarshal("ads.getCategories", &response, params)
|
||||
// return
|
||||
// }
|
||||
|
||||
// TODO: AdsGetClientsResponse struct.
|
||||
// type AdsGetClientsResponse struct{}
|
||||
|
||||
// TODO: AdsGetClients ...
|
||||
//
|
||||
// https://vk.com/dev/ads.getClients
|
||||
// func (vk *VK) AdsGetClients(params Params) (response AdsGetClientsResponse, err error) {
|
||||
// err = vk.RequestUnmarshal("ads.getClients", &response, params)
|
||||
// return
|
||||
// }
|
||||
|
||||
// TODO: AdsGetDemographicsResponse struct.
|
||||
// type AdsGetDemographicsResponse struct{}
|
||||
|
||||
// TODO: AdsGetDemographics ...
|
||||
//
|
||||
// https://vk.com/dev/ads.getDemographics
|
||||
// func (vk *VK) AdsGetDemographics(params Params) (response AdsGetDemographicsResponse, err error) {
|
||||
// err = vk.RequestUnmarshal("ads.getDemographics", &response, params)
|
||||
// return
|
||||
// }
|
||||
|
||||
// TODO: AdsGetFloodStatsResponse struct.
|
||||
// type AdsGetFloodStatsResponse struct{}
|
||||
|
||||
// TODO: AdsGetFloodStats ...
|
||||
//
|
||||
// https://vk.com/dev/ads.getFloodStats
|
||||
// func (vk *VK) AdsGetFloodStats(params Params) (response AdsGetFloodStatsResponse, err error) {
|
||||
// err = vk.RequestUnmarshal("ads.getFloodStats", &response, params)
|
||||
// return
|
||||
// }
|
||||
|
||||
// TODO: AdsGetLookalikeRequestsResponse struct.
|
||||
// type AdsGetLookalikeRequestsResponse struct{}
|
||||
|
||||
// TODO: AdsGetLookalikeRequests ...
|
||||
//
|
||||
// https://vk.com/dev/ads.getLookalikeRequests
|
||||
// func (vk *VK) AdsGetLookalikeRequests(params Params) (response AdsGetLookalikeRequestsResponse, err error) {
|
||||
// err = vk.RequestUnmarshal("ads.getLookalikeRequests", &response, params)
|
||||
// return
|
||||
// }
|
||||
|
||||
// AdsGetMusiciansResponse struct.
|
||||
type AdsGetMusiciansResponse struct {
|
||||
Items []object.BaseObjectWithName
|
||||
}
|
||||
|
||||
// AdsGetMusicians returns a list of musicians.
|
||||
//
|
||||
// https://vk.com/dev/ads.getMusicians
|
||||
func (vk *VK) AdsGetMusicians(params Params) (response AdsGetMusiciansResponse, err error) {
|
||||
err = vk.RequestUnmarshal("ads.getMusicians", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// TODO: AdsGetOfficeUsersResponse struct.
|
||||
// type AdsGetOfficeUsersResponse struct{}
|
||||
|
||||
// TODO: AdsGetOfficeUsers ...
|
||||
//
|
||||
// https://vk.com/dev/ads.getOfficeUsers
|
||||
// func (vk *VK) AdsGetOfficeUsers(params Params) (response AdsGetOfficeUsersResponse, err error) {
|
||||
// err = vk.RequestUnmarshal("ads.getOfficeUsers", &response, params)
|
||||
// return
|
||||
// }
|
||||
|
||||
// TODO: AdsGetPostsReachResponse struct.
|
||||
// type AdsGetPostsReachResponse struct{}
|
||||
|
||||
// TODO: AdsGetPostsReach ...
|
||||
//
|
||||
// https://vk.com/dev/ads.getPostsReach
|
||||
// func (vk *VK) AdsGetPostsReach(params Params) (response AdsGetPostsReachResponse, err error) {
|
||||
// err = vk.RequestUnmarshal("ads.getPostsReach", &response, params)
|
||||
// return
|
||||
// }
|
||||
|
||||
// TODO: AdsGetRejectionReasonResponse struct.
|
||||
// type AdsGetRejectionReasonResponse struct{}
|
||||
|
||||
// TODO: AdsGetRejectionReason ...
|
||||
//
|
||||
// https://vk.com/dev/ads.getRejectionReason
|
||||
// func (vk *VK) AdsGetRejectionReason(params Params) (response AdsGetRejectionReasonResponse, err error) {
|
||||
// err = vk.RequestUnmarshal("ads.getRejectionReason", &response, params)
|
||||
// return
|
||||
// }
|
||||
|
||||
// TODO: AdsGetStatisticsResponse struct.
|
||||
// type AdsGetStatisticsResponse struct{}
|
||||
|
||||
// TODO: AdsGetStatistics ...
|
||||
//
|
||||
// https://vk.com/dev/ads.getStatistics
|
||||
// func (vk *VK) AdsGetStatistics(params Params) (response AdsGetStatisticsResponse, err error) {
|
||||
// err = vk.RequestUnmarshal("ads.getStatistics", &response, params)
|
||||
// return
|
||||
// }
|
||||
|
||||
// TODO: AdsGetSuggestionsResponse struct.
|
||||
// type AdsGetSuggestionsResponse struct{}
|
||||
|
||||
// TODO: AdsGetSuggestions ...
|
||||
//
|
||||
// https://vk.com/dev/ads.getSuggestions
|
||||
// func (vk *VK) AdsGetSuggestions(params Params) (response AdsGetSuggestionsResponse, err error) {
|
||||
// err = vk.RequestUnmarshal("ads.getSuggestions", &response, params)
|
||||
// return
|
||||
// }
|
||||
|
||||
// AdsGetTargetGroupsResponse struct.
|
||||
type AdsGetTargetGroupsResponse []object.AdsTargetGroup
|
||||
|
||||
// AdsGetTargetGroups returns a list of target groups.
|
||||
//
|
||||
// https://vk.com/dev/ads.getTargetGroups
|
||||
func (vk *VK) AdsGetTargetGroups(params Params) (response AdsGetTargetGroupsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("ads.getTargetGroups", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// TODO: AdsGetTargetPixelsResponse struct.
|
||||
// type AdsGetTargetPixelsResponse struct{}
|
||||
|
||||
// TODO: AdsGetTargetPixels ...
|
||||
//
|
||||
// https://vk.com/dev/ads.getTargetPixels
|
||||
// func (vk *VK) AdsGetTargetPixels(params Params) (response AdsGetTargetPixelsResponse, err error) {
|
||||
// err = vk.RequestUnmarshal("ads.getTargetPixels", &response, params)
|
||||
// return
|
||||
// }
|
||||
|
||||
// TODO: AdsGetTargetingStatsResponse struct.
|
||||
// type AdsGetTargetingStatsResponse struct{}
|
||||
|
||||
// TODO: AdsGetTargetingStats ...
|
||||
//
|
||||
// https://vk.com/dev/ads.getTargetingStats
|
||||
// func (vk *VK) AdsGetTargetingStats(params Params) (response AdsGetTargetingStatsResponse, err error) {
|
||||
// err = vk.RequestUnmarshal("ads.getTargetingStats", &response, params)
|
||||
// return
|
||||
// }
|
||||
|
||||
// TODO: AdsGetUploadURLResponse struct.
|
||||
// type AdsGetUploadURLResponse struct{}
|
||||
|
||||
// TODO: AdsGetUploadURL ...
|
||||
//
|
||||
// https://vk.com/dev/ads.getUploadURL
|
||||
// func (vk *VK) AdsGetUploadURL(params Params) (response AdsGetUploadURLResponse, err error) {
|
||||
// err = vk.RequestUnmarshal("ads.getUploadURL", &response, params)
|
||||
// return
|
||||
// }
|
||||
|
||||
// TODO: AdsGetVideoUploadURLResponse struct.
|
||||
// type AdsGetVideoUploadURLResponse struct{}
|
||||
|
||||
// TODO: AdsGetVideoUploadURL ...
|
||||
//
|
||||
// https://vk.com/dev/ads.getVideoUploadURL
|
||||
// func (vk *VK) AdsGetVideoUploadURL(params Params) (response AdsGetVideoUploadURLResponse, err error) {
|
||||
// err = vk.RequestUnmarshal("ads.getVideoUploadURL", &response, params)
|
||||
// return
|
||||
// }
|
||||
|
||||
// TODO: AdsImportTargetContactsResponse struct.
|
||||
// type AdsImportTargetContactsResponse struct{}
|
||||
|
||||
// TODO: AdsImportTargetContacts ...
|
||||
//
|
||||
// https://vk.com/dev/ads.importTargetContacts
|
||||
// func (vk *VK) AdsImportTargetContacts(params Params) (response AdsImportTargetContactsResponse, err error) {
|
||||
// err = vk.RequestUnmarshal("ads.importTargetContacts", &response, params)
|
||||
// return
|
||||
// }
|
||||
|
||||
// TODO: AdsRemoveOfficeUsersResponse struct.
|
||||
// type AdsRemoveOfficeUsersResponse struct{}
|
||||
|
||||
// TODO: AdsRemoveOfficeUsers ...
|
||||
//
|
||||
// https://vk.com/dev/ads.removeOfficeUsers
|
||||
// func (vk *VK) AdsRemoveOfficeUsers(params Params) (response AdsRemoveOfficeUsersResponse, err error) {
|
||||
// err = vk.RequestUnmarshal("ads.removeOfficeUsers", &response, params)
|
||||
// return
|
||||
// }
|
||||
|
||||
// AdsRemoveTargetContacts accepts the request to exclude the advertiser's
|
||||
// contacts from the retargeting audience.
|
||||
//
|
||||
// The maximum allowed number of contacts to be excluded by a single
|
||||
// request is 1000.
|
||||
//
|
||||
// Contacts are excluded within a few hours of the request.
|
||||
//
|
||||
// https://vk.com/dev/ads.removeTargetContacts
|
||||
func (vk *VK) AdsRemoveTargetContacts(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("ads.removeTargetContacts", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// TODO: AdsSaveLookalikeRequestResultResponse struct.
|
||||
// type AdsSaveLookalikeRequestResultResponse struct{}
|
||||
|
||||
// TODO: AdsSaveLookalikeRequestResult ...
|
||||
//
|
||||
// https://vk.com/dev/ads.saveLookalikeRequestResult
|
||||
// func (vk *VK) AdsSaveLookalikeRequestResult(params Params) (
|
||||
// response AdsSaveLookalikeRequestResultResponse,
|
||||
// err error,
|
||||
// ) {
|
||||
// err = vk.RequestUnmarshal("ads.saveLookalikeRequestResult", &response, params)
|
||||
// return
|
||||
// }
|
||||
|
||||
// TODO: AdsShareTargetGroupResponse struct.
|
||||
// type AdsShareTargetGroupResponse struct{}
|
||||
|
||||
// TODO: AdsShareTargetGroup ...
|
||||
//
|
||||
// https://vk.com/dev/ads.shareTargetGroup
|
||||
// func (vk *VK) AdsShareTargetGroup(params Params) (response AdsShareTargetGroupResponse, err error) {
|
||||
// err = vk.RequestUnmarshal("ads.shareTargetGroup", &response, params)
|
||||
// return
|
||||
// }
|
||||
|
||||
// TODO: AdsUpdateAdsResponse struct.
|
||||
// type AdsUpdateAdsResponse struct{}
|
||||
|
||||
// TODO: AdsUpdateAds ...
|
||||
//
|
||||
// https://vk.com/dev/ads.updateAds
|
||||
// func (vk *VK) AdsUpdateAds(params Params) (response AdsUpdateAdsResponse, err error) {
|
||||
// err = vk.RequestUnmarshal("ads.updateAds", &response, params)
|
||||
// return
|
||||
// }
|
||||
|
||||
// TODO: AdsUpdateCampaignsResponse struct.
|
||||
// type AdsUpdateCampaignsResponse struct{}
|
||||
|
||||
// TODO: AdsUpdateCampaigns ...
|
||||
//
|
||||
// https://vk.com/dev/ads.updateCampaigns
|
||||
// func (vk *VK) AdsUpdateCampaigns(params Params) (response AdsUpdateCampaignsResponse, err error) {
|
||||
// err = vk.RequestUnmarshal("ads.updateCampaigns", &response, params)
|
||||
// return
|
||||
// }
|
||||
|
||||
// TODO: AdsUpdateClientsResponse struct.
|
||||
// type AdsUpdateClientsResponse struct{}
|
||||
|
||||
// TODO: AdsUpdateClients ...
|
||||
//
|
||||
// https://vk.com/dev/ads.updateClients
|
||||
// func (vk *VK) AdsUpdateClients(params Params) (response AdsUpdateClientsResponse, err error) {
|
||||
// err = vk.RequestUnmarshal("ads.updateClients", &response, params)
|
||||
// return
|
||||
// }
|
||||
|
||||
// AdsUpdateTargetGroup edits target group.
|
||||
//
|
||||
// https://vk.com/dev/ads.updateTargetGroup
|
||||
func (vk *VK) AdsUpdateTargetGroup(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("ads.updateTargetGroup", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AdsUpdateTargetPixel edits target pixel.
|
||||
//
|
||||
// https://vk.com/dev/ads.updateTargetPixel
|
||||
func (vk *VK) AdsUpdateTargetPixel(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("ads. updateTargetPixel", &response, params)
|
||||
return
|
||||
}
|
||||
359
vendor/github.com/SevereCloud/vksdk/v2/api/api.go
generated
vendored
Normal file
@@ -0,0 +1,359 @@
|
||||
/*
|
||||
Package api implements VK API.
|
||||
|
||||
See more https://vk.com/dev/api_requests
|
||||
*/
|
||||
package api // import "github.com/SevereCloud/vksdk/v2/api"
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"mime"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"reflect"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/SevereCloud/vksdk/v2"
|
||||
"github.com/SevereCloud/vksdk/v2/internal"
|
||||
"github.com/SevereCloud/vksdk/v2/object"
|
||||
)
|
||||
|
||||
// Api constants.
|
||||
const (
|
||||
Version = vksdk.API
|
||||
MethodURL = "https://api.vk.com/method/"
|
||||
)
|
||||
|
||||
// VKontakte API methods (except for methods from secure and ads sections)
|
||||
// with user access key or service access key can be accessed
|
||||
// no more than 3 times per second. The community access key is limited
|
||||
// to 20 requests per second.
|
||||
//
|
||||
// Maximum amount of calls to the secure section methods depends
|
||||
// on the app's users amount. If an app has less than
|
||||
// 10 000 users, 5 requests per second,
|
||||
// up to 100 000 – 8 requests,
|
||||
// up to 1 000 000 – 20 requests,
|
||||
// 1 000 000+ – 35 requests.
|
||||
//
|
||||
// The ads section methods are subject to their own limitations,
|
||||
// you can read them on this page - https://vk.com/dev/ads_limits
|
||||
//
|
||||
// If one of this limits is exceeded, the server will return following error:
|
||||
// "Too many requests per second". (errors.TooMany).
|
||||
//
|
||||
// If your app's logic implies many requests in a row, check the execute method.
|
||||
// It allows for up to 25 requests for different methods in a single request.
|
||||
//
|
||||
// In addition to restrictions on the frequency of calls, there are also
|
||||
// quantitative restrictions on calling the same type of methods.
|
||||
//
|
||||
// After exceeding the quantitative limit, access to a particular method may
|
||||
// require entering a captcha (see https://vk.com/dev/captcha_error),
|
||||
// and may also be temporarily restricted (in this case, the server does
|
||||
// not return a response to the call of a particular method, but handles
|
||||
// any other requests without problems).
|
||||
//
|
||||
// If this error occurs, the following parameters are also passed in
|
||||
// the error message:
|
||||
//
|
||||
// CaptchaSID - identifier captcha.
|
||||
//
|
||||
// CaptchaImg - a link to the image that you want to show the user
|
||||
// to enter text from that image.
|
||||
//
|
||||
// In this case, you should ask the user to enter text from
|
||||
// the CaptchaImg image and repeat the request by adding parameters to it:
|
||||
//
|
||||
// captcha_sid - the obtained identifier;
|
||||
//
|
||||
// captcha_key - text entered by the user.
|
||||
//
|
||||
// More info: https://vk.com/dev/api_requests
|
||||
const (
|
||||
LimitUserToken = 3
|
||||
LimitGroupToken = 20
|
||||
)
|
||||
|
||||
// VK struct.
|
||||
type VK struct {
|
||||
accessTokens []string
|
||||
lastToken uint32
|
||||
MethodURL string
|
||||
Version string
|
||||
Client *http.Client
|
||||
Limit int
|
||||
UserAgent string
|
||||
Handler func(method string, params ...Params) (Response, error)
|
||||
|
||||
mux sync.Mutex
|
||||
lastTime time.Time
|
||||
rps int
|
||||
}
|
||||
|
||||
// Response struct.
|
||||
type Response struct {
|
||||
Response json.RawMessage `json:"response"`
|
||||
Error Error `json:"error"`
|
||||
ExecuteErrors ExecuteErrors `json:"execute_errors"`
|
||||
}
|
||||
|
||||
// NewVK returns a new VK.
|
||||
//
|
||||
// The VKSDK will use the http.DefaultClient.
|
||||
// This means that if the http.DefaultClient is modified by other components
|
||||
// of your application the modifications will be picked up by the SDK as well.
|
||||
//
|
||||
// In some cases this might be intended, but it is a better practice
|
||||
// to create a custom HTTP Client to share explicitly through
|
||||
// your application. You can configure the VKSDK to use the custom
|
||||
// HTTP Client by setting the VK.Client value.
|
||||
//
|
||||
// This set limit 20 requests per second for one token.
|
||||
func NewVK(tokens ...string) *VK {
|
||||
var vk VK
|
||||
|
||||
vk.accessTokens = tokens
|
||||
vk.Version = Version
|
||||
|
||||
vk.Handler = vk.defaultHandler
|
||||
|
||||
vk.MethodURL = MethodURL
|
||||
vk.Client = http.DefaultClient
|
||||
vk.Limit = LimitGroupToken
|
||||
vk.UserAgent = internal.UserAgent
|
||||
|
||||
return &vk
|
||||
}
|
||||
|
||||
// getToken return next token (simple round-robin).
|
||||
func (vk *VK) getToken() string {
|
||||
i := atomic.AddUint32(&vk.lastToken, 1)
|
||||
return vk.accessTokens[(int(i)-1)%len(vk.accessTokens)]
|
||||
}
|
||||
|
||||
// Params type.
|
||||
type Params map[string]interface{}
|
||||
|
||||
// Lang - determines the language for the data to be displayed on. For
|
||||
// example country and city names. If you use a non-cyrillic language,
|
||||
// cyrillic symbols will be transliterated automatically.
|
||||
// Numeric format from account.getInfo is supported as well.
|
||||
//
|
||||
// p.Lang(object.LangRU)
|
||||
//
|
||||
// See all language code in module object.
|
||||
func (p Params) Lang(v int) Params {
|
||||
p["lang"] = v
|
||||
return p
|
||||
}
|
||||
|
||||
// TestMode allows to send requests from a native app without switching it on
|
||||
// for all users.
|
||||
func (p Params) TestMode(v bool) Params {
|
||||
p["test_mode"] = v
|
||||
return p
|
||||
}
|
||||
|
||||
// CaptchaSID received ID.
|
||||
//
|
||||
// See https://vk.com/dev/captcha_error
|
||||
func (p Params) CaptchaSID(v string) Params {
|
||||
p["captcha_sid"] = v
|
||||
return p
|
||||
}
|
||||
|
||||
// CaptchaKey text input.
|
||||
//
|
||||
// See https://vk.com/dev/captcha_error
|
||||
func (p Params) CaptchaKey(v string) Params {
|
||||
p["captcha_key"] = v
|
||||
return p
|
||||
}
|
||||
|
||||
// Confirm parameter.
|
||||
//
|
||||
// See https://vk.com/dev/need_confirmation
|
||||
func (p Params) Confirm(v bool) Params {
|
||||
p["confirm"] = v
|
||||
return p
|
||||
}
|
||||
|
||||
// WithContext parameter.
|
||||
func (p Params) WithContext(ctx context.Context) Params {
|
||||
p[":context"] = ctx
|
||||
return p
|
||||
}
|
||||
|
||||
func buildQuery(sliceParams ...Params) (context.Context, url.Values) {
|
||||
query := url.Values{}
|
||||
ctx := context.Background()
|
||||
|
||||
for _, params := range sliceParams {
|
||||
for key, value := range params {
|
||||
if key != ":context" {
|
||||
query.Set(key, FmtValue(value, 0))
|
||||
} else {
|
||||
ctx = value.(context.Context)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ctx, query
|
||||
}
|
||||
|
||||
// defaultHandler provides access to VK API methods.
|
||||
func (vk *VK) defaultHandler(method string, sliceParams ...Params) (Response, error) {
|
||||
u := vk.MethodURL + method
|
||||
ctx, query := buildQuery(sliceParams...)
|
||||
attempt := 0
|
||||
|
||||
for {
|
||||
var response Response
|
||||
|
||||
attempt++
|
||||
|
||||
// Rate limiting
|
||||
if vk.Limit > 0 {
|
||||
vk.mux.Lock()
|
||||
|
||||
sleepTime := time.Second - time.Since(vk.lastTime)
|
||||
if sleepTime < 0 {
|
||||
vk.lastTime = time.Now()
|
||||
vk.rps = 0
|
||||
} else if vk.rps == vk.Limit*len(vk.accessTokens) {
|
||||
time.Sleep(sleepTime)
|
||||
vk.lastTime = time.Now()
|
||||
vk.rps = 0
|
||||
}
|
||||
vk.rps++
|
||||
|
||||
vk.mux.Unlock()
|
||||
}
|
||||
|
||||
rawBody := bytes.NewBufferString(query.Encode())
|
||||
|
||||
req, err := http.NewRequestWithContext(ctx, "POST", u, rawBody)
|
||||
if err != nil {
|
||||
return response, err
|
||||
}
|
||||
|
||||
req.Header.Set("User-Agent", vk.UserAgent)
|
||||
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
|
||||
|
||||
resp, err := vk.Client.Do(req)
|
||||
if err != nil {
|
||||
return response, err
|
||||
}
|
||||
|
||||
mediatype, _, _ := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
||||
if mediatype != "application/json" {
|
||||
_ = resp.Body.Close()
|
||||
return response, &InvalidContentType{mediatype}
|
||||
}
|
||||
|
||||
err = json.NewDecoder(resp.Body).Decode(&response)
|
||||
if err != nil {
|
||||
_ = resp.Body.Close()
|
||||
return response, err
|
||||
}
|
||||
|
||||
_ = resp.Body.Close()
|
||||
|
||||
switch response.Error.Code {
|
||||
case ErrNoType:
|
||||
return response, nil
|
||||
case ErrTooMany:
|
||||
if attempt < vk.Limit {
|
||||
continue
|
||||
}
|
||||
|
||||
return response, &response.Error
|
||||
}
|
||||
|
||||
return response, &response.Error
|
||||
}
|
||||
}
|
||||
|
||||
// Request provides access to VK API methods.
|
||||
func (vk *VK) Request(method string, sliceParams ...Params) ([]byte, error) {
|
||||
token := vk.getToken()
|
||||
|
||||
reqParams := Params{
|
||||
"access_token": token,
|
||||
"v": vk.Version,
|
||||
}
|
||||
|
||||
sliceParams = append(sliceParams, reqParams)
|
||||
|
||||
resp, err := vk.Handler(method, sliceParams...)
|
||||
|
||||
return resp.Response, err
|
||||
}
|
||||
|
||||
// RequestUnmarshal provides access to VK API methods.
|
||||
func (vk *VK) RequestUnmarshal(method string, obj interface{}, sliceParams ...Params) error {
|
||||
rawResponse, err := vk.Request(method, sliceParams...)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return json.Unmarshal(rawResponse, &obj)
|
||||
}
|
||||
|
||||
func fmtReflectValue(value reflect.Value, depth int) string {
|
||||
switch f := value; value.Kind() {
|
||||
case reflect.Invalid:
|
||||
return ""
|
||||
case reflect.Bool:
|
||||
return fmtBool(f.Bool())
|
||||
case reflect.Array, reflect.Slice:
|
||||
s := ""
|
||||
|
||||
for i := 0; i < f.Len(); i++ {
|
||||
if i > 0 {
|
||||
s += ","
|
||||
}
|
||||
|
||||
s += FmtValue(f.Index(i).Interface(), depth)
|
||||
}
|
||||
|
||||
return s
|
||||
case reflect.Ptr:
|
||||
// pointer to array or slice or struct? ok at top level
|
||||
// but not embedded (avoid loops)
|
||||
if depth == 0 && f.Pointer() != 0 {
|
||||
switch a := f.Elem(); a.Kind() {
|
||||
case reflect.Array, reflect.Slice, reflect.Struct, reflect.Map:
|
||||
return FmtValue(a.Interface(), depth+1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return fmt.Sprint(value)
|
||||
}
|
||||
|
||||
// FmtValue return vk format string.
|
||||
func FmtValue(value interface{}, depth int) string {
|
||||
if value == nil {
|
||||
return ""
|
||||
}
|
||||
|
||||
switch f := value.(type) {
|
||||
case bool:
|
||||
return fmtBool(f)
|
||||
case object.Attachment:
|
||||
return f.ToAttachment()
|
||||
case object.JSONObject:
|
||||
return f.ToJSON()
|
||||
case reflect.Value:
|
||||
return fmtReflectValue(f, depth)
|
||||
}
|
||||
|
||||
return fmtReflectValue(reflect.ValueOf(value), depth)
|
||||
}
|
||||
149
vendor/github.com/SevereCloud/vksdk/v2/api/apps.go
generated
vendored
Normal file
@@ -0,0 +1,149 @@
|
||||
package api // import "github.com/SevereCloud/vksdk/v2/api"
|
||||
|
||||
import (
|
||||
"github.com/SevereCloud/vksdk/v2/object"
|
||||
)
|
||||
|
||||
// AppsDeleteAppRequests deletes all request notifications from the current app.
|
||||
//
|
||||
// https://vk.com/dev/apps.deleteAppRequests
|
||||
func (vk *VK) AppsDeleteAppRequests(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("apps.deleteAppRequests", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AppsGetResponse struct.
|
||||
type AppsGetResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.AppsApp `json:"items"`
|
||||
object.ExtendedResponse
|
||||
}
|
||||
|
||||
// AppsGet returns applications data.
|
||||
//
|
||||
// https://vk.com/dev/apps.get
|
||||
func (vk *VK) AppsGet(params Params) (response AppsGetResponse, err error) {
|
||||
err = vk.RequestUnmarshal("apps.get", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AppsGetCatalogResponse struct.
|
||||
type AppsGetCatalogResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.AppsApp `json:"items"`
|
||||
object.ExtendedResponse
|
||||
}
|
||||
|
||||
// AppsGetCatalog returns a list of applications (apps) available to users in the App Catalog.
|
||||
//
|
||||
// https://vk.com/dev/apps.getCatalog
|
||||
func (vk *VK) AppsGetCatalog(params Params) (response AppsGetCatalogResponse, err error) {
|
||||
err = vk.RequestUnmarshal("apps.getCatalog", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AppsGetFriendsListResponse struct.
|
||||
type AppsGetFriendsListResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []int `json:"items"`
|
||||
}
|
||||
|
||||
// AppsGetFriendsList creates friends list for requests and invites in current app.
|
||||
//
|
||||
// extended=0
|
||||
//
|
||||
// https://vk.com/dev/apps.getFriendsList
|
||||
func (vk *VK) AppsGetFriendsList(params Params) (response AppsGetFriendsListResponse, err error) {
|
||||
err = vk.RequestUnmarshal("apps.getFriendsList", &response, params, Params{"extended": false})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// AppsGetFriendsListExtendedResponse struct.
|
||||
type AppsGetFriendsListExtendedResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.UsersUser `json:"items"`
|
||||
}
|
||||
|
||||
// AppsGetFriendsListExtended creates friends list for requests and invites in current app.
|
||||
//
|
||||
// extended=1
|
||||
//
|
||||
// https://vk.com/dev/apps.getFriendsList
|
||||
func (vk *VK) AppsGetFriendsListExtended(params Params) (response AppsGetFriendsListExtendedResponse, err error) {
|
||||
err = vk.RequestUnmarshal("apps.getFriendsList", &response, params, Params{"extended": true})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// AppsGetLeaderboardResponse struct.
|
||||
type AppsGetLeaderboardResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.AppsLeaderboard `json:"items"`
|
||||
}
|
||||
|
||||
// AppsGetLeaderboard returns players rating in the game.
|
||||
//
|
||||
// extended=0
|
||||
//
|
||||
// https://vk.com/dev/apps.getLeaderboard
|
||||
func (vk *VK) AppsGetLeaderboard(params Params) (response AppsGetLeaderboardResponse, err error) {
|
||||
err = vk.RequestUnmarshal("apps.getLeaderboard", &response, params, Params{"extended": false})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// AppsGetLeaderboardExtendedResponse struct.
|
||||
type AppsGetLeaderboardExtendedResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []struct {
|
||||
Score int `json:"score"`
|
||||
UserID int `json:"user_id"`
|
||||
} `json:"items"`
|
||||
Profiles []object.UsersUser `json:"profiles"`
|
||||
}
|
||||
|
||||
// AppsGetLeaderboardExtended returns players rating in the game.
|
||||
//
|
||||
// extended=1
|
||||
//
|
||||
// https://vk.com/dev/apps.getLeaderboard
|
||||
func (vk *VK) AppsGetLeaderboardExtended(params Params) (response AppsGetLeaderboardExtendedResponse, err error) {
|
||||
err = vk.RequestUnmarshal("apps.getLeaderboard", &response, params, Params{"extended": true})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// AppsGetScopesResponse struct.
|
||||
type AppsGetScopesResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.AppsScope `json:"items"`
|
||||
}
|
||||
|
||||
// AppsGetScopes ...
|
||||
//
|
||||
// TODO: write docs.
|
||||
//
|
||||
// https://vk.com/dev/apps.getScopes
|
||||
func (vk *VK) AppsGetScopes(params Params) (response AppsGetScopesResponse, err error) {
|
||||
err = vk.RequestUnmarshal("apps.getScopes", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AppsGetScore returns user score in app.
|
||||
//
|
||||
// NOTE: vk wtf!?
|
||||
//
|
||||
// https://vk.com/dev/apps.getScore
|
||||
func (vk *VK) AppsGetScore(params Params) (response string, err error) {
|
||||
err = vk.RequestUnmarshal("apps.getScore", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AppsSendRequest sends a request to another user in an app that uses VK authorization.
|
||||
//
|
||||
// https://vk.com/dev/apps.sendRequest
|
||||
func (vk *VK) AppsSendRequest(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("apps.sendRequest", &response, params)
|
||||
return
|
||||
}
|
||||
100
vendor/github.com/SevereCloud/vksdk/v2/api/appwidgets.go
generated
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
package api // import "github.com/SevereCloud/vksdk/v2/api"
|
||||
|
||||
import (
|
||||
"github.com/SevereCloud/vksdk/v2/object"
|
||||
)
|
||||
|
||||
// AppWidgetsGetAppImageUploadServerResponse struct.
|
||||
type AppWidgetsGetAppImageUploadServerResponse struct {
|
||||
UploadURL string `json:"upload_url"`
|
||||
}
|
||||
|
||||
// AppWidgetsGetAppImageUploadServer returns a URL for uploading a
|
||||
// photo to the app collection for community app widgets.
|
||||
//
|
||||
// https://vk.com/dev/appWidgets.getAppImageUploadServer
|
||||
func (vk *VK) AppWidgetsGetAppImageUploadServer(params Params) (
|
||||
response AppWidgetsGetAppImageUploadServerResponse,
|
||||
err error,
|
||||
) {
|
||||
err = vk.RequestUnmarshal("appWidgets.getAppImageUploadServer", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AppWidgetsGetAppImagesResponse struct.
|
||||
type AppWidgetsGetAppImagesResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.AppWidgetsImage `json:"items"`
|
||||
}
|
||||
|
||||
// AppWidgetsGetAppImages returns an app collection of images for community app widgets.
|
||||
//
|
||||
// https://vk.com/dev/appWidgets.getAppImages
|
||||
func (vk *VK) AppWidgetsGetAppImages(params Params) (response AppWidgetsGetAppImagesResponse, err error) {
|
||||
err = vk.RequestUnmarshal("appWidgets.getAppImages", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AppWidgetsGetGroupImageUploadServerResponse struct.
|
||||
type AppWidgetsGetGroupImageUploadServerResponse struct {
|
||||
UploadURL string `json:"upload_url"`
|
||||
}
|
||||
|
||||
// AppWidgetsGetGroupImageUploadServer returns a URL for uploading
|
||||
// a photo to the community collection for community app widgets.
|
||||
//
|
||||
// https://vk.com/dev/appWidgets.getGroupImageUploadServer
|
||||
func (vk *VK) AppWidgetsGetGroupImageUploadServer(params Params) (
|
||||
response AppWidgetsGetGroupImageUploadServerResponse,
|
||||
err error,
|
||||
) {
|
||||
err = vk.RequestUnmarshal("appWidgets.getGroupImageUploadServer", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AppWidgetsGetGroupImagesResponse struct.
|
||||
type AppWidgetsGetGroupImagesResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.AppWidgetsImage `json:"items"`
|
||||
}
|
||||
|
||||
// AppWidgetsGetGroupImages returns a community collection of images for community app widgets.
|
||||
//
|
||||
// https://vk.com/dev/appWidgets.getGroupImages
|
||||
func (vk *VK) AppWidgetsGetGroupImages(params Params) (response AppWidgetsGetGroupImagesResponse, err error) {
|
||||
err = vk.RequestUnmarshal("appWidgets.getGroupImages", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AppWidgetsGetImagesByID returns an image for community app widgets by its ID.
|
||||
//
|
||||
// https://vk.com/dev/appWidgets.getImagesById
|
||||
func (vk *VK) AppWidgetsGetImagesByID(params Params) (response object.AppWidgetsImage, err error) {
|
||||
err = vk.RequestUnmarshal("appWidgets.getImagesById", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AppWidgetsSaveAppImage allows to save image into app collection for community app widgets.
|
||||
//
|
||||
// https://vk.com/dev/appWidgets.saveAppImage
|
||||
func (vk *VK) AppWidgetsSaveAppImage(params Params) (response object.AppWidgetsImage, err error) {
|
||||
err = vk.RequestUnmarshal("appWidgets.saveAppImage", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AppWidgetsSaveGroupImage allows to save image into community collection for community app widgets.
|
||||
//
|
||||
// https://vk.com/dev/appWidgets.saveGroupImage
|
||||
func (vk *VK) AppWidgetsSaveGroupImage(params Params) (response object.AppWidgetsImage, err error) {
|
||||
err = vk.RequestUnmarshal("appWidgets.saveGroupImage", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AppWidgetsUpdate allows to update community app widget.
|
||||
//
|
||||
// https://vk.com/dev/appWidgets.update
|
||||
func (vk *VK) AppWidgetsUpdate(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("appWidgets.update", &response, params)
|
||||
|
||||
return
|
||||
}
|
||||
26
vendor/github.com/SevereCloud/vksdk/v2/api/auth.go
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
package api // import "github.com/SevereCloud/vksdk/v2/api"
|
||||
|
||||
// AuthCheckPhone checks a user's phone number for correctness.
|
||||
//
|
||||
// https://vk.com/dev/auth.checkPhone
|
||||
//
|
||||
// Deprecated: This method is deprecated and may be disabled soon, please avoid
|
||||
// using it.
|
||||
func (vk *VK) AuthCheckPhone(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("auth.checkPhone", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// AuthRestoreResponse struct.
|
||||
type AuthRestoreResponse struct {
|
||||
Success int `json:"success"`
|
||||
SID string `json:"sid"`
|
||||
}
|
||||
|
||||
// AuthRestore allows to restore account access using a code received via SMS.
|
||||
//
|
||||
// https://vk.com/dev/auth.restore
|
||||
func (vk *VK) AuthRestore(params Params) (response AuthRestoreResponse, err error) {
|
||||
err = vk.RequestUnmarshal("auth.restore", &response, params)
|
||||
return
|
||||
}
|
||||
173
vendor/github.com/SevereCloud/vksdk/v2/api/board.go
generated
vendored
Normal file
@@ -0,0 +1,173 @@
|
||||
package api // import "github.com/SevereCloud/vksdk/v2/api"
|
||||
|
||||
import (
|
||||
"github.com/SevereCloud/vksdk/v2/object"
|
||||
)
|
||||
|
||||
// BoardAddTopic creates a new topic on a community's discussion board.
|
||||
//
|
||||
// https://vk.com/dev/board.addTopic
|
||||
func (vk *VK) BoardAddTopic(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("board.addTopic", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// BoardCloseTopic closes a topic on a community's discussion board so that comments cannot be posted.
|
||||
//
|
||||
// https://vk.com/dev/board.closeTopic
|
||||
func (vk *VK) BoardCloseTopic(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("board.closeTopic", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// BoardCreateComment adds a comment on a topic on a community's discussion board.
|
||||
//
|
||||
// https://vk.com/dev/board.createComment
|
||||
func (vk *VK) BoardCreateComment(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("board.createComment", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// BoardDeleteComment deletes a comment on a topic on a community's discussion board.
|
||||
//
|
||||
// https://vk.com/dev/board.deleteComment
|
||||
func (vk *VK) BoardDeleteComment(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("board.deleteComment", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// BoardDeleteTopic deletes a topic from a community's discussion board.
|
||||
//
|
||||
// https://vk.com/dev/board.deleteTopic
|
||||
func (vk *VK) BoardDeleteTopic(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("board.deleteTopic", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// BoardEditComment edits a comment on a topic on a community's discussion board.
|
||||
//
|
||||
// https://vk.com/dev/board.editComment
|
||||
func (vk *VK) BoardEditComment(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("board.editComment", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// BoardEditTopic edits the title of a topic on a community's discussion board.
|
||||
//
|
||||
// https://vk.com/dev/board.editTopic
|
||||
func (vk *VK) BoardEditTopic(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("board.editTopic", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// BoardFixTopic pins a topic (fixes its place) to the top of a community's discussion board.
|
||||
//
|
||||
// https://vk.com/dev/board.fixTopic
|
||||
func (vk *VK) BoardFixTopic(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("board.fixTopic", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// BoardGetCommentsResponse struct.
|
||||
type BoardGetCommentsResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.BoardTopicComment `json:"items"`
|
||||
Poll object.BoardTopicPoll `json:"poll"`
|
||||
RealOffset int `json:"real_offset"`
|
||||
}
|
||||
|
||||
// BoardGetComments returns a list of comments on a topic on a community's discussion board.
|
||||
//
|
||||
// extended=0
|
||||
//
|
||||
// https://vk.com/dev/board.getComments
|
||||
func (vk *VK) BoardGetComments(params Params) (response BoardGetCommentsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("board.getComments", &response, params, Params{"extended": false})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// BoardGetCommentsExtendedResponse struct.
|
||||
type BoardGetCommentsExtendedResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.BoardTopicComment `json:"items"`
|
||||
Poll object.BoardTopicPoll `json:"poll"`
|
||||
RealOffset int `json:"real_offset"`
|
||||
Profiles []object.UsersUser `json:"profiles"`
|
||||
Groups []object.GroupsGroup `json:"groups"`
|
||||
}
|
||||
|
||||
// BoardGetCommentsExtended returns a list of comments on a topic on a community's discussion board.
|
||||
//
|
||||
// extended=1
|
||||
//
|
||||
// https://vk.com/dev/board.getComments
|
||||
func (vk *VK) BoardGetCommentsExtended(params Params) (response BoardGetCommentsExtendedResponse, err error) {
|
||||
err = vk.RequestUnmarshal("board.getComments", &response, params, Params{"extended": true})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// BoardGetTopicsResponse struct.
|
||||
type BoardGetTopicsResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.BoardTopic `json:"items"`
|
||||
DefaultOrder float64 `json:"default_order"` // BUG(VK): default_order int https://vk.com/bug136682
|
||||
CanAddTopics object.BaseBoolInt `json:"can_add_topics"`
|
||||
}
|
||||
|
||||
// BoardGetTopics returns a list of topics on a community's discussion board.
|
||||
//
|
||||
// extended=0
|
||||
//
|
||||
// https://vk.com/dev/board.getTopics
|
||||
func (vk *VK) BoardGetTopics(params Params) (response BoardGetTopicsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("board.getTopics", &response, params, Params{"extended": false})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// BoardGetTopicsExtendedResponse struct.
|
||||
type BoardGetTopicsExtendedResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.BoardTopic `json:"items"`
|
||||
DefaultOrder float64 `json:"default_order"` // BUG(VK): default_order int https://vk.com/bug136682
|
||||
CanAddTopics object.BaseBoolInt `json:"can_add_topics"`
|
||||
Profiles []object.UsersUser `json:"profiles"`
|
||||
Groups []object.GroupsGroup `json:"groups"`
|
||||
}
|
||||
|
||||
// BoardGetTopicsExtended returns a list of topics on a community's discussion board.
|
||||
//
|
||||
// extended=1
|
||||
//
|
||||
// https://vk.com/dev/board.getTopics
|
||||
func (vk *VK) BoardGetTopicsExtended(params Params) (response BoardGetTopicsExtendedResponse, err error) {
|
||||
err = vk.RequestUnmarshal("board.getTopics", &response, params, Params{"extended": true})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// BoardOpenTopic re-opens a previously closed topic on a community's discussion board.
|
||||
//
|
||||
// https://vk.com/dev/board.openTopic
|
||||
func (vk *VK) BoardOpenTopic(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("board.openTopic", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// BoardRestoreComment restores a comment deleted from a topic on a community's discussion board.
|
||||
//
|
||||
// https://vk.com/dev/board.restoreComment
|
||||
func (vk *VK) BoardRestoreComment(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("board.restoreComment", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// BoardUnfixTopic unpins a pinned topic from the top of a community's discussion board.
|
||||
//
|
||||
// https://vk.com/dev/board.unfixTopic
|
||||
func (vk *VK) BoardUnfixTopic(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("board.unfixTopic", &response, params)
|
||||
return
|
||||
}
|
||||
7
vendor/github.com/SevereCloud/vksdk/v2/api/captcha.go
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
package api
|
||||
|
||||
// CaptchaForce api method.
|
||||
func (vk *VK) CaptchaForce(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("captcha.force", &response, params)
|
||||
return
|
||||
}
|
||||
163
vendor/github.com/SevereCloud/vksdk/v2/api/database.go
generated
vendored
Normal file
@@ -0,0 +1,163 @@
|
||||
package api // import "github.com/SevereCloud/vksdk/v2/api"
|
||||
|
||||
import (
|
||||
"github.com/SevereCloud/vksdk/v2/object"
|
||||
)
|
||||
|
||||
// DatabaseGetChairsResponse struct.
|
||||
type DatabaseGetChairsResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.BaseObject `json:"items"`
|
||||
}
|
||||
|
||||
// DatabaseGetChairs returns list of chairs on a specified faculty.
|
||||
//
|
||||
// https://vk.com/dev/database.getChairs
|
||||
func (vk *VK) DatabaseGetChairs(params Params) (response DatabaseGetChairsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("database.getChairs", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// DatabaseGetCitiesResponse struct.
|
||||
type DatabaseGetCitiesResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.DatabaseCity `json:"items"`
|
||||
}
|
||||
|
||||
// DatabaseGetCities returns a list of cities.
|
||||
//
|
||||
// https://vk.com/dev/database.getCities
|
||||
func (vk *VK) DatabaseGetCities(params Params) (response DatabaseGetCitiesResponse, err error) {
|
||||
err = vk.RequestUnmarshal("database.getCities", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// DatabaseGetCitiesByIDResponse struct.
|
||||
type DatabaseGetCitiesByIDResponse []object.DatabaseCity
|
||||
|
||||
// DatabaseGetCitiesByID returns information about cities by their IDs.
|
||||
//
|
||||
// https://vk.com/dev/database.getCitiesByID
|
||||
func (vk *VK) DatabaseGetCitiesByID(params Params) (response DatabaseGetCitiesByIDResponse, err error) {
|
||||
err = vk.RequestUnmarshal("database.getCitiesById", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// DatabaseGetCountriesResponse struct.
|
||||
type DatabaseGetCountriesResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.BaseObject `json:"items"`
|
||||
}
|
||||
|
||||
// DatabaseGetCountries returns a list of countries.
|
||||
//
|
||||
// https://vk.com/dev/database.getCountries
|
||||
func (vk *VK) DatabaseGetCountries(params Params) (response DatabaseGetCountriesResponse, err error) {
|
||||
err = vk.RequestUnmarshal("database.getCountries", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// DatabaseGetCountriesByIDResponse struct.
|
||||
type DatabaseGetCountriesByIDResponse []object.BaseObject
|
||||
|
||||
// DatabaseGetCountriesByID returns information about countries by their IDs.
|
||||
//
|
||||
// https://vk.com/dev/database.getCountriesByID
|
||||
func (vk *VK) DatabaseGetCountriesByID(params Params) (response DatabaseGetCountriesByIDResponse, err error) {
|
||||
err = vk.RequestUnmarshal("database.getCountriesById", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// DatabaseGetFacultiesResponse struct.
|
||||
type DatabaseGetFacultiesResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.DatabaseFaculty `json:"items"`
|
||||
}
|
||||
|
||||
// DatabaseGetFaculties returns a list of faculties (i.e., university departments).
|
||||
//
|
||||
// https://vk.com/dev/database.getFaculties
|
||||
func (vk *VK) DatabaseGetFaculties(params Params) (response DatabaseGetFacultiesResponse, err error) {
|
||||
err = vk.RequestUnmarshal("database.getFaculties", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// DatabaseGetMetroStationsResponse struct.
|
||||
type DatabaseGetMetroStationsResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.DatabaseMetroStation `json:"items"`
|
||||
}
|
||||
|
||||
// DatabaseGetMetroStations returns the list of metro stations.
|
||||
//
|
||||
// https://vk.com/dev/database.getMetroStations
|
||||
func (vk *VK) DatabaseGetMetroStations(params Params) (response DatabaseGetMetroStationsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("database.getMetroStations", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// DatabaseGetMetroStationsByIDResponse struct.
|
||||
type DatabaseGetMetroStationsByIDResponse []object.DatabaseMetroStation
|
||||
|
||||
// DatabaseGetMetroStationsByID returns information about one or several metro stations by their identifiers.
|
||||
//
|
||||
// https://vk.com/dev/database.getMetroStationsById
|
||||
func (vk *VK) DatabaseGetMetroStationsByID(params Params) (response DatabaseGetMetroStationsByIDResponse, err error) {
|
||||
err = vk.RequestUnmarshal("database.getMetroStationsById", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// DatabaseGetRegionsResponse struct.
|
||||
type DatabaseGetRegionsResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.DatabaseRegion `json:"items"`
|
||||
}
|
||||
|
||||
// DatabaseGetRegions returns a list of regions.
|
||||
//
|
||||
// https://vk.com/dev/database.getRegions
|
||||
func (vk *VK) DatabaseGetRegions(params Params) (response DatabaseGetRegionsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("database.getRegions", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// DatabaseGetSchoolClassesResponse struct.
|
||||
type DatabaseGetSchoolClassesResponse [][]interface{}
|
||||
|
||||
// DatabaseGetSchoolClasses returns a list of school classes specified for the country.
|
||||
//
|
||||
// BUG(VK): database.getSchoolClasses bad return.
|
||||
//
|
||||
// https://vk.com/dev/database.getSchoolClasses
|
||||
func (vk *VK) DatabaseGetSchoolClasses(params Params) (response DatabaseGetSchoolClassesResponse, err error) {
|
||||
err = vk.RequestUnmarshal("database.getSchoolClasses", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// DatabaseGetSchoolsResponse struct.
|
||||
type DatabaseGetSchoolsResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.DatabaseSchool `json:"items"`
|
||||
}
|
||||
|
||||
// DatabaseGetSchools returns a list of schools.
|
||||
//
|
||||
// https://vk.com/dev/database.getSchools
|
||||
func (vk *VK) DatabaseGetSchools(params Params) (response DatabaseGetSchoolsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("database.getSchools", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// DatabaseGetUniversitiesResponse struct.
|
||||
type DatabaseGetUniversitiesResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.DatabaseUniversity `json:"items"`
|
||||
}
|
||||
|
||||
// DatabaseGetUniversities returns a list of higher education institutions.
|
||||
//
|
||||
// https://vk.com/dev/database.getUniversities
|
||||
func (vk *VK) DatabaseGetUniversities(params Params) (response DatabaseGetUniversitiesResponse, err error) {
|
||||
err = vk.RequestUnmarshal("database.getUniversities", &response, params)
|
||||
return
|
||||
}
|
||||
137
vendor/github.com/SevereCloud/vksdk/v2/api/docs.go
generated
vendored
Normal file
@@ -0,0 +1,137 @@
|
||||
package api // import "github.com/SevereCloud/vksdk/v2/api"
|
||||
|
||||
import (
|
||||
"github.com/SevereCloud/vksdk/v2/object"
|
||||
)
|
||||
|
||||
// DocsAdd copies a document to a user's or community's document list.
|
||||
//
|
||||
// https://vk.com/dev/docs.add
|
||||
func (vk *VK) DocsAdd(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("docs.add", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// DocsDelete deletes a user or community document.
|
||||
//
|
||||
// https://vk.com/dev/docs.delete
|
||||
func (vk *VK) DocsDelete(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("docs.delete", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// DocsEdit edits a document.
|
||||
//
|
||||
// https://vk.com/dev/docs.edit
|
||||
func (vk *VK) DocsEdit(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("docs.edit", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// DocsGetResponse struct.
|
||||
type DocsGetResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.DocsDoc `json:"items"`
|
||||
}
|
||||
|
||||
// DocsGet returns detailed information about user or community documents.
|
||||
//
|
||||
// https://vk.com/dev/docs.get
|
||||
func (vk *VK) DocsGet(params Params) (response DocsGetResponse, err error) {
|
||||
err = vk.RequestUnmarshal("docs.get", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// DocsGetByIDResponse struct.
|
||||
type DocsGetByIDResponse []object.DocsDoc
|
||||
|
||||
// DocsGetByID returns information about documents by their IDs.
|
||||
//
|
||||
// https://vk.com/dev/docs.getById
|
||||
func (vk *VK) DocsGetByID(params Params) (response DocsGetByIDResponse, err error) {
|
||||
err = vk.RequestUnmarshal("docs.getById", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// DocsGetMessagesUploadServerResponse struct.
|
||||
type DocsGetMessagesUploadServerResponse struct {
|
||||
UploadURL string `json:"upload_url"`
|
||||
}
|
||||
|
||||
// DocsGetMessagesUploadServer returns the server address for document upload.
|
||||
//
|
||||
// https://vk.com/dev/docs.getMessagesUploadServer
|
||||
func (vk *VK) DocsGetMessagesUploadServer(params Params) (response DocsGetMessagesUploadServerResponse, err error) {
|
||||
err = vk.RequestUnmarshal("docs.getMessagesUploadServer", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// DocsGetTypesResponse struct.
|
||||
type DocsGetTypesResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.DocsDocTypes `json:"items"`
|
||||
}
|
||||
|
||||
// DocsGetTypes returns documents types available for current user.
|
||||
//
|
||||
// https://vk.com/dev/docs.getTypes
|
||||
func (vk *VK) DocsGetTypes(params Params) (response DocsGetTypesResponse, err error) {
|
||||
err = vk.RequestUnmarshal("docs.getTypes", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// DocsGetUploadServerResponse struct.
|
||||
type DocsGetUploadServerResponse struct {
|
||||
UploadURL string `json:"upload_url"`
|
||||
}
|
||||
|
||||
// DocsGetUploadServer returns the server address for document upload.
|
||||
//
|
||||
// https://vk.com/dev/docs.getUploadServer
|
||||
func (vk *VK) DocsGetUploadServer(params Params) (response DocsGetUploadServerResponse, err error) {
|
||||
err = vk.RequestUnmarshal("docs.getUploadServer", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// DocsGetWallUploadServerResponse struct.
|
||||
type DocsGetWallUploadServerResponse struct {
|
||||
UploadURL string `json:"upload_url"`
|
||||
}
|
||||
|
||||
// DocsGetWallUploadServer returns the server address for document upload onto a user's or community's wall.
|
||||
//
|
||||
// https://vk.com/dev/docs.getWallUploadServer
|
||||
func (vk *VK) DocsGetWallUploadServer(params Params) (response DocsGetWallUploadServerResponse, err error) {
|
||||
err = vk.RequestUnmarshal("docs.getWallUploadServer", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// DocsSaveResponse struct.
|
||||
type DocsSaveResponse struct {
|
||||
Type string `json:"type"`
|
||||
AudioMessage object.MessagesAudioMessage `json:"audio_message"`
|
||||
Doc object.DocsDoc `json:"doc"`
|
||||
Graffiti object.MessagesGraffiti `json:"graffiti"`
|
||||
}
|
||||
|
||||
// DocsSave saves a document after uploading it to a server.
|
||||
//
|
||||
// https://vk.com/dev/docs.save
|
||||
func (vk *VK) DocsSave(params Params) (response DocsSaveResponse, err error) {
|
||||
err = vk.RequestUnmarshal("docs.save", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// DocsSearchResponse struct.
|
||||
type DocsSearchResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.DocsDoc `json:"items"`
|
||||
}
|
||||
|
||||
// DocsSearch returns a list of documents matching the search criteria.
|
||||
//
|
||||
// https://vk.com/dev/docs.search
|
||||
func (vk *VK) DocsSearch(params Params) (response DocsSearchResponse, err error) {
|
||||
err = vk.RequestUnmarshal("docs.search", &response, params)
|
||||
return
|
||||
}
|
||||
49
vendor/github.com/SevereCloud/vksdk/v2/api/donut.go
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
package api
|
||||
|
||||
import "github.com/SevereCloud/vksdk/v2/object"
|
||||
|
||||
// DonutGetFriendsResponse struct.
|
||||
type DonutGetFriendsResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.UsersUser `json:"items"`
|
||||
}
|
||||
|
||||
// DonutGetFriends method.
|
||||
//
|
||||
// https://vk.com/dev/donut.getFriends
|
||||
func (vk *VK) DonutGetFriends(params Params) (response DonutGetFriendsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("donut.getFriends", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// DonutGetSubscription method.
|
||||
//
|
||||
// https://vk.com/dev/donut.getSubscription
|
||||
func (vk *VK) DonutGetSubscription(params Params) (response object.DonutDonatorSubscriptionInfo, err error) {
|
||||
err = vk.RequestUnmarshal("donut.getSubscription", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// DonutGetSubscriptionsResponse struct.
|
||||
type DonutGetSubscriptionsResponse struct {
|
||||
Subscriptions []object.DonutDonatorSubscriptionInfo `json:"subscriptions"`
|
||||
Count int `json:"count"`
|
||||
Profiles []object.UsersUser `json:"profiles"`
|
||||
Groups []object.GroupsGroup `json:"groups"`
|
||||
}
|
||||
|
||||
// DonutGetSubscriptions method.
|
||||
//
|
||||
// https://vk.com/dev/donut.getSubscriptions
|
||||
func (vk *VK) DonutGetSubscriptions(params Params) (response DonutGetSubscriptionsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("donut.getSubscriptions", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// DonutIsDon method.
|
||||
//
|
||||
// https://vk.com/dev/donut.isDon
|
||||
func (vk *VK) DonutIsDon(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("donut.isDon", &response, params)
|
||||
return
|
||||
}
|
||||
19
vendor/github.com/SevereCloud/vksdk/v2/api/downloadedGames.go
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
package api // import "github.com/SevereCloud/vksdk/v2/api"
|
||||
|
||||
import (
|
||||
"github.com/SevereCloud/vksdk/v2/object"
|
||||
)
|
||||
|
||||
// DownloadedGamesGetPaidStatusResponse struct.
|
||||
type DownloadedGamesGetPaidStatusResponse struct {
|
||||
IsPaid object.BaseBoolInt `json:"is_paid"`
|
||||
}
|
||||
|
||||
// DownloadedGamesGetPaidStatus method.
|
||||
//
|
||||
// https://vk.com/dev/downloadedGames.getPaidStatus
|
||||
func (vk *VK) DownloadedGamesGetPaidStatus(params Params) (response DownloadedGamesGetPaidStatusResponse, err error) {
|
||||
err = vk.RequestUnmarshal("downloadedGames.getPaidStatus", &response, params, Params{"extended": false})
|
||||
|
||||
return
|
||||
}
|
||||
948
vendor/github.com/SevereCloud/vksdk/v2/api/errors.go
generated
vendored
Normal file
@@ -0,0 +1,948 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/SevereCloud/vksdk/v2/object"
|
||||
)
|
||||
|
||||
// ErrorType is the type of an error.
|
||||
type ErrorType int
|
||||
|
||||
// Error returns the message of a ErrorType.
|
||||
func (e ErrorType) Error() string {
|
||||
return fmt.Sprintf("api: error with code %d", e)
|
||||
}
|
||||
|
||||
// Error codes. See https://vk.com/dev/errors
|
||||
const (
|
||||
ErrNoType ErrorType = 0 // NoType error
|
||||
|
||||
// Unknown error occurred
|
||||
//
|
||||
// Try again later.
|
||||
ErrUnknown ErrorType = 1
|
||||
|
||||
// Application is disabled. Enable your application or use test mode
|
||||
//
|
||||
// You need to switch on the app in Settings
|
||||
// https://vk.com/editapp?id={Your API_ID}
|
||||
// or use the test mode (test_mode=1).
|
||||
ErrDisabled ErrorType = 2
|
||||
|
||||
// Unknown method passed.
|
||||
//
|
||||
// Check the method name: http://vk.com/dev/methods
|
||||
ErrMethod ErrorType = 3
|
||||
ErrSignature ErrorType = 4 // Incorrect signature
|
||||
|
||||
// User authorization failed
|
||||
//
|
||||
// Make sure that you use a correct authorization type.
|
||||
ErrAuth ErrorType = 5
|
||||
|
||||
// Too many requests per second
|
||||
//
|
||||
// Decrease the request frequency or use the execute method.
|
||||
// More details on frequency limits here:
|
||||
// https://vk.com/dev/api_requests
|
||||
ErrTooMany ErrorType = 6
|
||||
|
||||
// Permission to perform this action is denied
|
||||
//
|
||||
// Make sure that your have received required permissions during the
|
||||
// authorization.
|
||||
// You can do it with the account.getAppPermissions method.
|
||||
// https://vk.com/dev/permissions
|
||||
ErrPermission ErrorType = 7
|
||||
|
||||
// Invalid request
|
||||
//
|
||||
// Check the request syntax and used parameters list (it can be found on
|
||||
// a method description page).
|
||||
ErrRequest ErrorType = 8
|
||||
|
||||
// Flood control
|
||||
//
|
||||
// You need to decrease the count of identical requests. For more efficient
|
||||
// work you may use execute.
|
||||
ErrFlood ErrorType = 9
|
||||
|
||||
// Internal server error
|
||||
//
|
||||
// Try again later.
|
||||
ErrServer ErrorType = 10
|
||||
|
||||
// In test mode application should be disabled or user should be authorized
|
||||
//
|
||||
// Switch the app off in Settings:
|
||||
//
|
||||
// https://vk.com/editapp?id={Your API_ID}
|
||||
//
|
||||
ErrEnabledInTest ErrorType = 11
|
||||
|
||||
// Unable to compile code.
|
||||
ErrCompile ErrorType = 12
|
||||
|
||||
// Runtime error occurred during code invocation.
|
||||
ErrRuntime ErrorType = 13
|
||||
|
||||
// Captcha needed.
|
||||
//
|
||||
// See https://vk.com/dev/captcha_error
|
||||
ErrCaptcha ErrorType = 14
|
||||
|
||||
// Access denied
|
||||
//
|
||||
// Make sure that you use correct identifiers and the content is available
|
||||
// for the user in the full version of the site.
|
||||
ErrAccess ErrorType = 15
|
||||
|
||||
// HTTP authorization failed
|
||||
//
|
||||
// To avoid this error check if a user has the 'Use secure connection'
|
||||
// option enabled with the account.getInfo method.
|
||||
ErrAuthHTTPS ErrorType = 16
|
||||
|
||||
// Validation required
|
||||
//
|
||||
// Make sure that you don't use a token received with
|
||||
// http://vk.com/dev/auth_mobile for a request from the server.
|
||||
// It's restricted.
|
||||
//
|
||||
// https://vk.com/dev/need_validation
|
||||
ErrAuthValidation ErrorType = 17
|
||||
ErrUserDeleted ErrorType = 18 // User was deleted or banned
|
||||
ErrBlocked ErrorType = 19 // Content blocked
|
||||
|
||||
// Permission to perform this action is denied for non-standalone
|
||||
// applications.
|
||||
ErrMethodPermission ErrorType = 20
|
||||
|
||||
// Permission to perform this action is allowed only for standalone and
|
||||
// OpenAPI applications.
|
||||
ErrMethodAds ErrorType = 21
|
||||
ErrUpload ErrorType = 22 // Upload error
|
||||
|
||||
// This method was disabled.
|
||||
//
|
||||
// All the methods available now are listed here: http://vk.com/dev/methods
|
||||
ErrMethodDisabled ErrorType = 23
|
||||
|
||||
// Confirmation required
|
||||
//
|
||||
// In some cases VK requires to request action confirmation from the user
|
||||
// (for Standalone apps only).
|
||||
//
|
||||
// Following parameter is transmitted with the error message as well:
|
||||
//
|
||||
// confirmation_text – text of the message to be shown in the default
|
||||
// confirmation window.
|
||||
//
|
||||
// The app should display the default confirmation window
|
||||
// with text from confirmation_text and two buttons: "Continue" and
|
||||
// "Cancel".
|
||||
// If user confirms the action repeat the request with an extra parameter:
|
||||
//
|
||||
// confirm = 1.
|
||||
//
|
||||
// https://vk.com/dev/need_confirmation
|
||||
ErrNeedConfirmation ErrorType = 24
|
||||
ErrNeedTokenConfirmation ErrorType = 25 // Token confirmation required
|
||||
ErrGroupAuth ErrorType = 27 // Group authorization failed
|
||||
ErrAppAuth ErrorType = 28 // Application authorization failed
|
||||
|
||||
// Rate limit reached.
|
||||
//
|
||||
// More details on rate limits here: https://vk.com/dev/data_limits
|
||||
ErrRateLimit ErrorType = 29
|
||||
ErrPrivateProfile ErrorType = 30 // This profile is private
|
||||
|
||||
// Method execution was interrupted due to timeout.
|
||||
ErrExecutionTimeout ErrorType = 36
|
||||
|
||||
// User was banned.
|
||||
ErrUserBanned ErrorType = 37
|
||||
|
||||
// Unknown application.
|
||||
ErrUnknownApplication ErrorType = 38
|
||||
|
||||
// Unknown user.
|
||||
ErrUnknownUser ErrorType = 39
|
||||
|
||||
// Unknown group.
|
||||
ErrUnknownGroup ErrorType = 40
|
||||
|
||||
// Additional signup required.
|
||||
ErrAdditionalSignupRequired ErrorType = 41
|
||||
|
||||
// One of the parameters specified was missing or invalid
|
||||
//
|
||||
// Check the required parameters list and their format on a method
|
||||
// description page.
|
||||
ErrParam ErrorType = 100
|
||||
|
||||
// Invalid application API ID
|
||||
//
|
||||
// Find the app in the administrated list in settings:
|
||||
// http://vk.com/apps?act=settings
|
||||
// And set the correct API_ID in the request.
|
||||
ErrParamAPIID ErrorType = 101
|
||||
ErrLimits ErrorType = 103 // Out of limits
|
||||
ErrNotFound ErrorType = 104 // Not found
|
||||
ErrSaveFile ErrorType = 105 // Couldn't save file
|
||||
ErrActionFailed ErrorType = 106 // Unable to process action
|
||||
|
||||
// Invalid user id
|
||||
//
|
||||
// Make sure that you use a correct id. You can get an id using a screen
|
||||
// name with the utils.resolveScreenName method.
|
||||
ErrParamUserID ErrorType = 113
|
||||
ErrParamAlbumID ErrorType = 114 // Invalid album id
|
||||
ErrParamServer ErrorType = 118 // Invalid server
|
||||
ErrParamTitle ErrorType = 119 // Invalid title
|
||||
ErrParamPhotos ErrorType = 122 // Invalid photos
|
||||
ErrParamHash ErrorType = 121 // Invalid hash
|
||||
ErrParamPhoto ErrorType = 129 // Invalid photo
|
||||
ErrParamGroupID ErrorType = 125 // Invalid group id
|
||||
ErrParamPageID ErrorType = 140 // Page not found
|
||||
ErrAccessPage ErrorType = 141 // Access to page denied
|
||||
|
||||
// The mobile number of the user is unknown.
|
||||
ErrMobileNotActivated ErrorType = 146
|
||||
|
||||
// Application has insufficient funds.
|
||||
ErrInsufficientFunds ErrorType = 147
|
||||
|
||||
// Access to the menu of the user denied.
|
||||
ErrAccessMenu ErrorType = 148
|
||||
|
||||
// Invalid timestamp
|
||||
//
|
||||
// You may get a correct value with the utils.getServerTime method.
|
||||
ErrParamTimestamp ErrorType = 150
|
||||
ErrFriendsListID ErrorType = 171 // Invalid list id
|
||||
|
||||
// Reached the maximum number of lists.
|
||||
ErrFriendsListLimit ErrorType = 173
|
||||
|
||||
// Cannot add user himself as friend.
|
||||
ErrFriendsAddYourself ErrorType = 174
|
||||
|
||||
// Cannot add this user to friends as they have put you on their blacklist.
|
||||
ErrFriendsAddInEnemy ErrorType = 175
|
||||
|
||||
// Cannot add this user to friends as you put him on blacklist.
|
||||
ErrFriendsAddEnemy ErrorType = 176
|
||||
|
||||
// Cannot add this user to friends as user not found.
|
||||
ErrFriendsAddNotFound ErrorType = 177
|
||||
ErrParamNoteID ErrorType = 180 // Note not found
|
||||
ErrAccessNote ErrorType = 181 // Access to note denied
|
||||
ErrAccessNoteComment ErrorType = 182 // You can't comment this note
|
||||
ErrAccessComment ErrorType = 183 // Access to comment denied
|
||||
|
||||
// Access to album denied
|
||||
//
|
||||
// Make sure you use correct ids (owner_id is always positive for users,
|
||||
// negative for communities) and the current user has access to the
|
||||
// requested content in the full version of the site.
|
||||
ErrAccessAlbum ErrorType = 200
|
||||
|
||||
// Access to audio denied
|
||||
//
|
||||
// Make sure you use correct ids (owner_id is always positive for users,
|
||||
// negative for communities) and the current user has access to the
|
||||
// requested content in the full version of the site.
|
||||
ErrAccessAudio ErrorType = 201
|
||||
|
||||
// Access to group denied
|
||||
//
|
||||
// Make sure that the current user is a member or admin of the community
|
||||
// (for closed and private groups and events).
|
||||
ErrAccessGroup ErrorType = 203
|
||||
|
||||
// Access denied.
|
||||
ErrAccessVideo ErrorType = 204
|
||||
|
||||
// Access denied.
|
||||
ErrAccessMarket ErrorType = 205
|
||||
|
||||
// Access to wall's post denied.
|
||||
ErrWallAccessPost ErrorType = 210
|
||||
|
||||
// Access to wall's comment denied.
|
||||
ErrWallAccessComment ErrorType = 211
|
||||
|
||||
// Access to post comments denied.
|
||||
ErrWallAccessReplies ErrorType = 212
|
||||
|
||||
// Access to status replies denied.
|
||||
ErrWallAccessAddReply ErrorType = 213
|
||||
|
||||
// Access to adding post denied.
|
||||
ErrWallAddPost ErrorType = 214
|
||||
|
||||
// Advertisement post was recently added.
|
||||
ErrWallAdsPublished ErrorType = 219
|
||||
|
||||
// Too many recipients.
|
||||
ErrWallTooManyRecipients ErrorType = 220
|
||||
|
||||
// User disabled track name broadcast.
|
||||
ErrStatusNoAudio ErrorType = 221
|
||||
|
||||
// Hyperlinks are forbidden.
|
||||
ErrWallLinksForbidden ErrorType = 222
|
||||
|
||||
// Too many replies.
|
||||
ErrWallReplyOwnerFlood ErrorType = 223
|
||||
|
||||
// Too many ads posts.
|
||||
ErrWallAdsPostLimitReached ErrorType = 224
|
||||
|
||||
// Donut is disabled.
|
||||
ErrDonutDisabled ErrorType = 225
|
||||
|
||||
// Reaction can not be applied to the object.
|
||||
ErrLikesReactionCanNotBeApplied ErrorType = 232
|
||||
|
||||
// Access to poll denied.
|
||||
ErrPollsAccess ErrorType = 250
|
||||
|
||||
// Invalid answer id.
|
||||
ErrPollsAnswerID ErrorType = 252
|
||||
|
||||
// Invalid poll id.
|
||||
ErrPollsPollID ErrorType = 251
|
||||
|
||||
// Access denied, please vote first.
|
||||
ErrPollsAccessWithoutVote ErrorType = 253
|
||||
|
||||
// Access to the groups list is denied due to the user's privacy settings.
|
||||
ErrAccessGroups ErrorType = 260
|
||||
|
||||
// This album is full
|
||||
//
|
||||
// You need to delete the odd objects from the album or use another album.
|
||||
ErrAlbumFull ErrorType = 300
|
||||
ErrAlbumsLimit ErrorType = 302 // Albums number limit is reached
|
||||
|
||||
// Permission denied. You must enable votes processing in application
|
||||
// settings
|
||||
//
|
||||
// Check the app settings:
|
||||
//
|
||||
// http://vk.com/editapp?id={Your API_ID}§ion=payments
|
||||
//
|
||||
ErrVotesPermission ErrorType = 500
|
||||
|
||||
// Not enough votes.
|
||||
ErrVotes ErrorType = 503
|
||||
|
||||
// Not enough money on owner's balance.
|
||||
ErrNotEnoughMoney ErrorType = 504
|
||||
|
||||
// Permission denied. You have no access to operations specified with
|
||||
// given object(s).
|
||||
ErrAdsPermission ErrorType = 600
|
||||
|
||||
// Permission denied. You have requested too many actions this day. Try
|
||||
// later.
|
||||
ErrWeightedFlood ErrorType = 601
|
||||
|
||||
// Some part of the request has not been completed.
|
||||
ErrAdsPartialSuccess ErrorType = 602
|
||||
|
||||
// Some ads error occurred.
|
||||
ErrAdsSpecific ErrorType = 603
|
||||
|
||||
// Invalid domain.
|
||||
ErrAdsDomainInvalid ErrorType = 604
|
||||
|
||||
// Domain is forbidden.
|
||||
ErrAdsDomainForbidden ErrorType = 605
|
||||
|
||||
// Domain is reserved.
|
||||
ErrAdsDomainReserved ErrorType = 606
|
||||
|
||||
// Domain is occupied.
|
||||
ErrAdsDomainOccupied ErrorType = 607
|
||||
|
||||
// Domain is active.
|
||||
ErrAdsDomainActive ErrorType = 608
|
||||
|
||||
// Domain app is invalid.
|
||||
ErrAdsDomainAppInvalid ErrorType = 609
|
||||
|
||||
// Domain app is forbidden.
|
||||
ErrAdsDomainAppForbidden ErrorType = 610
|
||||
|
||||
// Application must be verified.
|
||||
ErrAdsApplicationMustBeVerified ErrorType = 611
|
||||
|
||||
// Application must be in domains list of site of ad unit.
|
||||
ErrAdsApplicationMustBeInDomainsList ErrorType = 612
|
||||
|
||||
// Application is blocked.
|
||||
ErrAdsApplicationBlocked ErrorType = 613
|
||||
|
||||
// Domain of type specified is forbidden in current office type.
|
||||
ErrAdsDomainTypeForbiddenInCurrentOffice ErrorType = 614
|
||||
|
||||
// Domain group is invalid.
|
||||
ErrAdsDomainGroupInvalid ErrorType = 615
|
||||
|
||||
// Domain group is forbidden.
|
||||
ErrAdsDomainGroupForbidden ErrorType = 616
|
||||
|
||||
// Domain app is blocked.
|
||||
ErrAdsDomainAppBlocked ErrorType = 617
|
||||
|
||||
// Domain group is not open.
|
||||
ErrAdsDomainGroupNotOpen ErrorType = 618
|
||||
|
||||
// Domain group is not possible to be joined to adsweb.
|
||||
ErrAdsDomainGroupNotPossibleJoined ErrorType = 619
|
||||
|
||||
// Domain group is blocked.
|
||||
ErrAdsDomainGroupBlocked ErrorType = 620
|
||||
|
||||
// Domain group has restriction: links are forbidden.
|
||||
ErrAdsDomainGroupLinksForbidden ErrorType = 621
|
||||
|
||||
// Domain group has restriction: excluded from search.
|
||||
ErrAdsDomainGroupExcludedFromSearch ErrorType = 622
|
||||
|
||||
// Domain group has restriction: cover is forbidden.
|
||||
ErrAdsDomainGroupCoverForbidden ErrorType = 623
|
||||
|
||||
// Domain group has wrong category.
|
||||
ErrAdsDomainGroupWrongCategory ErrorType = 624
|
||||
|
||||
// Domain group has wrong name.
|
||||
ErrAdsDomainGroupWrongName ErrorType = 625
|
||||
|
||||
// Domain group has low posts reach.
|
||||
ErrAdsDomainGroupLowPostsReach ErrorType = 626
|
||||
|
||||
// Domain group has wrong class.
|
||||
ErrAdsDomainGroupWrongClass ErrorType = 627
|
||||
|
||||
// Domain group is created recently.
|
||||
ErrAdsDomainGroupCreatedRecently ErrorType = 628
|
||||
|
||||
// Object deleted.
|
||||
ErrAdsObjectDeleted ErrorType = 629
|
||||
|
||||
// Lookalike request with same source already in progress.
|
||||
ErrAdsLookalikeRequestAlreadyInProgress ErrorType = 630
|
||||
|
||||
// Max count of lookalike requests per day reached.
|
||||
ErrAdsLookalikeRequestsLimit ErrorType = 631
|
||||
|
||||
// Given audience is too small.
|
||||
ErrAdsAudienceTooSmall ErrorType = 632
|
||||
|
||||
// Given audience is too large.
|
||||
ErrAdsAudienceTooLarge ErrorType = 633
|
||||
|
||||
// Lookalike request audience save already in progress.
|
||||
ErrAdsLookalikeAudienceSaveAlreadyInProgress ErrorType = 634
|
||||
|
||||
// Max count of lookalike request audience saves per day reached.
|
||||
ErrAdsLookalikeSavesLimit ErrorType = 635
|
||||
|
||||
// Max count of retargeting groups reached.
|
||||
ErrAdsRetargetingGroupsLimit ErrorType = 636
|
||||
|
||||
// Domain group has active nemesis punishment.
|
||||
ErrAdsDomainGroupActiveNemesisPunishment ErrorType = 637
|
||||
|
||||
// Cannot edit creator role.
|
||||
ErrGroupChangeCreator ErrorType = 700
|
||||
|
||||
// User should be in club.
|
||||
ErrGroupNotInClub ErrorType = 701
|
||||
|
||||
// Too many officers in club.
|
||||
ErrGroupTooManyOfficers ErrorType = 702
|
||||
|
||||
// You need to enable 2FA for this action.
|
||||
ErrGroupNeed2fa ErrorType = 703
|
||||
|
||||
// User needs to enable 2FA for this action.
|
||||
ErrGroupHostNeed2fa ErrorType = 704
|
||||
|
||||
// Too many addresses in club.
|
||||
ErrGroupTooManyAddresses ErrorType = 706
|
||||
|
||||
// "Application is not installed in community.
|
||||
ErrGroupAppIsNotInstalledInCommunity ErrorType = 711
|
||||
|
||||
// Invite link is invalid - expired, deleted or not exists.
|
||||
ErrGroupInvalidInviteLink ErrorType = 714
|
||||
|
||||
// This video is already added.
|
||||
ErrVideoAlreadyAdded ErrorType = 800
|
||||
|
||||
// Comments for this video are closed.
|
||||
ErrVideoCommentsClosed ErrorType = 801
|
||||
|
||||
// Can't send messages for users from blacklist.
|
||||
ErrMessagesUserBlocked ErrorType = 900
|
||||
|
||||
// Can't send messages for users without permission.
|
||||
ErrMessagesDenySend ErrorType = 901
|
||||
|
||||
// Can't send messages to this user due to their privacy settings.
|
||||
ErrMessagesPrivacy ErrorType = 902
|
||||
|
||||
// Value of ts or pts is too old.
|
||||
ErrMessagesTooOldPts ErrorType = 907
|
||||
|
||||
// Value of ts or pts is too new.
|
||||
ErrMessagesTooNewPts ErrorType = 908
|
||||
|
||||
// Can't edit this message, because it's too old.
|
||||
ErrMessagesEditExpired ErrorType = 909
|
||||
|
||||
// Can't sent this message, because it's too big.
|
||||
ErrMessagesTooBig ErrorType = 910
|
||||
|
||||
// Keyboard format is invalid.
|
||||
ErrMessagesKeyboardInvalid ErrorType = 911
|
||||
|
||||
// This is a chat bot feature, change this status in settings.
|
||||
ErrMessagesChatBotFeature ErrorType = 912
|
||||
|
||||
// Too many forwarded messages.
|
||||
ErrMessagesTooLongForwards ErrorType = 913
|
||||
|
||||
// Message is too long.
|
||||
ErrMessagesTooLongMessage ErrorType = 914
|
||||
|
||||
// You don't have access to this chat.
|
||||
ErrMessagesChatUserNoAccess ErrorType = 917
|
||||
|
||||
// You can't see invite link for this chat.
|
||||
ErrMessagesCantSeeInviteLink ErrorType = 919
|
||||
|
||||
// Can't edit this kind of message.
|
||||
ErrMessagesEditKindDisallowed ErrorType = 920
|
||||
|
||||
// Can't forward these messages.
|
||||
ErrMessagesCantFwd ErrorType = 921
|
||||
|
||||
// Can't delete this message for everybody.
|
||||
ErrMessagesCantDeleteForAll ErrorType = 924
|
||||
|
||||
// You are not admin of this chat.
|
||||
ErrMessagesChatNotAdmin ErrorType = 925
|
||||
|
||||
// Chat does not exist.
|
||||
ErrMessagesChatNotExist ErrorType = 927
|
||||
|
||||
// You can't change invite link for this chat.
|
||||
ErrMessagesCantChangeInviteLink ErrorType = 931
|
||||
|
||||
// Your community can't interact with this peer.
|
||||
ErrMessagesGroupPeerAccess ErrorType = 932
|
||||
|
||||
// User not found in chat.
|
||||
ErrMessagesChatUserNotInChat ErrorType = 935
|
||||
|
||||
// Contact not found.
|
||||
ErrMessagesContactNotFound ErrorType = 936
|
||||
|
||||
// Message request already send.
|
||||
ErrMessagesMessageRequestAlreadySend ErrorType = 939
|
||||
|
||||
// Too many posts in messages.
|
||||
ErrMessagesTooManyPosts ErrorType = 940
|
||||
|
||||
// Cannot pin one-time story.
|
||||
ErrMessagesCantPinOneTimeStory ErrorType = 942
|
||||
|
||||
// Cannot use this intent.
|
||||
ErrMessagesCantUseIntent ErrorType = 943
|
||||
|
||||
// Limits overflow for this intent.
|
||||
ErrMessagesLimitIntent ErrorType = 944
|
||||
|
||||
// Chat was disabled.
|
||||
ErrMessagesChatDisabled ErrorType = 945
|
||||
|
||||
// Chat not support.
|
||||
ErrMessagesChatNotSupported ErrorType = 946
|
||||
|
||||
// Can't add user to chat, because user has no access to group.
|
||||
ErrMessagesMemberAccessToGroupDenied ErrorType = 947
|
||||
|
||||
// Can't edit pinned message yet.
|
||||
ErrMessagesEditPinned ErrorType = 949
|
||||
|
||||
// Can't send message, reply timed out.
|
||||
ErrMessagesReplyTimedOut ErrorType = 950
|
||||
|
||||
// Invalid phone number.
|
||||
ErrParamPhone ErrorType = 1000
|
||||
|
||||
// This phone number is used by another user.
|
||||
ErrPhoneAlreadyUsed ErrorType = 1004
|
||||
|
||||
// Too many auth attempts, try again later.
|
||||
ErrAuthFloodError ErrorType = 1105
|
||||
|
||||
// Processing.. Try later.
|
||||
ErrAuthDelay ErrorType = 1112
|
||||
|
||||
// Invalid document id.
|
||||
ErrParamDocID ErrorType = 1150
|
||||
|
||||
// Access to document deleting is denied.
|
||||
ErrParamDocDeleteAccess ErrorType = 1151
|
||||
|
||||
// Invalid document title.
|
||||
ErrParamDocTitle ErrorType = 1152
|
||||
|
||||
// Access to document is denied.
|
||||
ErrParamDocAccess ErrorType = 1153
|
||||
|
||||
// Original photo was changed.
|
||||
ErrPhotoChanged ErrorType = 1160
|
||||
|
||||
// Too many feed lists.
|
||||
ErrTooManyLists ErrorType = 1170
|
||||
|
||||
// This achievement is already unlocked.
|
||||
ErrAppsAlreadyUnlocked ErrorType = 1251
|
||||
|
||||
// Subscription not found.
|
||||
ErrAppsSubscriptionNotFound ErrorType = 1256
|
||||
|
||||
// Subscription is in invalid status.
|
||||
ErrAppsSubscriptionInvalidStatus ErrorType = 1257
|
||||
|
||||
// Invalid screen name.
|
||||
ErrInvalidAddress ErrorType = 1260
|
||||
|
||||
// Catalog is not available for this user.
|
||||
ErrCommunitiesCatalogDisabled ErrorType = 1310
|
||||
|
||||
// Catalog categories are not available for this user.
|
||||
ErrCommunitiesCategoriesDisabled ErrorType = 1311
|
||||
|
||||
// Too late for restore.
|
||||
ErrMarketRestoreTooLate ErrorType = 1400
|
||||
|
||||
// Comments for this market are closed.
|
||||
ErrMarketCommentsClosed ErrorType = 1401
|
||||
|
||||
// Album not found.
|
||||
ErrMarketAlbumNotFound ErrorType = 1402
|
||||
|
||||
// Item not found.
|
||||
ErrMarketItemNotFound ErrorType = 1403
|
||||
|
||||
// Item already added to album.
|
||||
ErrMarketItemAlreadyAdded ErrorType = 1404
|
||||
|
||||
// Too many items.
|
||||
ErrMarketTooManyItems ErrorType = 1405
|
||||
|
||||
// Too many items in album.
|
||||
ErrMarketTooManyItemsInAlbum ErrorType = 1406
|
||||
|
||||
// Too many albums.
|
||||
ErrMarketTooManyAlbums ErrorType = 1407
|
||||
|
||||
// Item has bad links in description.
|
||||
ErrMarketItemHasBadLinks ErrorType = 1408
|
||||
|
||||
// Extended market not enabled.
|
||||
ErrMarketShopNotEnabled ErrorType = 1409
|
||||
|
||||
// Grouping items with different properties.
|
||||
ErrMarketGroupingItemsWithDifferentProperties ErrorType = 1412
|
||||
|
||||
// Grouping already has such variant.
|
||||
ErrMarketGroupingAlreadyHasSuchVariant ErrorType = 1413
|
||||
|
||||
// Variant not found.
|
||||
ErrMarketVariantNotFound ErrorType = 1416
|
||||
|
||||
// Property not found.
|
||||
ErrMarketPropertyNotFound ErrorType = 1417
|
||||
|
||||
// Grouping must have two or more items.
|
||||
ErrMarketGroupingMustContainMoreThanOneItem ErrorType = 1425
|
||||
|
||||
// Item must have distinct properties.
|
||||
ErrMarketGroupingItemsMustHaveDistinctProperties ErrorType = 1426
|
||||
|
||||
// Cart is empty.
|
||||
ErrMarketOrdersNoCartItems ErrorType = 1427
|
||||
|
||||
// Specify width, length, height and weight all together.
|
||||
ErrMarketInvalidDimensions ErrorType = 1429
|
||||
|
||||
// VK Pay status can not be changed.
|
||||
ErrMarketCantChangeVkpayStatus ErrorType = 1430
|
||||
|
||||
// Market was already enabled in this group.
|
||||
ErrMarketShopAlreadyEnabled ErrorType = 1431
|
||||
|
||||
// Market was already disabled in this group.
|
||||
ErrMarketShopAlreadyDisabled ErrorType = 1432
|
||||
|
||||
// Invalid image crop format.
|
||||
ErrMarketPhotosCropInvalidFormat ErrorType = 1433
|
||||
|
||||
// Crop bottom right corner is outside of the image.
|
||||
ErrMarketPhotosCropOverflow ErrorType = 1434
|
||||
|
||||
// Crop size is less than the minimum.
|
||||
ErrMarketPhotosCropSizeTooLow ErrorType = 1435
|
||||
|
||||
// Market not enabled.
|
||||
ErrMarketNotEnabled ErrorType = 1438
|
||||
|
||||
// Cart is empty.
|
||||
ErrMarketCartEmpty ErrorType = 1427
|
||||
|
||||
// Specify width, length, height and weight all together.
|
||||
ErrMarketSpecifyDimensions ErrorType = 1429
|
||||
|
||||
// VK Pay status can not be changed.
|
||||
ErrVKPayStatus ErrorType = 1430
|
||||
|
||||
// Market was already enabled in this group.
|
||||
ErrMarketAlreadyEnabled ErrorType = 1431
|
||||
|
||||
// Market was already disabled in this group.
|
||||
ErrMarketAlreadyDisabled ErrorType = 1432
|
||||
|
||||
// Story has already expired.
|
||||
ErrStoryExpired ErrorType = 1600
|
||||
|
||||
// Incorrect reply privacy.
|
||||
ErrStoryIncorrectReplyPrivacy ErrorType = 1602
|
||||
|
||||
// Card not found.
|
||||
ErrPrettyCardsCardNotFound ErrorType = 1900
|
||||
|
||||
// Too many cards.
|
||||
ErrPrettyCardsTooManyCards ErrorType = 1901
|
||||
|
||||
// Card is connected to post.
|
||||
ErrPrettyCardsCardIsConnectedToPost ErrorType = 1902
|
||||
|
||||
// Servers number limit is reached.
|
||||
ErrCallbackServersLimit ErrorType = 2000
|
||||
|
||||
// Stickers are not purchased.
|
||||
ErrStickersNotPurchased ErrorType = 2100
|
||||
|
||||
// Too many favorite stickers.
|
||||
ErrStickersTooManyFavorites ErrorType = 2101
|
||||
|
||||
// Stickers are not favorite.
|
||||
ErrStickersNotFavorite ErrorType = 2102
|
||||
|
||||
// Specified link is incorrect (can't find source).
|
||||
ErrWallCheckLinkCantDetermineSource ErrorType = 3102
|
||||
|
||||
// Recaptcha needed.
|
||||
ErrRecaptcha ErrorType = 3300
|
||||
|
||||
// Phone validation needed.
|
||||
ErrPhoneValidation ErrorType = 3301
|
||||
|
||||
// Password validation needed.
|
||||
ErrPasswordValidation ErrorType = 3302
|
||||
|
||||
// Otp app validation needed.
|
||||
ErrOtpAppValidation ErrorType = 3303
|
||||
|
||||
// Email confirmation needed.
|
||||
ErrEmailConfirmation ErrorType = 3304
|
||||
|
||||
// Assert votes.
|
||||
ErrAssertVotes ErrorType = 3305
|
||||
|
||||
// Token extension required.
|
||||
ErrTokenExtension ErrorType = 3609
|
||||
|
||||
// User is deactivated.
|
||||
ErrUserDeactivated ErrorType = 3610
|
||||
|
||||
// Service is deactivated for user.
|
||||
ErrServiceDeactivated ErrorType = 3611
|
||||
|
||||
// Can't set AliExpress tag to this type of object.
|
||||
ErrAliExpressTag ErrorType = 3800
|
||||
)
|
||||
|
||||
// ErrorSubtype is the subtype of an error.
|
||||
type ErrorSubtype int
|
||||
|
||||
// Error returns the message of a ErrorSubtype.
|
||||
func (e ErrorSubtype) Error() string {
|
||||
return fmt.Sprintf("api: error with subcode %d", e)
|
||||
}
|
||||
|
||||
// Error struct VK.
|
||||
type Error struct {
|
||||
Code ErrorType `json:"error_code"`
|
||||
Subcode ErrorSubtype `json:"error_subcode"`
|
||||
Message string `json:"error_msg"`
|
||||
Text string `json:"error_text"`
|
||||
CaptchaSID string `json:"captcha_sid"`
|
||||
CaptchaImg string `json:"captcha_img"`
|
||||
|
||||
// In some cases VK requires to request action confirmation from the user
|
||||
// (for Standalone apps only). Following error will be returned:
|
||||
//
|
||||
// Error code: 24
|
||||
// Error text: Confirmation required
|
||||
//
|
||||
// Following parameter is transmitted with the error message as well:
|
||||
//
|
||||
// confirmation_text – text of the message to be shown in the default
|
||||
// confirmation window.
|
||||
//
|
||||
// The app should display the default confirmation window with text from
|
||||
// confirmation_text and two buttons: "Continue" and "Cancel". If user
|
||||
// confirms the action repeat the request with an extra parameter:
|
||||
// confirm = 1.
|
||||
//
|
||||
// See https://vk.com/dev/need_confirmation
|
||||
ConfirmationText string `json:"confirmation_text"`
|
||||
|
||||
// In some cases VK requires a user validation procedure. . As a result
|
||||
// starting from API version 5.0 (for the older versions captcha_error
|
||||
// will be requested) following error will be returned as a reply to any
|
||||
// API request:
|
||||
//
|
||||
// Error code: 17
|
||||
// Error text: Validation Required
|
||||
//
|
||||
// Following parameter is transmitted with an error message:
|
||||
// redirect_uri – a special address to open in a browser to pass the
|
||||
// validation procedure.
|
||||
//
|
||||
// After passing the validation a user will be redirected to the service
|
||||
// page:
|
||||
//
|
||||
// https://oauth.vk.com/blank.html#{Data required for validation}
|
||||
//
|
||||
// In case of successful validation following parameters will be
|
||||
// transmitted after #:
|
||||
//
|
||||
// https://oauth.vk.com/blank.html#success=1&access_token={NEW USER TOKEN}&user_id={USER ID}
|
||||
//
|
||||
// If a token was not received by https a new secret will be transmitted
|
||||
// as well.
|
||||
//
|
||||
// In case of unsuccessful validation following address is transmitted:
|
||||
//
|
||||
// https://oauth.vk.com/blank.html#fail=1
|
||||
//
|
||||
// See https://vk.com/dev/need_validation
|
||||
RedirectURI string `json:"redirect_uri"`
|
||||
RequestParams []object.BaseRequestParam `json:"request_params"`
|
||||
}
|
||||
|
||||
// Error returns the message of a Error.
|
||||
func (e Error) Error() string {
|
||||
return "api: " + e.Message
|
||||
}
|
||||
|
||||
// Is unwraps its first argument sequentially looking for an error that matches
|
||||
// the second.
|
||||
func (e Error) Is(target error) bool {
|
||||
var tError *Error
|
||||
if errors.As(target, &tError) {
|
||||
return e.Code == tError.Code && e.Message == tError.Message
|
||||
}
|
||||
|
||||
var tErrorType ErrorType
|
||||
if errors.As(target, &tErrorType) {
|
||||
return e.Code == tErrorType
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// ExecuteError struct.
|
||||
//
|
||||
// TODO: v3 Code is ErrorType.
|
||||
type ExecuteError struct {
|
||||
Method string `json:"method"`
|
||||
Code int `json:"error_code"`
|
||||
Msg string `json:"error_msg"`
|
||||
}
|
||||
|
||||
// ExecuteErrors type.
|
||||
type ExecuteErrors []ExecuteError
|
||||
|
||||
// Error returns the message of a ExecuteErrors.
|
||||
func (e ExecuteErrors) Error() string {
|
||||
return fmt.Sprintf("api: execute errors (%d)", len(e))
|
||||
}
|
||||
|
||||
// InvalidContentType type.
|
||||
type InvalidContentType struct {
|
||||
ContentType string
|
||||
}
|
||||
|
||||
// Error returns the message of a InvalidContentType.
|
||||
func (e InvalidContentType) Error() string {
|
||||
return "api: invalid content-type"
|
||||
}
|
||||
|
||||
// UploadError type.
|
||||
type UploadError struct {
|
||||
Err string `json:"error"`
|
||||
Code int `json:"error_code"`
|
||||
Descr string `json:"error_descr"`
|
||||
IsLogged bool `json:"error_is_logged"`
|
||||
}
|
||||
|
||||
// Error returns the message of a UploadError.
|
||||
func (e UploadError) Error() string {
|
||||
if e.Err != "" {
|
||||
return "api: " + e.Err
|
||||
}
|
||||
|
||||
return fmt.Sprintf("api: upload code %d", e.Code)
|
||||
}
|
||||
|
||||
// AdsError struct.
|
||||
type AdsError struct {
|
||||
Code ErrorType `json:"error_code"`
|
||||
Desc string `json:"error_desc"`
|
||||
}
|
||||
|
||||
// Error returns the message of a AdsError.
|
||||
func (e AdsError) Error() string {
|
||||
return "api: " + e.Desc
|
||||
}
|
||||
|
||||
// Is unwraps its first argument sequentially looking for an error that matches
|
||||
// the second.
|
||||
func (e AdsError) Is(target error) bool {
|
||||
var tAdsError *AdsError
|
||||
if errors.As(target, &tAdsError) {
|
||||
return e.Code == tAdsError.Code && e.Desc == tAdsError.Desc
|
||||
}
|
||||
|
||||
var tErrorType ErrorType
|
||||
if errors.As(target, &tErrorType) {
|
||||
return e.Code == tErrorType
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
52
vendor/github.com/SevereCloud/vksdk/v2/api/execute.go
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
package api
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
// ExecuteWithArgs a universal method for calling a sequence of other methods
|
||||
// while saving and filtering interim results.
|
||||
//
|
||||
// The Args map variable allows you to retrieve the parameters passed during
|
||||
// the request and avoids code formatting.
|
||||
//
|
||||
// return Args.code; // return parameter "code"
|
||||
// return Args.v; // return parameter "v"
|
||||
//
|
||||
// https://vk.com/dev/execute
|
||||
func (vk *VK) ExecuteWithArgs(code string, params Params, obj interface{}) error {
|
||||
token := vk.getToken()
|
||||
|
||||
reqParams := Params{
|
||||
"code": code,
|
||||
"access_token": token,
|
||||
"v": vk.Version,
|
||||
}
|
||||
|
||||
resp, err := vk.Handler("execute", params, reqParams)
|
||||
|
||||
jsonErr := json.Unmarshal(resp.Response, &obj)
|
||||
if jsonErr != nil {
|
||||
return jsonErr
|
||||
}
|
||||
|
||||
if resp.ExecuteErrors != nil {
|
||||
return &resp.ExecuteErrors
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// Execute a universal method for calling a sequence of other methods while
|
||||
// saving and filtering interim results.
|
||||
//
|
||||
// https://vk.com/dev/execute
|
||||
func (vk *VK) Execute(code string, obj interface{}) error {
|
||||
return vk.ExecuteWithArgs(code, Params{}, obj)
|
||||
}
|
||||
|
||||
func fmtBool(value bool) string {
|
||||
if value {
|
||||
return "1"
|
||||
}
|
||||
|
||||
return "0"
|
||||
}
|
||||
231
vendor/github.com/SevereCloud/vksdk/v2/api/fave.go
generated
vendored
Normal file
@@ -0,0 +1,231 @@
|
||||
package api // import "github.com/SevereCloud/vksdk/v2/api"
|
||||
|
||||
import (
|
||||
"github.com/SevereCloud/vksdk/v2/object"
|
||||
)
|
||||
|
||||
// FaveAddArticle adds a link to user faves.
|
||||
//
|
||||
// https://vk.com/dev/fave.addArticle
|
||||
func (vk *VK) FaveAddArticle(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("fave.addArticle", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// FaveAddLink adds a link to user faves.
|
||||
//
|
||||
// https://vk.com/dev/fave.addLink
|
||||
func (vk *VK) FaveAddLink(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("fave.addLink", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// FaveAddPage method.
|
||||
//
|
||||
// https://vk.com/dev/fave.addPage
|
||||
func (vk *VK) FaveAddPage(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("fave.addPage", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// FaveAddPost method.
|
||||
//
|
||||
// https://vk.com/dev/fave.addPost
|
||||
func (vk *VK) FaveAddPost(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("fave.addPost", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// FaveAddProduct method.
|
||||
//
|
||||
// https://vk.com/dev/fave.addProduct
|
||||
func (vk *VK) FaveAddProduct(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("fave.addProduct", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// FaveAddTagResponse struct.
|
||||
type FaveAddTagResponse object.FaveTag
|
||||
|
||||
// FaveAddTag method.
|
||||
//
|
||||
// https://vk.com/dev/fave.addTag
|
||||
func (vk *VK) FaveAddTag(params Params) (response FaveAddTagResponse, err error) {
|
||||
err = vk.RequestUnmarshal("fave.addTag", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// FaveAddVideo method.
|
||||
//
|
||||
// https://vk.com/dev/fave.addVideo
|
||||
func (vk *VK) FaveAddVideo(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("fave.addVideo", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// FaveEditTag method.
|
||||
//
|
||||
// https://vk.com/dev/fave.editTag
|
||||
func (vk *VK) FaveEditTag(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("fave.editTag", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// FaveGetResponse struct.
|
||||
type FaveGetResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.FaveItem `json:"items"`
|
||||
}
|
||||
|
||||
// FaveGet method.
|
||||
//
|
||||
// extended=0
|
||||
//
|
||||
// https://vk.com/dev/fave.get
|
||||
func (vk *VK) FaveGet(params Params) (response FaveGetResponse, err error) {
|
||||
err = vk.RequestUnmarshal("fave.get", &response, params, Params{"extended": false})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// FaveGetExtendedResponse struct.
|
||||
type FaveGetExtendedResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.FaveItem `json:"items"`
|
||||
object.ExtendedResponse
|
||||
}
|
||||
|
||||
// FaveGetExtended method.
|
||||
//
|
||||
// extended=1
|
||||
//
|
||||
// https://vk.com/dev/fave.get
|
||||
func (vk *VK) FaveGetExtended(params Params) (response FaveGetExtendedResponse, err error) {
|
||||
err = vk.RequestUnmarshal("fave.get", &response, params, Params{"extended": true})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// FaveGetPagesResponse struct.
|
||||
type FaveGetPagesResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.FavePage `json:"items"`
|
||||
}
|
||||
|
||||
// FaveGetPages method.
|
||||
//
|
||||
// https://vk.com/dev/fave.getPages
|
||||
func (vk *VK) FaveGetPages(params Params) (response FaveGetPagesResponse, err error) {
|
||||
err = vk.RequestUnmarshal("fave.getPages", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// FaveGetTagsResponse struct.
|
||||
type FaveGetTagsResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.FaveTag `json:"items"`
|
||||
}
|
||||
|
||||
// FaveGetTags method.
|
||||
//
|
||||
// https://vk.com/dev/fave.getTags
|
||||
func (vk *VK) FaveGetTags(params Params) (response FaveGetTagsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("fave.getTags", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// FaveMarkSeen method.
|
||||
//
|
||||
// https://vk.com/dev/fave.markSeen
|
||||
func (vk *VK) FaveMarkSeen(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("fave.markSeen", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// FaveRemoveArticle method.
|
||||
//
|
||||
// https://vk.com/dev/fave.removeArticle
|
||||
func (vk *VK) FaveRemoveArticle(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("fave.removeArticle", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// FaveRemoveLink removes link from the user's faves.
|
||||
//
|
||||
// https://vk.com/dev/fave.removeLink
|
||||
func (vk *VK) FaveRemoveLink(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("fave.removeLink", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// FaveRemovePage method.
|
||||
//
|
||||
// https://vk.com/dev/fave.removePage
|
||||
func (vk *VK) FaveRemovePage(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("fave.removePage", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// FaveRemovePost method.
|
||||
//
|
||||
// https://vk.com/dev/fave.removePost
|
||||
func (vk *VK) FaveRemovePost(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("fave.removePost", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// FaveRemoveProduct method.
|
||||
//
|
||||
// https://vk.com/dev/fave.removeProduct
|
||||
func (vk *VK) FaveRemoveProduct(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("fave.removeProduct", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// FaveRemoveTag method.
|
||||
//
|
||||
// https://vk.com/dev/fave.removeTag
|
||||
func (vk *VK) FaveRemoveTag(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("fave.removeTag", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// FaveRemoveVideo method.
|
||||
//
|
||||
// https://vk.com/dev/fave.removeVideo
|
||||
func (vk *VK) FaveRemoveVideo(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("fave.removeVideo", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// FaveReorderTags method.
|
||||
//
|
||||
// https://vk.com/dev/fave.reorderTags
|
||||
func (vk *VK) FaveReorderTags(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("fave.reorderTags", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// FaveSetPageTags method.
|
||||
//
|
||||
// https://vk.com/dev/fave.setPageTags
|
||||
func (vk *VK) FaveSetPageTags(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("fave.setPageTags", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// FaveSetTags method.
|
||||
//
|
||||
// https://vk.com/dev/fave.setTags
|
||||
func (vk *VK) FaveSetTags(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("fave.setTags", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// FaveTrackPageInteraction method.
|
||||
//
|
||||
// https://vk.com/dev/fave.trackPageInteraction
|
||||
func (vk *VK) FaveTrackPageInteraction(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("fave.trackPageInteraction", &response, params)
|
||||
return
|
||||
}
|
||||
295
vendor/github.com/SevereCloud/vksdk/v2/api/friends.go
generated
vendored
Normal file
@@ -0,0 +1,295 @@
|
||||
package api // import "github.com/SevereCloud/vksdk/v2/api"
|
||||
|
||||
import (
|
||||
"github.com/SevereCloud/vksdk/v2/object"
|
||||
)
|
||||
|
||||
// FriendsAdd approves or creates a friend request.
|
||||
//
|
||||
// https://vk.com/dev/friends.add
|
||||
func (vk *VK) FriendsAdd(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("friends.add", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// FriendsAddListResponse struct.
|
||||
type FriendsAddListResponse struct {
|
||||
ListID int `json:"list_id"`
|
||||
}
|
||||
|
||||
// FriendsAddList creates a new friend list for the current user.
|
||||
//
|
||||
// https://vk.com/dev/friends.addList
|
||||
func (vk *VK) FriendsAddList(params Params) (response FriendsAddListResponse, err error) {
|
||||
err = vk.RequestUnmarshal("friends.addList", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// FriendsAreFriendsResponse struct.
|
||||
type FriendsAreFriendsResponse []object.FriendsFriendStatus
|
||||
|
||||
// FriendsAreFriends checks the current user's friendship status with other specified users.
|
||||
//
|
||||
// https://vk.com/dev/friends.areFriends
|
||||
func (vk *VK) FriendsAreFriends(params Params) (response FriendsAreFriendsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("friends.areFriends", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// FriendsDeleteResponse struct.
|
||||
type FriendsDeleteResponse struct {
|
||||
Success object.BaseBoolInt `json:"success"`
|
||||
FriendDeleted object.BaseBoolInt `json:"friend_deleted"`
|
||||
OutRequestDeleted object.BaseBoolInt `json:"out_request_deleted"`
|
||||
InRequestDeleted object.BaseBoolInt `json:"in_request_deleted"`
|
||||
SuggestionDeleted object.BaseBoolInt `json:"suggestion_deleted"`
|
||||
}
|
||||
|
||||
// FriendsDelete declines a friend request or deletes a user from the current user's friend list.
|
||||
//
|
||||
// https://vk.com/dev/friends.delete
|
||||
func (vk *VK) FriendsDelete(params Params) (response FriendsDeleteResponse, err error) {
|
||||
err = vk.RequestUnmarshal("friends.delete", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// FriendsDeleteAllRequests marks all incoming friend requests as viewed.
|
||||
//
|
||||
// https://vk.com/dev/friends.deleteAllRequests
|
||||
func (vk *VK) FriendsDeleteAllRequests(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("friends.deleteAllRequests", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// FriendsDeleteList deletes a friend list of the current user.
|
||||
//
|
||||
// https://vk.com/dev/friends.deleteList
|
||||
func (vk *VK) FriendsDeleteList(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("friends.deleteList", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// FriendsEdit edits the friend lists of the selected user.
|
||||
//
|
||||
// https://vk.com/dev/friends.edit
|
||||
func (vk *VK) FriendsEdit(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("friends.edit", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// FriendsEditList edits a friend list of the current user.
|
||||
//
|
||||
// https://vk.com/dev/friends.editList
|
||||
func (vk *VK) FriendsEditList(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("friends.editList", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// FriendsGetResponse struct.
|
||||
type FriendsGetResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []int `json:"items"`
|
||||
}
|
||||
|
||||
// FriendsGet returns a list of user IDs or detailed information about a user's friends.
|
||||
//
|
||||
// https://vk.com/dev/friends.get
|
||||
func (vk *VK) FriendsGet(params Params) (response FriendsGetResponse, err error) {
|
||||
err = vk.RequestUnmarshal("friends.get", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// FriendsGetFieldsResponse struct.
|
||||
type FriendsGetFieldsResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.FriendsUserXtrLists `json:"items"`
|
||||
}
|
||||
|
||||
// FriendsGetFields returns a list of user IDs or detailed information about a user's friends.
|
||||
//
|
||||
// https://vk.com/dev/friends.get
|
||||
func (vk *VK) FriendsGetFields(params Params) (response FriendsGetFieldsResponse, err error) {
|
||||
reqParams := make(Params)
|
||||
if v, prs := params["fields"]; v == "" || !prs {
|
||||
reqParams["fields"] = "id"
|
||||
}
|
||||
|
||||
err = vk.RequestUnmarshal("friends.get", &response, params, reqParams)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// FriendsGetAppUsersResponse struct.
|
||||
type FriendsGetAppUsersResponse []int
|
||||
|
||||
// FriendsGetAppUsers returns a list of IDs of the current user's friends who installed the application.
|
||||
//
|
||||
// https://vk.com/dev/friends.getAppUsers
|
||||
func (vk *VK) FriendsGetAppUsers(params Params) (response FriendsGetAppUsersResponse, err error) {
|
||||
err = vk.RequestUnmarshal("friends.getAppUsers", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// FriendsGetByPhonesResponse struct.
|
||||
type FriendsGetByPhonesResponse []object.FriendsUserXtrPhone
|
||||
|
||||
// FriendsGetByPhones returns a list of the current user's friends
|
||||
// whose phone numbers, validated or specified in a profile, are in a given list.
|
||||
//
|
||||
// https://vk.com/dev/friends.getByPhones
|
||||
func (vk *VK) FriendsGetByPhones(params Params) (response FriendsGetByPhonesResponse, err error) {
|
||||
err = vk.RequestUnmarshal("friends.getByPhones", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// FriendsGetListsResponse struct.
|
||||
type FriendsGetListsResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.FriendsFriendsList `json:"items"`
|
||||
}
|
||||
|
||||
// FriendsGetLists returns a list of the user's friend lists.
|
||||
//
|
||||
// https://vk.com/dev/friends.getLists
|
||||
func (vk *VK) FriendsGetLists(params Params) (response FriendsGetListsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("friends.getLists", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// FriendsGetMutualResponse struct.
|
||||
type FriendsGetMutualResponse []int
|
||||
|
||||
// FriendsGetMutual returns a list of user IDs of the mutual friends of two users.
|
||||
//
|
||||
// https://vk.com/dev/friends.getMutual
|
||||
func (vk *VK) FriendsGetMutual(params Params) (response FriendsGetMutualResponse, err error) {
|
||||
err = vk.RequestUnmarshal("friends.getMutual", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// FriendsGetOnline returns a list of user IDs of a user's friends who are online.
|
||||
//
|
||||
// online_mobile=0
|
||||
//
|
||||
// https://vk.com/dev/friends.getOnline
|
||||
func (vk *VK) FriendsGetOnline(params Params) (response []int, err error) {
|
||||
err = vk.RequestUnmarshal("friends.getOnline", &response, params, Params{"online_mobile": false})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// FriendsGetOnlineOnlineMobileResponse struct.
|
||||
type FriendsGetOnlineOnlineMobileResponse struct {
|
||||
Online []int `json:"online"`
|
||||
OnlineMobile []int `json:"online_mobile"`
|
||||
}
|
||||
|
||||
// FriendsGetOnlineOnlineMobile returns a list of user IDs of a user's friends who are online.
|
||||
//
|
||||
// online_mobile=1
|
||||
//
|
||||
// https://vk.com/dev/friends.getOnline
|
||||
func (vk *VK) FriendsGetOnlineOnlineMobile(params Params) (response FriendsGetOnlineOnlineMobileResponse, err error) {
|
||||
err = vk.RequestUnmarshal("friends.getOnline", &response, params, Params{"online_mobile": true})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// FriendsGetRecentResponse struct.
|
||||
type FriendsGetRecentResponse []int
|
||||
|
||||
// FriendsGetRecent returns a list of user IDs of the current user's recently added friends.
|
||||
//
|
||||
// https://vk.com/dev/friends.getRecent
|
||||
func (vk *VK) FriendsGetRecent(params Params) (response FriendsGetRecentResponse, err error) {
|
||||
err = vk.RequestUnmarshal("friends.getRecent", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// FriendsGetRequestsResponse struct.
|
||||
type FriendsGetRequestsResponse struct {
|
||||
Count int `json:"count"` // Total requests number
|
||||
Items []int `json:"items"`
|
||||
}
|
||||
|
||||
// FriendsGetRequests returns information about the current user's incoming and outgoing friend requests.
|
||||
//
|
||||
// https://vk.com/dev/friends.getRequests
|
||||
func (vk *VK) FriendsGetRequests(params Params) (response FriendsGetRequestsResponse, err error) {
|
||||
reqParams := Params{
|
||||
"need_mutual": false,
|
||||
"extended": false,
|
||||
}
|
||||
|
||||
err = vk.RequestUnmarshal("friends.getRequests", &response, params, reqParams)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// FriendsGetRequestsNeedMutualResponse struct.
|
||||
type FriendsGetRequestsNeedMutualResponse struct {
|
||||
Count int `json:"count"` // Total requests number
|
||||
Items []object.FriendsRequests `json:"items"`
|
||||
}
|
||||
|
||||
// FriendsGetRequestsNeedMutual returns information about the current user's incoming and outgoing friend requests.
|
||||
//
|
||||
// https://vk.com/dev/friends.getRequests
|
||||
func (vk *VK) FriendsGetRequestsNeedMutual(params Params) (response FriendsGetRequestsNeedMutualResponse, err error) {
|
||||
reqParams := Params{
|
||||
"extended": false,
|
||||
"need_mutual": true,
|
||||
}
|
||||
|
||||
err = vk.RequestUnmarshal("friends.getRequests", &response, params, reqParams)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// FriendsGetRequestsExtendedResponse struct.
|
||||
type FriendsGetRequestsExtendedResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.FriendsRequestsXtrMessage `json:"items"`
|
||||
}
|
||||
|
||||
// FriendsGetRequestsExtended returns information about the current user's incoming and outgoing friend requests.
|
||||
//
|
||||
// https://vk.com/dev/friends.getRequests
|
||||
func (vk *VK) FriendsGetRequestsExtended(params Params) (response FriendsGetRequestsExtendedResponse, err error) {
|
||||
reqParams := Params{
|
||||
"need_mutual": false,
|
||||
"extended": true,
|
||||
}
|
||||
|
||||
err = vk.RequestUnmarshal("friends.getRequests", &response, params, reqParams)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// FriendsGetSuggestionsResponse struct.
|
||||
type FriendsGetSuggestionsResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.UsersUser `json:"items"`
|
||||
}
|
||||
|
||||
// FriendsGetSuggestions returns a list of profiles of users whom the current user may know.
|
||||
//
|
||||
// https://vk.com/dev/friends.getSuggestions
|
||||
func (vk *VK) FriendsGetSuggestions(params Params) (response FriendsGetSuggestionsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("friends.getSuggestions", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// FriendsSearchResponse struct.
|
||||
type FriendsSearchResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.UsersUser `json:"items"`
|
||||
}
|
||||
|
||||
// FriendsSearch returns a list of friends matching the search criteria.
|
||||
//
|
||||
// https://vk.com/dev/friends.search
|
||||
func (vk *VK) FriendsSearch(params Params) (response FriendsSearchResponse, err error) {
|
||||
err = vk.RequestUnmarshal("friends.search", &response, params)
|
||||
return
|
||||
}
|
||||
32
vendor/github.com/SevereCloud/vksdk/v2/api/gifts.go
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
package api // import "github.com/SevereCloud/vksdk/v2/api"
|
||||
|
||||
import "github.com/SevereCloud/vksdk/v2/object"
|
||||
|
||||
// GiftsGetResponse struct.
|
||||
type GiftsGetResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.GiftsGift `json:"items"`
|
||||
}
|
||||
|
||||
// GiftsGet returns a list of user gifts.
|
||||
//
|
||||
// https://vk.com/dev/gifts.get
|
||||
func (vk *VK) GiftsGet(params Params) (response GiftsGetResponse, err error) {
|
||||
err = vk.RequestUnmarshal("gifts.get", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GiftsGetCatalogResponse struct.
|
||||
type GiftsGetCatalogResponse []struct {
|
||||
Name string `json:"name"`
|
||||
Title string `json:"title"`
|
||||
Items []object.GiftsGift `json:"items"`
|
||||
}
|
||||
|
||||
// GiftsGetCatalog returns catalog.
|
||||
//
|
||||
// https://vk.com/dev/gifts.get
|
||||
func (vk *VK) GiftsGetCatalog(params Params) (response GiftsGetCatalogResponse, err error) {
|
||||
err = vk.RequestUnmarshal("gifts.getCatalog", &response, params)
|
||||
return
|
||||
}
|
||||
712
vendor/github.com/SevereCloud/vksdk/v2/api/groups.go
generated
vendored
Normal file
@@ -0,0 +1,712 @@
|
||||
package api // import "github.com/SevereCloud/vksdk/v2/api"
|
||||
|
||||
import (
|
||||
"github.com/SevereCloud/vksdk/v2/object"
|
||||
)
|
||||
|
||||
// GroupsAddAddressResponse struct.
|
||||
type GroupsAddAddressResponse object.GroupsAddress
|
||||
|
||||
// GroupsAddAddress groups.addAddress.
|
||||
//
|
||||
// https://vk.com/dev/groups.addAddress
|
||||
func (vk *VK) GroupsAddAddress(params Params) (response GroupsAddAddressResponse, err error) {
|
||||
err = vk.RequestUnmarshal("groups.addAddress", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsAddCallbackServerResponse struct.
|
||||
type GroupsAddCallbackServerResponse struct {
|
||||
ServerID int `json:"server_id"`
|
||||
}
|
||||
|
||||
// GroupsAddCallbackServer callback API server to the community.
|
||||
//
|
||||
// https://vk.com/dev/groups.addCallbackServer
|
||||
func (vk *VK) GroupsAddCallbackServer(params Params) (response GroupsAddCallbackServerResponse, err error) {
|
||||
err = vk.RequestUnmarshal("groups.addCallbackServer", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsAddLinkResponse struct.
|
||||
type GroupsAddLinkResponse object.GroupsGroupLink
|
||||
|
||||
// GroupsAddLink allows to add a link to the community.
|
||||
//
|
||||
// https://vk.com/dev/groups.addLink
|
||||
func (vk *VK) GroupsAddLink(params Params) (response GroupsAddLinkResponse, err error) {
|
||||
err = vk.RequestUnmarshal("groups.addLink", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsApproveRequest allows to approve join request to the community.
|
||||
//
|
||||
// https://vk.com/dev/groups.approveRequest
|
||||
func (vk *VK) GroupsApproveRequest(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("groups.approveRequest", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsBan adds a user or a group to the community blacklist.
|
||||
//
|
||||
// https://vk.com/dev/groups.ban
|
||||
func (vk *VK) GroupsBan(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("groups.ban", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsCreateResponse struct.
|
||||
type GroupsCreateResponse object.GroupsGroup
|
||||
|
||||
// GroupsCreate creates a new community.
|
||||
//
|
||||
// https://vk.com/dev/groups.create
|
||||
func (vk *VK) GroupsCreate(params Params) (response GroupsCreateResponse, err error) {
|
||||
err = vk.RequestUnmarshal("groups.create", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsDeleteAddress groups.deleteAddress.
|
||||
//
|
||||
// https://vk.com/dev/groups.deleteAddress
|
||||
func (vk *VK) GroupsDeleteAddress(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("groups.deleteAddress", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsDeleteCallbackServer callback API server from the community.
|
||||
//
|
||||
// https://vk.com/dev/groups.deleteCallbackServer
|
||||
func (vk *VK) GroupsDeleteCallbackServer(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("groups.deleteCallbackServer", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsDeleteLink allows to delete a link from the community.
|
||||
//
|
||||
// https://vk.com/dev/groups.deleteLink
|
||||
func (vk *VK) GroupsDeleteLink(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("groups.deleteLink", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsDisableOnline disables "online" status in the community.
|
||||
//
|
||||
// https://vk.com/dev/groups.disableOnline
|
||||
func (vk *VK) GroupsDisableOnline(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("groups.disableOnline", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsEdit edits a community.
|
||||
//
|
||||
// https://vk.com/dev/groups.edit
|
||||
func (vk *VK) GroupsEdit(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("groups.edit", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsEditAddressResponse struct.
|
||||
type GroupsEditAddressResponse object.GroupsAddress
|
||||
|
||||
// GroupsEditAddress groups.editAddress.
|
||||
//
|
||||
// https://vk.com/dev/groups.editAddress
|
||||
func (vk *VK) GroupsEditAddress(params Params) (response GroupsEditAddressResponse, err error) {
|
||||
err = vk.RequestUnmarshal("groups.editAddress", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsEditCallbackServer edits Callback API server in the community.
|
||||
//
|
||||
// https://vk.com/dev/groups.editCallbackServer
|
||||
func (vk *VK) GroupsEditCallbackServer(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("groups.editCallbackServer", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsEditLink allows to edit a link in the community.
|
||||
//
|
||||
// https://vk.com/dev/groups.editLink
|
||||
func (vk *VK) GroupsEditLink(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("groups.editLink", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsEditManager allows to add, remove or edit the community manager .
|
||||
//
|
||||
// https://vk.com/dev/groups.editManager
|
||||
func (vk *VK) GroupsEditManager(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("groups.editManager", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsEnableOnline enables "online" status in the community.
|
||||
//
|
||||
// https://vk.com/dev/groups.enableOnline
|
||||
func (vk *VK) GroupsEnableOnline(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("groups.enableOnline", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsGetResponse struct.
|
||||
type GroupsGetResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []int `json:"items"`
|
||||
}
|
||||
|
||||
// GroupsGet returns a list of the communities to which a user belongs.
|
||||
//
|
||||
// extended=0
|
||||
//
|
||||
// https://vk.com/dev/groups.get
|
||||
func (vk *VK) GroupsGet(params Params) (response GroupsGetResponse, err error) {
|
||||
err = vk.RequestUnmarshal("groups.get", &response, params, Params{"extended": false})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsGetExtendedResponse struct.
|
||||
type GroupsGetExtendedResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.GroupsGroup `json:"items"`
|
||||
}
|
||||
|
||||
// GroupsGetExtended returns a list of the communities to which a user belongs.
|
||||
//
|
||||
// extended=1
|
||||
//
|
||||
// https://vk.com/dev/groups.get
|
||||
func (vk *VK) GroupsGetExtended(params Params) (response GroupsGetExtendedResponse, err error) {
|
||||
err = vk.RequestUnmarshal("groups.get", &response, params, Params{"extended": true})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsGetAddressesResponse struct.
|
||||
type GroupsGetAddressesResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.GroupsAddress `json:"items"`
|
||||
}
|
||||
|
||||
// GroupsGetAddresses groups.getAddresses.
|
||||
//
|
||||
// https://vk.com/dev/groups.getAddresses
|
||||
func (vk *VK) GroupsGetAddresses(params Params) (response GroupsGetAddressesResponse, err error) {
|
||||
err = vk.RequestUnmarshal("groups.getAddresses", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsGetBannedResponse struct.
|
||||
type GroupsGetBannedResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.GroupsOwnerXtrBanInfo `json:"items"`
|
||||
}
|
||||
|
||||
// GroupsGetBanned returns a list of users on a community blacklist.
|
||||
//
|
||||
// https://vk.com/dev/groups.getBanned
|
||||
func (vk *VK) GroupsGetBanned(params Params) (response GroupsGetBannedResponse, err error) {
|
||||
err = vk.RequestUnmarshal("groups.getBanned", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsGetByIDResponse struct.
|
||||
type GroupsGetByIDResponse []object.GroupsGroup
|
||||
|
||||
// GroupsGetByID returns information about communities by their IDs.
|
||||
//
|
||||
// https://vk.com/dev/groups.getById
|
||||
func (vk *VK) GroupsGetByID(params Params) (response GroupsGetByIDResponse, err error) {
|
||||
err = vk.RequestUnmarshal("groups.getById", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsGetCallbackConfirmationCodeResponse struct.
|
||||
type GroupsGetCallbackConfirmationCodeResponse struct {
|
||||
Code string `json:"code"`
|
||||
}
|
||||
|
||||
// GroupsGetCallbackConfirmationCode returns Callback API confirmation code for the community.
|
||||
//
|
||||
// https://vk.com/dev/groups.getCallbackConfirmationCode
|
||||
func (vk *VK) GroupsGetCallbackConfirmationCode(params Params) (
|
||||
response GroupsGetCallbackConfirmationCodeResponse,
|
||||
err error,
|
||||
) {
|
||||
err = vk.RequestUnmarshal("groups.getCallbackConfirmationCode", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsGetCallbackServersResponse struct.
|
||||
type GroupsGetCallbackServersResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.GroupsCallbackServer `json:"items"`
|
||||
}
|
||||
|
||||
// GroupsGetCallbackServers receives a list of Callback API servers from the community.
|
||||
//
|
||||
// https://vk.com/dev/groups.getCallbackServers
|
||||
func (vk *VK) GroupsGetCallbackServers(params Params) (response GroupsGetCallbackServersResponse, err error) {
|
||||
err = vk.RequestUnmarshal("groups.getCallbackServers", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsGetCallbackSettingsResponse struct.
|
||||
type GroupsGetCallbackSettingsResponse object.GroupsCallbackSettings
|
||||
|
||||
// GroupsGetCallbackSettings returns Callback API notifications settings.
|
||||
//
|
||||
// BUG(VK): MessageEdit always 0 https://vk.com/bugtracker?act=show&id=86762
|
||||
//
|
||||
// https://vk.com/dev/groups.getCallbackSettings
|
||||
func (vk *VK) GroupsGetCallbackSettings(params Params) (response GroupsGetCallbackSettingsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("groups.getCallbackSettings", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsGetCatalogResponse struct.
|
||||
type GroupsGetCatalogResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.GroupsGroup `json:"items"`
|
||||
}
|
||||
|
||||
// GroupsGetCatalog returns communities list for a catalog category.
|
||||
//
|
||||
// https://vk.com/dev/groups.getCatalog
|
||||
func (vk *VK) GroupsGetCatalog(params Params) (response GroupsGetCatalogResponse, err error) {
|
||||
err = vk.RequestUnmarshal("groups.getCatalog", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsGetCatalogInfoResponse struct.
|
||||
type GroupsGetCatalogInfoResponse struct {
|
||||
Enabled object.BaseBoolInt `json:"enabled"`
|
||||
Categories []object.GroupsGroupCategory `json:"categories"`
|
||||
}
|
||||
|
||||
// GroupsGetCatalogInfo returns categories list for communities catalog.
|
||||
//
|
||||
// extended=0
|
||||
//
|
||||
// https://vk.com/dev/groups.getCatalogInfo
|
||||
func (vk *VK) GroupsGetCatalogInfo(params Params) (response GroupsGetCatalogInfoResponse, err error) {
|
||||
err = vk.RequestUnmarshal("groups.getCatalogInfo", &response, params, Params{"extended": false})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsGetCatalogInfoExtendedResponse struct.
|
||||
type GroupsGetCatalogInfoExtendedResponse struct {
|
||||
Enabled object.BaseBoolInt `json:"enabled"`
|
||||
Categories []object.GroupsGroupCategoryFull `json:"categories"`
|
||||
}
|
||||
|
||||
// GroupsGetCatalogInfoExtended returns categories list for communities catalog.
|
||||
//
|
||||
// extended=1
|
||||
//
|
||||
// https://vk.com/dev/groups.getCatalogInfo
|
||||
func (vk *VK) GroupsGetCatalogInfoExtended(params Params) (response GroupsGetCatalogInfoExtendedResponse, err error) {
|
||||
err = vk.RequestUnmarshal("groups.getCatalogInfo", &response, params, Params{"extended": true})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsGetInvitedUsersResponse struct.
|
||||
type GroupsGetInvitedUsersResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.UsersUser `json:"items"`
|
||||
}
|
||||
|
||||
// GroupsGetInvitedUsers returns invited users list of a community.
|
||||
//
|
||||
// https://vk.com/dev/groups.getInvitedUsers
|
||||
func (vk *VK) GroupsGetInvitedUsers(params Params) (response GroupsGetInvitedUsersResponse, err error) {
|
||||
err = vk.RequestUnmarshal("groups.getInvitedUsers", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsGetInvitesResponse struct.
|
||||
type GroupsGetInvitesResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.GroupsGroupXtrInvitedBy `json:"items"`
|
||||
}
|
||||
|
||||
// GroupsGetInvites returns a list of invitations to join communities and events.
|
||||
//
|
||||
// https://vk.com/dev/groups.getInvites
|
||||
func (vk *VK) GroupsGetInvites(params Params) (response GroupsGetInvitesResponse, err error) {
|
||||
err = vk.RequestUnmarshal("groups.getInvites", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsGetInvitesExtendedResponse struct.
|
||||
type GroupsGetInvitesExtendedResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.GroupsGroupXtrInvitedBy `json:"items"`
|
||||
object.ExtendedResponse
|
||||
}
|
||||
|
||||
// GroupsGetInvitesExtended returns a list of invitations to join communities and events.
|
||||
//
|
||||
// https://vk.com/dev/groups.getInvites
|
||||
func (vk *VK) GroupsGetInvitesExtended(params Params) (response GroupsGetInvitesExtendedResponse, err error) {
|
||||
err = vk.RequestUnmarshal("groups.getInvites", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsGetLongPollServerResponse struct.
|
||||
type GroupsGetLongPollServerResponse object.GroupsLongPollServer
|
||||
|
||||
// GroupsGetLongPollServer returns data for Bots Long Poll API connection.
|
||||
//
|
||||
// https://vk.com/dev/groups.getLongPollServer
|
||||
func (vk *VK) GroupsGetLongPollServer(params Params) (response GroupsGetLongPollServerResponse, err error) {
|
||||
err = vk.RequestUnmarshal("groups.getLongPollServer", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsGetLongPollSettingsResponse struct.
|
||||
type GroupsGetLongPollSettingsResponse object.GroupsLongPollSettings
|
||||
|
||||
// GroupsGetLongPollSettings returns Bots Long Poll API settings.
|
||||
//
|
||||
// https://vk.com/dev/groups.getLongPollSettings
|
||||
func (vk *VK) GroupsGetLongPollSettings(params Params) (response GroupsGetLongPollSettingsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("groups.getLongPollSettings", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsGetMembersResponse struct.
|
||||
type GroupsGetMembersResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []int `json:"items"`
|
||||
}
|
||||
|
||||
// GroupsGetMembers returns a list of community members.
|
||||
//
|
||||
// https://vk.com/dev/groups.getMembers
|
||||
func (vk *VK) GroupsGetMembers(params Params) (response GroupsGetMembersResponse, err error) {
|
||||
err = vk.RequestUnmarshal("groups.getMembers", &response, params, Params{"filter": ""})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsGetMembersFieldsResponse struct.
|
||||
type GroupsGetMembersFieldsResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.UsersUser `json:"items"`
|
||||
}
|
||||
|
||||
// GroupsGetMembersFields returns a list of community members.
|
||||
//
|
||||
// https://vk.com/dev/groups.getMembers
|
||||
func (vk *VK) GroupsGetMembersFields(params Params) (response GroupsGetMembersFieldsResponse, err error) {
|
||||
reqParams := make(Params)
|
||||
if v, prs := params["fields"]; v == "" || !prs {
|
||||
reqParams["fields"] = "id"
|
||||
}
|
||||
|
||||
err = vk.RequestUnmarshal("groups.getMembers", &response, params, reqParams)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsGetMembersFilterManagersResponse struct.
|
||||
type GroupsGetMembersFilterManagersResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.GroupsMemberRoleXtrUsersUser `json:"items"`
|
||||
}
|
||||
|
||||
// GroupsGetMembersFilterManagers returns a list of community members.
|
||||
//
|
||||
// filter=managers
|
||||
//
|
||||
// https://vk.com/dev/groups.getMembers
|
||||
func (vk *VK) GroupsGetMembersFilterManagers(params Params) (
|
||||
response GroupsGetMembersFilterManagersResponse,
|
||||
err error,
|
||||
) {
|
||||
err = vk.RequestUnmarshal("groups.getMembers", &response, params, Params{"filter": "managers"})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsGetOnlineStatusResponse struct.
|
||||
type GroupsGetOnlineStatusResponse object.GroupsOnlineStatus
|
||||
|
||||
// GroupsGetOnlineStatus returns a community's online status.
|
||||
//
|
||||
// https://vk.com/dev/groups.getOnlineStatus
|
||||
func (vk *VK) GroupsGetOnlineStatus(params Params) (response GroupsGetOnlineStatusResponse, err error) {
|
||||
err = vk.RequestUnmarshal("groups.getOnlineStatus", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsGetRequestsResponse struct.
|
||||
type GroupsGetRequestsResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []int `json:"items"`
|
||||
}
|
||||
|
||||
// GroupsGetRequests returns a list of requests to the community.
|
||||
//
|
||||
// https://vk.com/dev/groups.getRequests
|
||||
func (vk *VK) GroupsGetRequests(params Params) (response GroupsGetRequestsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("groups.getRequests", &response, params, Params{"fields": ""})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsGetRequestsFieldsResponse struct.
|
||||
type GroupsGetRequestsFieldsResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.UsersUser `json:"items"`
|
||||
}
|
||||
|
||||
// GroupsGetRequestsFields returns a list of requests to the community.
|
||||
//
|
||||
// https://vk.com/dev/groups.getRequests
|
||||
func (vk *VK) GroupsGetRequestsFields(params Params) (response GroupsGetRequestsFieldsResponse, err error) {
|
||||
reqParams := make(Params)
|
||||
if v, prs := params["fields"]; v == "" || !prs {
|
||||
reqParams["fields"] = "id"
|
||||
}
|
||||
|
||||
err = vk.RequestUnmarshal("groups.getRequests", &response, params, reqParams)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsGetSettingsResponse struct.
|
||||
type GroupsGetSettingsResponse object.GroupsGroupSettings
|
||||
|
||||
// GroupsGetSettings returns community settings.
|
||||
//
|
||||
// https://vk.com/dev/groups.getSettings
|
||||
func (vk *VK) GroupsGetSettings(params Params) (response GroupsGetSettingsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("groups.getSettings", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsGetTagListResponse struct.
|
||||
type GroupsGetTagListResponse []object.GroupsTag
|
||||
|
||||
// GroupsGetTagList returns community tags list.
|
||||
//
|
||||
// https://vk.com/dev/groups.getTagList
|
||||
func (vk *VK) GroupsGetTagList(params Params) (response GroupsGetTagListResponse, err error) {
|
||||
err = vk.RequestUnmarshal("groups.getTagList", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsGetTokenPermissionsResponse struct.
|
||||
type GroupsGetTokenPermissionsResponse object.GroupsTokenPermissions
|
||||
|
||||
// GroupsGetTokenPermissions returns permissions scope for the community's access_token.
|
||||
//
|
||||
// https://vk.com/dev/groups.getTokenPermissions
|
||||
func (vk *VK) GroupsGetTokenPermissions(params Params) (response GroupsGetTokenPermissionsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("groups.getTokenPermissions", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsInvite allows to invite friends to the community.
|
||||
//
|
||||
// https://vk.com/dev/groups.invite
|
||||
func (vk *VK) GroupsInvite(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("groups.invite", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsIsMember returns information specifying whether a user is a member of a community.
|
||||
//
|
||||
// extended=0
|
||||
//
|
||||
// https://vk.com/dev/groups.isMember
|
||||
func (vk *VK) GroupsIsMember(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("groups.isMember", &response, params, Params{"extended": false})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsIsMemberExtendedResponse struct.
|
||||
type GroupsIsMemberExtendedResponse struct {
|
||||
Invitation object.BaseBoolInt `json:"invitation"` // Information whether user has been invited to the group
|
||||
Member object.BaseBoolInt `json:"member"` // Information whether user is a member of the group
|
||||
Request object.BaseBoolInt `json:"request"` // Information whether user has send request to the group
|
||||
CanInvite object.BaseBoolInt `json:"can_invite"` // Information whether user can be invite
|
||||
CanRecall object.BaseBoolInt `json:"can_recall"` // Information whether user's invite to the group can be recalled
|
||||
}
|
||||
|
||||
// GroupsIsMemberExtended returns information specifying whether a user is a member of a community.
|
||||
//
|
||||
// extended=1
|
||||
//
|
||||
// https://vk.com/dev/groups.isMember
|
||||
func (vk *VK) GroupsIsMemberExtended(params Params) (response GroupsIsMemberExtendedResponse, err error) {
|
||||
err = vk.RequestUnmarshal("groups.isMember", &response, params, Params{"extended": true})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsIsMemberUserIDsExtendedResponse struct.
|
||||
type GroupsIsMemberUserIDsExtendedResponse []object.GroupsMemberStatusFull
|
||||
|
||||
// GroupsIsMemberUserIDsExtended returns information specifying whether a user is a member of a community.
|
||||
//
|
||||
// extended=1
|
||||
// need user_ids
|
||||
//
|
||||
// https://vk.com/dev/groups.isMember
|
||||
func (vk *VK) GroupsIsMemberUserIDsExtended(params Params) (response GroupsIsMemberUserIDsExtendedResponse, err error) {
|
||||
err = vk.RequestUnmarshal("groups.isMember", &response, params, Params{"extended": true})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsIsMemberUserIDsResponse struct.
|
||||
type GroupsIsMemberUserIDsResponse []object.GroupsMemberStatus
|
||||
|
||||
// GroupsIsMemberUserIDs returns information specifying whether a user is a member of a community.
|
||||
//
|
||||
// extended=0
|
||||
// need user_ids
|
||||
//
|
||||
// https://vk.com/dev/groups.isMember
|
||||
func (vk *VK) GroupsIsMemberUserIDs(params Params) (response GroupsIsMemberUserIDsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("groups.isMember", &response, params, Params{"extended": false})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsJoin with this method you can join the group or public page, and also confirm your participation in an event.
|
||||
//
|
||||
// https://vk.com/dev/groups.join
|
||||
func (vk *VK) GroupsJoin(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("groups.join", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsLeave with this method you can leave a group, public page, or event.
|
||||
//
|
||||
// https://vk.com/dev/groups.leave
|
||||
func (vk *VK) GroupsLeave(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("groups.leave", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsRemoveUser removes a user from the community.
|
||||
//
|
||||
// https://vk.com/dev/groups.removeUser
|
||||
func (vk *VK) GroupsRemoveUser(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("groups.removeUser", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsReorderLink allows to reorder links in the community.
|
||||
//
|
||||
// https://vk.com/dev/groups.reorderLink
|
||||
func (vk *VK) GroupsReorderLink(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("groups.reorderLink", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsSearchResponse struct.
|
||||
type GroupsSearchResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.GroupsGroup `json:"items"`
|
||||
}
|
||||
|
||||
// GroupsSearch returns a list of communities matching the search criteria.
|
||||
//
|
||||
// https://vk.com/dev/groups.search
|
||||
func (vk *VK) GroupsSearch(params Params) (response GroupsSearchResponse, err error) {
|
||||
err = vk.RequestUnmarshal("groups.search", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsSetCallbackSettings allow to set notifications settings for Callback API.
|
||||
//
|
||||
// https://vk.com/dev/groups.setCallbackSettings
|
||||
func (vk *VK) GroupsSetCallbackSettings(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("groups.setCallbackSettings", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsSetLongPollSettings allows to set Bots Long Poll API settings in the community.
|
||||
//
|
||||
// https://vk.com/dev/groups.setLongPollSettings
|
||||
func (vk *VK) GroupsSetLongPollSettings(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("groups.setLongPollSettings", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsSetSettings sets community settings.
|
||||
//
|
||||
// https://vk.com/dev/groups.setSettings
|
||||
func (vk *VK) GroupsSetSettings(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("groups.setSettings", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsSetUserNote allows to create or edit a note about a user as part
|
||||
// of the user's correspondence with the community.
|
||||
//
|
||||
// https://vk.com/dev/groups.setUserNote
|
||||
func (vk *VK) GroupsSetUserNote(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("groups.setUserNote", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsTagAdd allows to add a new tag to the community.
|
||||
//
|
||||
// https://vk.com/dev/groups.tagAdd
|
||||
func (vk *VK) GroupsTagAdd(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("groups.tagAdd", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsTagBind allows to "bind" and "unbind" community tags to conversations.
|
||||
//
|
||||
// https://vk.com/dev/groups.tagBind
|
||||
func (vk *VK) GroupsTagBind(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("groups.tagBind", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsTagDelete allows to remove a community tag
|
||||
//
|
||||
// The remote tag will be automatically "unbind" from all conversations to
|
||||
// which it was "bind" earlier.
|
||||
//
|
||||
// https://vk.com/dev/groups.tagDelete
|
||||
func (vk *VK) GroupsTagDelete(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("groups.tagDelete", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsTagUpdate allows to change an existing tag.
|
||||
//
|
||||
// https://vk.com/dev/groups.tagUpdate
|
||||
func (vk *VK) GroupsTagUpdate(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("groups.tagUpdate", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsToggleMarket method.
|
||||
//
|
||||
// https://vk.com/dev/groups.toggleMarket
|
||||
func (vk *VK) GroupsToggleMarket(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("groups.toggleMarket", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// GroupsUnban groups.unban.
|
||||
//
|
||||
// https://vk.com/dev/groups.unban
|
||||
func (vk *VK) GroupsUnban(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("groups.unban", &response, params)
|
||||
return
|
||||
}
|
||||
89
vendor/github.com/SevereCloud/vksdk/v2/api/leadforms.go
generated
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
package api // import "github.com/SevereCloud/vksdk/v2/api"
|
||||
|
||||
import (
|
||||
"github.com/SevereCloud/vksdk/v2/object"
|
||||
)
|
||||
|
||||
// LeadFormsCreateResponse struct.
|
||||
type LeadFormsCreateResponse struct {
|
||||
FormID int `json:"form_id"`
|
||||
URL string `json:"url"`
|
||||
}
|
||||
|
||||
// LeadFormsCreate leadForms.create.
|
||||
//
|
||||
// https://vk.com/dev/leadForms.create
|
||||
func (vk *VK) LeadFormsCreate(params Params) (response LeadFormsCreateResponse, err error) {
|
||||
err = vk.RequestUnmarshal("leadForms.create", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// LeadFormsDeleteResponse struct.
|
||||
type LeadFormsDeleteResponse struct {
|
||||
FormID int `json:"form_id"`
|
||||
}
|
||||
|
||||
// LeadFormsDelete leadForms.delete.
|
||||
//
|
||||
// https://vk.com/dev/leadForms.delete
|
||||
func (vk *VK) LeadFormsDelete(params Params) (response LeadFormsDeleteResponse, err error) {
|
||||
err = vk.RequestUnmarshal("leadForms.delete", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// LeadFormsGetResponse struct.
|
||||
type LeadFormsGetResponse object.LeadFormsForm
|
||||
|
||||
// LeadFormsGet leadForms.get.
|
||||
//
|
||||
// https://vk.com/dev/leadForms.get
|
||||
func (vk *VK) LeadFormsGet(params Params) (response LeadFormsGetResponse, err error) {
|
||||
err = vk.RequestUnmarshal("leadForms.get", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// LeadFormsGetLeadsResponse struct.
|
||||
type LeadFormsGetLeadsResponse struct {
|
||||
Leads []object.LeadFormsLead `json:"leads"`
|
||||
}
|
||||
|
||||
// LeadFormsGetLeads leadForms.getLeads.
|
||||
//
|
||||
// https://vk.com/dev/leadForms.getLeads
|
||||
func (vk *VK) LeadFormsGetLeads(params Params) (response LeadFormsGetLeadsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("leadForms.getLeads", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// LeadFormsGetUploadURL leadForms.getUploadURL.
|
||||
//
|
||||
// https://vk.com/dev/leadForms.getUploadURL
|
||||
func (vk *VK) LeadFormsGetUploadURL(params Params) (response string, err error) {
|
||||
err = vk.RequestUnmarshal("leadForms.getUploadURL", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// LeadFormsListResponse struct.
|
||||
type LeadFormsListResponse []object.LeadFormsForm
|
||||
|
||||
// LeadFormsList leadForms.list.
|
||||
//
|
||||
// https://vk.com/dev/leadForms.list
|
||||
func (vk *VK) LeadFormsList(params Params) (response LeadFormsListResponse, err error) {
|
||||
err = vk.RequestUnmarshal("leadForms.list", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// LeadFormsUpdateResponse struct.
|
||||
type LeadFormsUpdateResponse struct {
|
||||
FormID int `json:"form_id"`
|
||||
URL string `json:"url"`
|
||||
}
|
||||
|
||||
// LeadFormsUpdate leadForms.update.
|
||||
//
|
||||
// https://vk.com/dev/leadForms.update
|
||||
func (vk *VK) LeadFormsUpdate(params Params) (response LeadFormsUpdateResponse, err error) {
|
||||
err = vk.RequestUnmarshal("leadForms.update", &response, params)
|
||||
return
|
||||
}
|
||||
74
vendor/github.com/SevereCloud/vksdk/v2/api/leads.go
generated
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
package api // import "github.com/SevereCloud/vksdk/v2/api"
|
||||
|
||||
import (
|
||||
"github.com/SevereCloud/vksdk/v2/object"
|
||||
)
|
||||
|
||||
// LeadsCheckUserResponse struct.
|
||||
type LeadsCheckUserResponse object.LeadsChecked
|
||||
|
||||
// LeadsCheckUser checks if the user can start the lead.
|
||||
//
|
||||
// https://vk.com/dev/leads.checkUser
|
||||
func (vk *VK) LeadsCheckUser(params Params) (response LeadsCheckUserResponse, err error) {
|
||||
err = vk.RequestUnmarshal("leads.checkUser", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// LeadsCompleteResponse struct.
|
||||
type LeadsCompleteResponse object.LeadsComplete
|
||||
|
||||
// LeadsComplete completes the lead started by user.
|
||||
//
|
||||
// https://vk.com/dev/leads.complete
|
||||
func (vk *VK) LeadsComplete(params Params) (response LeadsCompleteResponse, err error) {
|
||||
err = vk.RequestUnmarshal("leads.complete", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// LeadsGetStatsResponse struct.
|
||||
type LeadsGetStatsResponse object.LeadsLead
|
||||
|
||||
// LeadsGetStats returns lead stats data.
|
||||
//
|
||||
// https://vk.com/dev/leads.getStats
|
||||
func (vk *VK) LeadsGetStats(params Params) (response LeadsGetStatsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("leads.getStats", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// LeadsGetUsersResponse struct.
|
||||
type LeadsGetUsersResponse object.LeadsEntry
|
||||
|
||||
// LeadsGetUsers returns a list of last user actions for the offer.
|
||||
//
|
||||
// https://vk.com/dev/leads.getUsers
|
||||
func (vk *VK) LeadsGetUsers(params Params) (response LeadsGetUsersResponse, err error) {
|
||||
err = vk.RequestUnmarshal("leads.getUsers", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// LeadsMetricHitResponse struct.
|
||||
type LeadsMetricHitResponse struct {
|
||||
Result object.BaseBoolInt `json:"result"` // Information whether request has been processed successfully
|
||||
RedirectLink string `json:"redirect_link"` // Redirect link
|
||||
}
|
||||
|
||||
// LeadsMetricHit counts the metric event.
|
||||
//
|
||||
// https://vk.com/dev/leads.metricHit
|
||||
func (vk *VK) LeadsMetricHit(params Params) (response LeadsMetricHitResponse, err error) {
|
||||
err = vk.RequestUnmarshal("leads.metricHit", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// LeadsStartResponse struct.
|
||||
type LeadsStartResponse object.LeadsStart
|
||||
|
||||
// LeadsStart creates new session for the user passing the offer.
|
||||
//
|
||||
// https://vk.com/dev/leads.start
|
||||
func (vk *VK) LeadsStart(params Params) (response LeadsStartResponse, err error) {
|
||||
err = vk.RequestUnmarshal("leads.start", &response, params)
|
||||
return
|
||||
}
|
||||
79
vendor/github.com/SevereCloud/vksdk/v2/api/likes.go
generated
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
package api // import "github.com/SevereCloud/vksdk/v2/api"
|
||||
|
||||
import (
|
||||
"github.com/SevereCloud/vksdk/v2/object"
|
||||
)
|
||||
|
||||
// LikesAddResponse struct.
|
||||
type LikesAddResponse struct {
|
||||
Likes int `json:"likes"`
|
||||
}
|
||||
|
||||
// LikesAdd adds the specified object to the Likes list of the current user.
|
||||
//
|
||||
// https://vk.com/dev/likes.add
|
||||
func (vk *VK) LikesAdd(params Params) (response LikesAddResponse, err error) {
|
||||
err = vk.RequestUnmarshal("likes.add", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// LikesDeleteResponse struct.
|
||||
type LikesDeleteResponse struct {
|
||||
Likes int `json:"likes"`
|
||||
}
|
||||
|
||||
// LikesDelete deletes the specified object from the Likes list of the current user.
|
||||
//
|
||||
// https://vk.com/dev/likes.delete
|
||||
func (vk *VK) LikesDelete(params Params) (response LikesDeleteResponse, err error) {
|
||||
err = vk.RequestUnmarshal("likes.delete", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// LikesGetListResponse struct.
|
||||
type LikesGetListResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []int `json:"items"`
|
||||
}
|
||||
|
||||
// LikesGetList likes.getList returns a list of IDs of users who added the specified object to their Likes list.
|
||||
//
|
||||
// extended=0
|
||||
//
|
||||
// https://vk.com/dev/likes.getList
|
||||
func (vk *VK) LikesGetList(params Params) (response LikesGetListResponse, err error) {
|
||||
err = vk.RequestUnmarshal("likes.getList", &response, params, Params{"extended": false})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// LikesGetListExtendedResponse struct.
|
||||
type LikesGetListExtendedResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.UsersUser `json:"items"`
|
||||
}
|
||||
|
||||
// LikesGetListExtended likes.getList returns a list of IDs of users who added the specified object to their Likes list.
|
||||
//
|
||||
// extended=1
|
||||
//
|
||||
// https://vk.com/dev/likes.getList
|
||||
func (vk *VK) LikesGetListExtended(params Params) (response LikesGetListExtendedResponse, err error) {
|
||||
err = vk.RequestUnmarshal("likes.getList", &response, params, Params{"extended": true})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// LikesIsLikedResponse struct.
|
||||
type LikesIsLikedResponse struct {
|
||||
Liked object.BaseBoolInt `json:"liked"`
|
||||
Copied object.BaseBoolInt `json:"copied"`
|
||||
}
|
||||
|
||||
// LikesIsLiked checks for the object in the Likes list of the specified user.
|
||||
//
|
||||
// https://vk.com/dev/likes.isLiked
|
||||
func (vk *VK) LikesIsLiked(params Params) (response LikesIsLikedResponse, err error) {
|
||||
err = vk.RequestUnmarshal("likes.isLiked", &response, params)
|
||||
return
|
||||
}
|
||||
320
vendor/github.com/SevereCloud/vksdk/v2/api/market.go
generated
vendored
Normal file
@@ -0,0 +1,320 @@
|
||||
package api // import "github.com/SevereCloud/vksdk/v2/api"
|
||||
|
||||
import (
|
||||
"github.com/SevereCloud/vksdk/v2/object"
|
||||
)
|
||||
|
||||
// MarketAddResponse struct.
|
||||
type MarketAddResponse struct {
|
||||
MarketItemID int `json:"market_item_id"` // Item ID
|
||||
}
|
||||
|
||||
// MarketAdd adds a new item to the market.
|
||||
//
|
||||
// https://vk.com/dev/market.add
|
||||
func (vk *VK) MarketAdd(params Params) (response MarketAddResponse, err error) {
|
||||
err = vk.RequestUnmarshal("market.add", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MarketAddAlbumResponse struct.
|
||||
type MarketAddAlbumResponse struct {
|
||||
MarketAlbumID int `json:"market_album_id"` // Album ID
|
||||
}
|
||||
|
||||
// MarketAddAlbum creates new collection of items.
|
||||
//
|
||||
// https://vk.com/dev/market.addAlbum
|
||||
func (vk *VK) MarketAddAlbum(params Params) (response MarketAddAlbumResponse, err error) {
|
||||
err = vk.RequestUnmarshal("market.addAlbum", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MarketAddToAlbum adds an item to one or multiple collections.
|
||||
//
|
||||
// https://vk.com/dev/market.addToAlbum
|
||||
func (vk *VK) MarketAddToAlbum(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("market.addToAlbum", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MarketCreateComment creates a new comment for an item.
|
||||
//
|
||||
// https://vk.com/dev/market.createComment
|
||||
func (vk *VK) MarketCreateComment(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("market.createComment", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MarketDelete deletes an item.
|
||||
//
|
||||
// https://vk.com/dev/market.delete
|
||||
func (vk *VK) MarketDelete(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("market.delete", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MarketDeleteAlbum deletes a collection of items.
|
||||
//
|
||||
// https://vk.com/dev/market.deleteAlbum
|
||||
func (vk *VK) MarketDeleteAlbum(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("market.deleteAlbum", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MarketDeleteComment deletes an item's comment.
|
||||
//
|
||||
// https://vk.com/dev/market.deleteComment
|
||||
func (vk *VK) MarketDeleteComment(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("market.deleteComment", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MarketEdit edits an item.
|
||||
//
|
||||
// https://vk.com/dev/market.edit
|
||||
func (vk *VK) MarketEdit(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("market.edit", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MarketEditAlbum edits a collection of items.
|
||||
//
|
||||
// https://vk.com/dev/market.editAlbum
|
||||
func (vk *VK) MarketEditAlbum(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("market.editAlbum", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MarketEditComment changes item comment's text.
|
||||
//
|
||||
// https://vk.com/dev/market.editComment
|
||||
func (vk *VK) MarketEditComment(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("market.editComment", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MarketEditOrder edits an order.
|
||||
//
|
||||
// https://vk.com/dev/market.editOrder
|
||||
func (vk *VK) MarketEditOrder(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("market.editOrder", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MarketGetResponse struct.
|
||||
type MarketGetResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.MarketMarketItem `json:"items"`
|
||||
}
|
||||
|
||||
// MarketGet returns items list for a community.
|
||||
//
|
||||
// https://vk.com/dev/market.get
|
||||
func (vk *VK) MarketGet(params Params) (response MarketGetResponse, err error) {
|
||||
err = vk.RequestUnmarshal("market.get", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MarketGetAlbumByIDResponse struct.
|
||||
type MarketGetAlbumByIDResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.MarketMarketAlbum `json:"items"`
|
||||
}
|
||||
|
||||
// MarketGetAlbumByID returns items album's data.
|
||||
//
|
||||
// https://vk.com/dev/market.getAlbumById
|
||||
func (vk *VK) MarketGetAlbumByID(params Params) (response MarketGetAlbumByIDResponse, err error) {
|
||||
err = vk.RequestUnmarshal("market.getAlbumById", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MarketGetAlbumsResponse struct.
|
||||
type MarketGetAlbumsResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.MarketMarketAlbum `json:"items"`
|
||||
}
|
||||
|
||||
// MarketGetAlbums returns community's collections list.
|
||||
//
|
||||
// https://vk.com/dev/market.getAlbums
|
||||
func (vk *VK) MarketGetAlbums(params Params) (response MarketGetAlbumsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("market.getAlbums", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MarketGetByIDResponse struct.
|
||||
type MarketGetByIDResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.MarketMarketItem `json:"items"`
|
||||
}
|
||||
|
||||
// MarketGetByID returns information about market items by their iDs.
|
||||
//
|
||||
// https://vk.com/dev/market.getById
|
||||
func (vk *VK) MarketGetByID(params Params) (response MarketGetByIDResponse, err error) {
|
||||
err = vk.RequestUnmarshal("market.getById", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MarketGetCategoriesResponse struct.
|
||||
type MarketGetCategoriesResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.MarketMarketCategory `json:"items"`
|
||||
}
|
||||
|
||||
// MarketGetCategories returns a list of market categories.
|
||||
//
|
||||
// https://vk.com/dev/market.getCategories
|
||||
func (vk *VK) MarketGetCategories(params Params) (response MarketGetCategoriesResponse, err error) {
|
||||
err = vk.RequestUnmarshal("market.getCategories", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MarketGetCommentsResponse struct.
|
||||
type MarketGetCommentsResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.WallWallComment `json:"items"`
|
||||
}
|
||||
|
||||
// MarketGetComments returns comments list for an item.
|
||||
//
|
||||
// extended=0
|
||||
//
|
||||
// https://vk.com/dev/market.getComments
|
||||
func (vk *VK) MarketGetComments(params Params) (response MarketGetCommentsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("market.getComments", &response, params, Params{"extended": false})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// MarketGetCommentsExtendedResponse struct.
|
||||
type MarketGetCommentsExtendedResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.WallWallComment `json:"items"`
|
||||
object.ExtendedResponse
|
||||
}
|
||||
|
||||
// MarketGetCommentsExtended returns comments list for an item.
|
||||
//
|
||||
// extended=1
|
||||
//
|
||||
// https://vk.com/dev/market.getComments
|
||||
func (vk *VK) MarketGetCommentsExtended(params Params) (response MarketGetCommentsExtendedResponse, err error) {
|
||||
err = vk.RequestUnmarshal("market.getComments", &response, params, Params{"extended": true})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// MarketGetGroupOrdersResponse struct.
|
||||
type MarketGetGroupOrdersResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.MarketOrder `json:"items"`
|
||||
}
|
||||
|
||||
// MarketGetGroupOrders returns community's orders list.
|
||||
//
|
||||
// https://vk.com/dev/market.getGroupOrders
|
||||
func (vk *VK) MarketGetGroupOrders(params Params) (response MarketGetGroupOrdersResponse, err error) {
|
||||
err = vk.RequestUnmarshal("market.getGroupOrders", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MarketGetOrderByIDResponse struct.
|
||||
type MarketGetOrderByIDResponse struct {
|
||||
Order object.MarketOrder `json:"order"`
|
||||
}
|
||||
|
||||
// MarketGetOrderByID returns order by id.
|
||||
//
|
||||
// https://vk.com/dev/market.getOrderById
|
||||
func (vk *VK) MarketGetOrderByID(params Params) (response MarketGetOrderByIDResponse, err error) {
|
||||
err = vk.RequestUnmarshal("market.getOrderById", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MarketGetOrderItemsResponse struct.
|
||||
type MarketGetOrderItemsResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.MarketOrderItem `json:"items"`
|
||||
}
|
||||
|
||||
// MarketGetOrderItems returns items of an order.
|
||||
//
|
||||
// https://vk.com/dev/market.getOrderItems
|
||||
func (vk *VK) MarketGetOrderItems(params Params) (response MarketGetOrderItemsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("market.getOrderItems", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MarketRemoveFromAlbum removes an item from one or multiple collections.
|
||||
//
|
||||
// https://vk.com/dev/market.removeFromAlbum
|
||||
func (vk *VK) MarketRemoveFromAlbum(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("market.removeFromAlbum", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MarketReorderAlbums reorders the collections list.
|
||||
//
|
||||
// https://vk.com/dev/market.reorderAlbums
|
||||
func (vk *VK) MarketReorderAlbums(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("market.reorderAlbums", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MarketReorderItems changes item place in a collection.
|
||||
//
|
||||
// https://vk.com/dev/market.reorderItems
|
||||
func (vk *VK) MarketReorderItems(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("market.reorderItems", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MarketReport sends a complaint to the item.
|
||||
//
|
||||
// https://vk.com/dev/market.report
|
||||
func (vk *VK) MarketReport(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("market.report", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MarketReportComment sends a complaint to the item's comment.
|
||||
//
|
||||
// https://vk.com/dev/market.reportComment
|
||||
func (vk *VK) MarketReportComment(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("market.reportComment", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MarketRestore restores recently deleted item.
|
||||
//
|
||||
// https://vk.com/dev/market.restore
|
||||
func (vk *VK) MarketRestore(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("market.restore", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MarketRestoreComment restores a recently deleted comment.
|
||||
//
|
||||
// https://vk.com/dev/market.restoreComment
|
||||
func (vk *VK) MarketRestoreComment(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("market.restoreComment", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MarketSearchResponse struct.
|
||||
type MarketSearchResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.MarketMarketItem `json:"items"`
|
||||
ViewType int `json:"view_type"`
|
||||
}
|
||||
|
||||
// MarketSearch searches market items in a community's catalog.
|
||||
//
|
||||
// https://vk.com/dev/market.search
|
||||
func (vk *VK) MarketSearch(params Params) (response MarketSearchResponse, err error) {
|
||||
err = vk.RequestUnmarshal("market.search", &response, params)
|
||||
return
|
||||
}
|
||||
616
vendor/github.com/SevereCloud/vksdk/v2/api/messages.go
generated
vendored
Normal file
@@ -0,0 +1,616 @@
|
||||
package api // import "github.com/SevereCloud/vksdk/v2/api"
|
||||
|
||||
import (
|
||||
"github.com/SevereCloud/vksdk/v2/object"
|
||||
)
|
||||
|
||||
// MessagesAddChatUser adds a new user to a chat.
|
||||
//
|
||||
// https://vk.com/dev/messages.addChatUser
|
||||
func (vk *VK) MessagesAddChatUser(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("messages.addChatUser", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesAllowMessagesFromGroup allows sending messages from community to the current user.
|
||||
//
|
||||
// https://vk.com/dev/messages.allowMessagesFromGroup
|
||||
func (vk *VK) MessagesAllowMessagesFromGroup(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("messages.allowMessagesFromGroup", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesCreateChat creates a chat with several participants.
|
||||
//
|
||||
// https://vk.com/dev/messages.createChat
|
||||
func (vk *VK) MessagesCreateChat(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("messages.createChat", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesDeleteResponse struct.
|
||||
type MessagesDeleteResponse map[string]int
|
||||
|
||||
// MessagesDelete deletes one or more messages.
|
||||
//
|
||||
// https://vk.com/dev/messages.delete
|
||||
func (vk *VK) MessagesDelete(params Params) (response MessagesDeleteResponse, err error) {
|
||||
err = vk.RequestUnmarshal("messages.delete", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesDeleteChatPhotoResponse struct.
|
||||
type MessagesDeleteChatPhotoResponse struct {
|
||||
MessageID int `json:"message_id"`
|
||||
Chat object.MessagesChat `json:"chat"`
|
||||
}
|
||||
|
||||
// MessagesDeleteChatPhoto deletes a chat's cover picture.
|
||||
//
|
||||
// https://vk.com/dev/messages.deleteChatPhoto
|
||||
func (vk *VK) MessagesDeleteChatPhoto(params Params) (response MessagesDeleteChatPhotoResponse, err error) {
|
||||
err = vk.RequestUnmarshal("messages.deleteChatPhoto", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesDeleteConversationResponse struct.
|
||||
type MessagesDeleteConversationResponse struct {
|
||||
LastDeletedID int `json:"last_deleted_id"` // Id of the last message, that was deleted
|
||||
}
|
||||
|
||||
// MessagesDeleteConversation deletes private messages in a conversation.
|
||||
//
|
||||
// https://vk.com/dev/messages.deleteConversation
|
||||
func (vk *VK) MessagesDeleteConversation(params Params) (response MessagesDeleteConversationResponse, err error) {
|
||||
err = vk.RequestUnmarshal("messages.deleteConversation", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesDenyMessagesFromGroup denies sending message from community to the current user.
|
||||
//
|
||||
// https://vk.com/dev/messages.denyMessagesFromGroup
|
||||
func (vk *VK) MessagesDenyMessagesFromGroup(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("messages.denyMessagesFromGroup", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesEdit edits the message.
|
||||
//
|
||||
// https://vk.com/dev/messages.edit
|
||||
func (vk *VK) MessagesEdit(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("messages.edit", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesEditChat edits the title of a chat.
|
||||
//
|
||||
// https://vk.com/dev/messages.editChat
|
||||
func (vk *VK) MessagesEditChat(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("messages.editChat", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesGetByConversationMessageIDResponse struct.
|
||||
type MessagesGetByConversationMessageIDResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.MessagesMessage `json:"items"`
|
||||
object.ExtendedResponse
|
||||
}
|
||||
|
||||
// MessagesGetByConversationMessageID messages.getByConversationMessageId.
|
||||
//
|
||||
// https://vk.com/dev/messages.getByConversationMessageId
|
||||
func (vk *VK) MessagesGetByConversationMessageID(params Params) (
|
||||
response MessagesGetByConversationMessageIDResponse,
|
||||
err error,
|
||||
) {
|
||||
err = vk.RequestUnmarshal("messages.getByConversationMessageId", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesGetByIDResponse struct.
|
||||
type MessagesGetByIDResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.MessagesMessage `json:"items"`
|
||||
}
|
||||
|
||||
// MessagesGetByID returns messages by their IDs.
|
||||
//
|
||||
// extended=0
|
||||
//
|
||||
// https://vk.com/dev/messages.getById
|
||||
func (vk *VK) MessagesGetByID(params Params) (response MessagesGetByIDResponse, err error) {
|
||||
err = vk.RequestUnmarshal("messages.getById", &response, params, Params{"extended": false})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesGetByIDExtendedResponse struct.
|
||||
type MessagesGetByIDExtendedResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.MessagesMessage `json:"items"`
|
||||
object.ExtendedResponse
|
||||
}
|
||||
|
||||
// MessagesGetByIDExtended returns messages by their IDs.
|
||||
//
|
||||
// extended=1
|
||||
//
|
||||
// https://vk.com/dev/messages.getById
|
||||
func (vk *VK) MessagesGetByIDExtended(params Params) (response MessagesGetByIDExtendedResponse, err error) {
|
||||
err = vk.RequestUnmarshal("messages.getById", &response, params, Params{"extended": true})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesGetChatResponse struct.
|
||||
type MessagesGetChatResponse object.MessagesChat
|
||||
|
||||
// MessagesGetChat returns information about a chat.
|
||||
//
|
||||
// https://vk.com/dev/messages.getChat
|
||||
func (vk *VK) MessagesGetChat(params Params) (response MessagesGetChatResponse, err error) {
|
||||
err = vk.RequestUnmarshal("messages.getChat", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesGetChatChatIDsResponse struct.
|
||||
type MessagesGetChatChatIDsResponse []object.MessagesChat
|
||||
|
||||
// MessagesGetChatChatIDs returns information about a chat.
|
||||
//
|
||||
// https://vk.com/dev/messages.getChat
|
||||
func (vk *VK) MessagesGetChatChatIDs(params Params) (response MessagesGetChatChatIDsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("messages.getChat", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesGetChatPreviewResponse struct.
|
||||
type MessagesGetChatPreviewResponse struct {
|
||||
Preview object.MessagesChatPreview `json:"preview"`
|
||||
object.ExtendedResponse
|
||||
}
|
||||
|
||||
// MessagesGetChatPreview allows to receive chat preview by the invitation link.
|
||||
//
|
||||
// https://vk.com/dev/messages.getChatPreview
|
||||
func (vk *VK) MessagesGetChatPreview(params Params) (response MessagesGetChatPreviewResponse, err error) {
|
||||
err = vk.RequestUnmarshal("messages.getChatPreview", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesGetConversationMembersResponse struct.
|
||||
type MessagesGetConversationMembersResponse struct {
|
||||
Items []struct {
|
||||
MemberID int `json:"member_id"`
|
||||
JoinDate int `json:"join_date"`
|
||||
InvitedBy int `json:"invited_by"`
|
||||
IsOwner object.BaseBoolInt `json:"is_owner,omitempty"`
|
||||
IsAdmin object.BaseBoolInt `json:"is_admin,omitempty"`
|
||||
CanKick object.BaseBoolInt `json:"can_kick,omitempty"`
|
||||
} `json:"items"`
|
||||
Count int `json:"count"`
|
||||
ChatRestrictions struct {
|
||||
OnlyAdminsInvite object.BaseBoolInt `json:"only_admins_invite"`
|
||||
OnlyAdminsEditPin object.BaseBoolInt `json:"only_admins_edit_pin"`
|
||||
OnlyAdminsEditInfo object.BaseBoolInt `json:"only_admins_edit_info"`
|
||||
AdminsPromoteUsers object.BaseBoolInt `json:"admins_promote_users"`
|
||||
} `json:"chat_restrictions"`
|
||||
object.ExtendedResponse
|
||||
}
|
||||
|
||||
// MessagesGetConversationMembers returns a list of IDs of users participating in a conversation.
|
||||
//
|
||||
// https://vk.com/dev/messages.getConversationMembers
|
||||
func (vk *VK) MessagesGetConversationMembers(params Params) (
|
||||
response MessagesGetConversationMembersResponse,
|
||||
err error,
|
||||
) {
|
||||
err = vk.RequestUnmarshal("messages.getConversationMembers", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesGetConversationsResponse struct.
|
||||
type MessagesGetConversationsResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.MessagesConversationWithMessage `json:"items"`
|
||||
UnreadCount int `json:"unread_count"`
|
||||
object.ExtendedResponse
|
||||
}
|
||||
|
||||
// MessagesGetConversations returns a list of conversations.
|
||||
//
|
||||
// https://vk.com/dev/messages.getConversations
|
||||
func (vk *VK) MessagesGetConversations(params Params) (response MessagesGetConversationsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("messages.getConversations", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesGetConversationsByIDResponse struct.
|
||||
type MessagesGetConversationsByIDResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.MessagesConversation `json:"items"`
|
||||
}
|
||||
|
||||
// MessagesGetConversationsByID returns conversations by their IDs.
|
||||
//
|
||||
// extended=0
|
||||
//
|
||||
// https://vk.com/dev/messages.getConversationsById
|
||||
func (vk *VK) MessagesGetConversationsByID(params Params) (response MessagesGetConversationsByIDResponse, err error) {
|
||||
err = vk.RequestUnmarshal("messages.getConversationsById", &response, params, Params{"extended": false})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesGetConversationsByIDExtendedResponse struct.
|
||||
type MessagesGetConversationsByIDExtendedResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.MessagesConversation `json:"items"`
|
||||
object.ExtendedResponse
|
||||
}
|
||||
|
||||
// MessagesGetConversationsByIDExtended returns conversations by their IDs.
|
||||
//
|
||||
// extended=1
|
||||
//
|
||||
// https://vk.com/dev/messages.getConversationsById
|
||||
func (vk *VK) MessagesGetConversationsByIDExtended(params Params) (
|
||||
response MessagesGetConversationsByIDExtendedResponse,
|
||||
err error,
|
||||
) {
|
||||
err = vk.RequestUnmarshal("messages.getConversationsById", &response, params, Params{"extended": true})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesGetHistoryResponse struct.
|
||||
type MessagesGetHistoryResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.MessagesMessage `json:"items"`
|
||||
|
||||
// extended=1
|
||||
object.ExtendedResponse
|
||||
|
||||
// extended=1
|
||||
Conversations []object.MessagesConversation `json:"conversations,omitempty"`
|
||||
|
||||
// Deprecated: use .Conversations.InRead
|
||||
InRead int `json:"in_read,omitempty"`
|
||||
// Deprecated: use .Conversations.OutRead
|
||||
OutRead int `json:"out_read,omitempty"`
|
||||
}
|
||||
|
||||
// MessagesGetHistory returns message history for the specified user or group chat.
|
||||
//
|
||||
// https://vk.com/dev/messages.getHistory
|
||||
func (vk *VK) MessagesGetHistory(params Params) (response MessagesGetHistoryResponse, err error) {
|
||||
err = vk.RequestUnmarshal("messages.getHistory", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesGetHistoryAttachmentsResponse struct.
|
||||
type MessagesGetHistoryAttachmentsResponse struct {
|
||||
Items []object.MessagesHistoryAttachment `json:"items"`
|
||||
NextFrom string `json:"next_from"`
|
||||
object.ExtendedResponse
|
||||
}
|
||||
|
||||
// MessagesGetHistoryAttachments returns media files from the dialog or group chat.
|
||||
//
|
||||
// https://vk.com/dev/messages.getHistoryAttachments
|
||||
func (vk *VK) MessagesGetHistoryAttachments(params Params) (response MessagesGetHistoryAttachmentsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("messages.getHistoryAttachments", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesGetImportantMessagesResponse struct.
|
||||
type MessagesGetImportantMessagesResponse struct {
|
||||
Messages struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.MessagesMessage `json:"items"`
|
||||
} `json:"messages"`
|
||||
Conversations []object.MessagesConversation `json:"conversations"`
|
||||
object.ExtendedResponse
|
||||
}
|
||||
|
||||
// MessagesGetImportantMessages messages.getImportantMessages.
|
||||
//
|
||||
// https://vk.com/dev/messages.getImportantMessages
|
||||
func (vk *VK) MessagesGetImportantMessages(params Params) (response MessagesGetImportantMessagesResponse, err error) {
|
||||
err = vk.RequestUnmarshal("messages.getImportantMessages", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesGetIntentUsersResponse struct.
|
||||
type MessagesGetIntentUsersResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []int `json:"items"`
|
||||
Profiles []object.MessagesMessage `json:"profiles,omitempty"`
|
||||
}
|
||||
|
||||
// MessagesGetIntentUsers method.
|
||||
//
|
||||
// https://vk.com/dev/messages.getIntentUsers
|
||||
func (vk *VK) MessagesGetIntentUsers(params Params) (response MessagesGetIntentUsersResponse, err error) {
|
||||
err = vk.RequestUnmarshal("messages.getIntentUsers", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesGetInviteLinkResponse struct.
|
||||
type MessagesGetInviteLinkResponse struct {
|
||||
Link string `json:"link"`
|
||||
}
|
||||
|
||||
// MessagesGetInviteLink receives a link to invite a user to the chat.
|
||||
//
|
||||
// https://vk.com/dev/messages.getInviteLink
|
||||
func (vk *VK) MessagesGetInviteLink(params Params) (response MessagesGetInviteLinkResponse, err error) {
|
||||
err = vk.RequestUnmarshal("messages.getInviteLink", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesGetLastActivityResponse struct.
|
||||
type MessagesGetLastActivityResponse object.MessagesLastActivity
|
||||
|
||||
// MessagesGetLastActivity returns a user's current status and date of last activity.
|
||||
//
|
||||
// https://vk.com/dev/messages.getLastActivity
|
||||
func (vk *VK) MessagesGetLastActivity(params Params) (response MessagesGetLastActivityResponse, err error) {
|
||||
err = vk.RequestUnmarshal("messages.getLastActivity", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesGetLongPollHistoryResponse struct.
|
||||
type MessagesGetLongPollHistoryResponse struct {
|
||||
History [][]int `json:"history"`
|
||||
Groups []object.GroupsGroup `json:"groups"`
|
||||
Messages struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.MessagesMessage `json:"items"`
|
||||
} `json:"messages"`
|
||||
Profiles []object.UsersUser `json:"profiles"`
|
||||
// Chats struct {} `json:"chats"`
|
||||
NewPTS int `json:"new_pts"`
|
||||
FromPTS int `json:"from_pts"`
|
||||
More object.BaseBoolInt `json:"chats"`
|
||||
Conversations []object.MessagesConversation `json:"conversations"`
|
||||
}
|
||||
|
||||
// MessagesGetLongPollHistory returns updates in user's private messages.
|
||||
//
|
||||
// https://vk.com/dev/messages.getLongPollHistory
|
||||
func (vk *VK) MessagesGetLongPollHistory(params Params) (response MessagesGetLongPollHistoryResponse, err error) {
|
||||
err = vk.RequestUnmarshal("messages.getLongPollHistory", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesGetLongPollServerResponse struct.
|
||||
type MessagesGetLongPollServerResponse object.MessagesLongPollParams
|
||||
|
||||
// MessagesGetLongPollServer returns data required for connection to a Long Poll server.
|
||||
//
|
||||
// https://vk.com/dev/messages.getLongPollServer
|
||||
func (vk *VK) MessagesGetLongPollServer(params Params) (response MessagesGetLongPollServerResponse, err error) {
|
||||
err = vk.RequestUnmarshal("messages.getLongPollServer", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesIsMessagesFromGroupAllowedResponse struct.
|
||||
type MessagesIsMessagesFromGroupAllowedResponse struct {
|
||||
IsAllowed object.BaseBoolInt `json:"is_allowed"`
|
||||
}
|
||||
|
||||
// MessagesIsMessagesFromGroupAllowed returns information whether
|
||||
// sending messages from the community to current user is allowed.
|
||||
//
|
||||
// https://vk.com/dev/messages.isMessagesFromGroupAllowed
|
||||
func (vk *VK) MessagesIsMessagesFromGroupAllowed(params Params) (
|
||||
response MessagesIsMessagesFromGroupAllowedResponse,
|
||||
err error,
|
||||
) {
|
||||
err = vk.RequestUnmarshal("messages.isMessagesFromGroupAllowed", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesJoinChatByInviteLinkResponse struct.
|
||||
type MessagesJoinChatByInviteLinkResponse struct {
|
||||
ChatID int `json:"chat_id"`
|
||||
}
|
||||
|
||||
// MessagesJoinChatByInviteLink allows to enter the chat by the invitation link.
|
||||
//
|
||||
// https://vk.com/dev/messages.joinChatByInviteLink
|
||||
func (vk *VK) MessagesJoinChatByInviteLink(params Params) (response MessagesJoinChatByInviteLinkResponse, err error) {
|
||||
err = vk.RequestUnmarshal("messages.joinChatByInviteLink", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesMarkAsAnsweredConversation messages.markAsAnsweredConversation.
|
||||
//
|
||||
// https://vk.com/dev/messages.markAsAnsweredConversation
|
||||
func (vk *VK) MessagesMarkAsAnsweredConversation(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("messages.markAsAnsweredConversation", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesMarkAsImportantResponse struct.
|
||||
type MessagesMarkAsImportantResponse []int
|
||||
|
||||
// MessagesMarkAsImportant marks and un marks messages as important (starred).
|
||||
//
|
||||
// https://vk.com/dev/messages.markAsImportant
|
||||
func (vk *VK) MessagesMarkAsImportant(params Params) (response MessagesMarkAsImportantResponse, err error) {
|
||||
err = vk.RequestUnmarshal("messages.markAsImportant", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesMarkAsImportantConversation messages.markAsImportantConversation.
|
||||
//
|
||||
// https://vk.com/dev/messages.markAsImportantConversation
|
||||
func (vk *VK) MessagesMarkAsImportantConversation(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("messages.markAsImportantConversation", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesMarkAsRead marks messages as read.
|
||||
//
|
||||
// https://vk.com/dev/messages.markAsRead
|
||||
func (vk *VK) MessagesMarkAsRead(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("messages.markAsRead", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesPinResponse struct.
|
||||
type MessagesPinResponse object.MessagesMessage
|
||||
|
||||
// MessagesPin messages.pin.
|
||||
//
|
||||
// https://vk.com/dev/messages.pin
|
||||
func (vk *VK) MessagesPin(params Params) (response MessagesPinResponse, err error) {
|
||||
err = vk.RequestUnmarshal("messages.pin", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesRemoveChatUser allows the current user to leave a chat or, if the
|
||||
// current user started the chat, allows the user to remove another user from
|
||||
// the chat.
|
||||
//
|
||||
// https://vk.com/dev/messages.removeChatUser
|
||||
func (vk *VK) MessagesRemoveChatUser(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("messages.removeChatUser", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesRestore restores a deleted message.
|
||||
//
|
||||
// https://vk.com/dev/messages.restore
|
||||
func (vk *VK) MessagesRestore(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("messages.restore", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesSearchResponse struct.
|
||||
type MessagesSearchResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.MessagesMessage `json:"items"`
|
||||
object.ExtendedResponse
|
||||
Conversations []object.MessagesConversation `json:"conversations,omitempty"`
|
||||
}
|
||||
|
||||
// MessagesSearch returns a list of the current user's private messages that match search criteria.
|
||||
//
|
||||
// https://vk.com/dev/messages.search
|
||||
func (vk *VK) MessagesSearch(params Params) (response MessagesSearchResponse, err error) {
|
||||
err = vk.RequestUnmarshal("messages.search", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesSearchConversationsResponse struct.
|
||||
type MessagesSearchConversationsResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.MessagesConversation `json:"items"`
|
||||
object.ExtendedResponse
|
||||
}
|
||||
|
||||
// MessagesSearchConversations returns a list of conversations that match search criteria.
|
||||
//
|
||||
// https://vk.com/dev/messages.searchConversations
|
||||
func (vk *VK) MessagesSearchConversations(params Params) (response MessagesSearchConversationsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("messages.searchConversations", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesSend sends a message.
|
||||
//
|
||||
// For user_ids or peer_ids parameters, use MessagesSendUserIDs.
|
||||
//
|
||||
// https://vk.com/dev/messages.send
|
||||
func (vk *VK) MessagesSend(params Params) (response int, err error) {
|
||||
reqParams := Params{
|
||||
"user_ids": "",
|
||||
"peer_ids": "",
|
||||
}
|
||||
|
||||
err = vk.RequestUnmarshal("messages.send", &response, params, reqParams)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesSendUserIDsResponse struct.
|
||||
//
|
||||
// TODO: v3 rename MessagesSendPeerIDsResponse - user_ids outdated.
|
||||
type MessagesSendUserIDsResponse []struct {
|
||||
PeerID int `json:"peer_id"`
|
||||
MessageID int `json:"message_id"`
|
||||
ConversationMessageID int `json:"conversation_message_id"`
|
||||
Error Error `json:"error"`
|
||||
}
|
||||
|
||||
// MessagesSendPeerIDs sends a message.
|
||||
//
|
||||
// need peer_ids;
|
||||
//
|
||||
// https://vk.com/dev/messages.send
|
||||
func (vk *VK) MessagesSendPeerIDs(params Params) (response MessagesSendUserIDsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("messages.send", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesSendUserIDs sends a message.
|
||||
//
|
||||
// need user_ids or peer_ids;
|
||||
//
|
||||
// https://vk.com/dev/messages.send
|
||||
//
|
||||
// Deprecated: user_ids outdated, use MessagesSendPeerIDs.
|
||||
func (vk *VK) MessagesSendUserIDs(params Params) (response MessagesSendUserIDsResponse, err error) {
|
||||
return vk.MessagesSendPeerIDs(params)
|
||||
}
|
||||
|
||||
// MessagesSendMessageEventAnswer method.
|
||||
//
|
||||
// https://vk.com/dev/messages.sendMessageEventAnswer
|
||||
func (vk *VK) MessagesSendMessageEventAnswer(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("messages.sendMessageEventAnswer", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesSendSticker sends a message.
|
||||
//
|
||||
// https://vk.com/dev/messages.sendSticker
|
||||
func (vk *VK) MessagesSendSticker(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("messages.sendSticker", &response, params, Params{"user_ids": ""})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesSetActivity changes the status of a user as typing in a conversation.
|
||||
//
|
||||
// https://vk.com/dev/messages.setActivity
|
||||
func (vk *VK) MessagesSetActivity(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("messages.setActivity", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesSetChatPhotoResponse struct.
|
||||
type MessagesSetChatPhotoResponse struct {
|
||||
MessageID int `json:"message_id"`
|
||||
Chat object.MessagesChat `json:"chat"`
|
||||
}
|
||||
|
||||
// MessagesSetChatPhoto sets a previously-uploaded picture as the cover picture of a chat.
|
||||
//
|
||||
// https://vk.com/dev/messages.setChatPhoto
|
||||
func (vk *VK) MessagesSetChatPhoto(params Params) (response MessagesSetChatPhotoResponse, err error) {
|
||||
err = vk.RequestUnmarshal("messages.setChatPhoto", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// MessagesUnpin messages.unpin.
|
||||
//
|
||||
// https://vk.com/dev/messages.unpin
|
||||
func (vk *VK) MessagesUnpin(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("messages.unpin", &response, params)
|
||||
return
|
||||
}
|
||||
230
vendor/github.com/SevereCloud/vksdk/v2/api/newsfeed.go
generated
vendored
Normal file
@@ -0,0 +1,230 @@
|
||||
package api // import "github.com/SevereCloud/vksdk/v2/api"
|
||||
|
||||
import (
|
||||
"github.com/SevereCloud/vksdk/v2/object"
|
||||
)
|
||||
|
||||
// NewsfeedAddBan prevents news from specified users and communities
|
||||
// from appearing in the current user's newsfeed.
|
||||
//
|
||||
// https://vk.com/dev/newsfeed.addBan
|
||||
func (vk *VK) NewsfeedAddBan(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("newsfeed.addBan", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// NewsfeedDeleteBan allows news from previously banned users and
|
||||
// communities to be shown in the current user's newsfeed.
|
||||
//
|
||||
// https://vk.com/dev/newsfeed.deleteBan
|
||||
func (vk *VK) NewsfeedDeleteBan(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("newsfeed.deleteBan", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// NewsfeedDeleteList the method allows you to delete a custom news list.
|
||||
//
|
||||
// https://vk.com/dev/newsfeed.deleteList
|
||||
func (vk *VK) NewsfeedDeleteList(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("newsfeed.deleteList", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// NewsfeedGetResponse struct.
|
||||
type NewsfeedGetResponse struct {
|
||||
Items []object.NewsfeedNewsfeedItem `json:"items"`
|
||||
object.ExtendedResponse
|
||||
NextFrom string `json:"next_from"`
|
||||
}
|
||||
|
||||
// NewsfeedGet returns data required to show newsfeed for the current user.
|
||||
//
|
||||
// https://vk.com/dev/newsfeed.get
|
||||
func (vk *VK) NewsfeedGet(params Params) (response NewsfeedGetResponse, err error) {
|
||||
err = vk.RequestUnmarshal("newsfeed.get", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// NewsfeedGetBannedResponse struct.
|
||||
type NewsfeedGetBannedResponse struct {
|
||||
Members []int `json:"members"`
|
||||
Groups []int `json:"groups"`
|
||||
}
|
||||
|
||||
// NewsfeedGetBanned returns a list of users and communities banned from the current user's newsfeed.
|
||||
//
|
||||
// extended=0
|
||||
//
|
||||
// https://vk.com/dev/newsfeed.getBanned
|
||||
func (vk *VK) NewsfeedGetBanned(params Params) (response NewsfeedGetBannedResponse, err error) {
|
||||
err = vk.RequestUnmarshal("newsfeed.getBanned", &response, params, Params{"extended": false})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// NewsfeedGetBannedExtendedResponse struct.
|
||||
type NewsfeedGetBannedExtendedResponse struct {
|
||||
object.ExtendedResponse
|
||||
}
|
||||
|
||||
// NewsfeedGetBannedExtended returns a list of users and communities banned from the current user's newsfeed.
|
||||
//
|
||||
// extended=1
|
||||
//
|
||||
// https://vk.com/dev/newsfeed.getBanned
|
||||
func (vk *VK) NewsfeedGetBannedExtended(params Params) (response NewsfeedGetBannedExtendedResponse, err error) {
|
||||
err = vk.RequestUnmarshal("newsfeed.getBanned", &response, params, Params{"extended": true})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// NewsfeedGetCommentsResponse struct.
|
||||
type NewsfeedGetCommentsResponse struct {
|
||||
Items []object.NewsfeedNewsfeedItem `json:"items"`
|
||||
object.ExtendedResponse
|
||||
NextFrom string `json:"next_from"`
|
||||
}
|
||||
|
||||
// NewsfeedGetComments returns a list of comments in the current user's newsfeed.
|
||||
//
|
||||
// https://vk.com/dev/newsfeed.getComments
|
||||
func (vk *VK) NewsfeedGetComments(params Params) (response NewsfeedGetCommentsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("newsfeed.getComments", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// NewsfeedGetListsResponse struct.
|
||||
type NewsfeedGetListsResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []struct {
|
||||
ID int `json:"id"`
|
||||
Title string `json:"title"`
|
||||
NoReposts int `json:"no_reposts"`
|
||||
SourceIDs []int `json:"source_ids"`
|
||||
} `json:"items"`
|
||||
}
|
||||
|
||||
// NewsfeedGetLists returns a list of newsfeeds followed by the current user.
|
||||
//
|
||||
// https://vk.com/dev/newsfeed.getLists
|
||||
func (vk *VK) NewsfeedGetLists(params Params) (response NewsfeedGetListsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("newsfeed.getLists", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// NewsfeedGetMentionsResponse struct.
|
||||
type NewsfeedGetMentionsResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.WallWallpostToID `json:"items"`
|
||||
}
|
||||
|
||||
// NewsfeedGetMentions returns a list of posts on user walls in which the current user is mentioned.
|
||||
//
|
||||
// https://vk.com/dev/newsfeed.getMentions
|
||||
func (vk *VK) NewsfeedGetMentions(params Params) (response NewsfeedGetMentionsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("newsfeed.getMentions", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// NewsfeedGetRecommendedResponse struct.
|
||||
type NewsfeedGetRecommendedResponse struct {
|
||||
Items []object.NewsfeedNewsfeedItem `json:"items"`
|
||||
Profiles []object.UsersUser `json:"profiles"`
|
||||
Groups []object.GroupsGroup `json:"groups"`
|
||||
NextOffset string `json:"next_offset"`
|
||||
NextFrom string `json:"next_from"`
|
||||
}
|
||||
|
||||
// NewsfeedGetRecommended returns a list of newsfeeds recommended to the current user.
|
||||
//
|
||||
// https://vk.com/dev/newsfeed.getRecommended
|
||||
func (vk *VK) NewsfeedGetRecommended(params Params) (response NewsfeedGetRecommendedResponse, err error) {
|
||||
err = vk.RequestUnmarshal("newsfeed.getRecommended", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// NewsfeedGetSuggestedSourcesResponse struct.
|
||||
type NewsfeedGetSuggestedSourcesResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.GroupsGroup `json:"items"` // FIXME: GroupsGroup + UsersUser
|
||||
}
|
||||
|
||||
// NewsfeedGetSuggestedSources returns communities and users that current user is suggested to follow.
|
||||
//
|
||||
// https://vk.com/dev/newsfeed.getSuggestedSources
|
||||
func (vk *VK) NewsfeedGetSuggestedSources(params Params) (response NewsfeedGetSuggestedSourcesResponse, err error) {
|
||||
err = vk.RequestUnmarshal("newsfeed.getSuggestedSources", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// NewsfeedIgnoreItem hides an item from the newsfeed.
|
||||
//
|
||||
// https://vk.com/dev/newsfeed.ignoreItem
|
||||
func (vk *VK) NewsfeedIgnoreItem(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("newsfeed.ignoreItem", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// NewsfeedSaveList creates and edits user newsfeed lists.
|
||||
//
|
||||
// https://vk.com/dev/newsfeed.saveList
|
||||
func (vk *VK) NewsfeedSaveList(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("newsfeed.saveList", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// NewsfeedSearchResponse struct.
|
||||
type NewsfeedSearchResponse struct {
|
||||
Items []object.WallWallpost `json:"items"`
|
||||
Count int `json:"count"`
|
||||
TotalCount int `json:"total_count"`
|
||||
NextFrom string `json:"next_from"`
|
||||
}
|
||||
|
||||
// NewsfeedSearch returns search results by statuses.
|
||||
//
|
||||
// extended=0
|
||||
//
|
||||
// https://vk.com/dev/newsfeed.search
|
||||
func (vk *VK) NewsfeedSearch(params Params) (response NewsfeedSearchResponse, err error) {
|
||||
err = vk.RequestUnmarshal("newsfeed.search", &response, params, Params{"extended": false})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// NewsfeedSearchExtendedResponse struct.
|
||||
type NewsfeedSearchExtendedResponse struct {
|
||||
Items []object.WallWallpost `json:"items"`
|
||||
Count int `json:"count"`
|
||||
TotalCount int `json:"total_count"`
|
||||
Profiles []object.UsersUser `json:"profiles"`
|
||||
Groups []object.GroupsGroup `json:"groups"`
|
||||
NextFrom string `json:"next_from"`
|
||||
}
|
||||
|
||||
// NewsfeedSearchExtended returns search results by statuses.
|
||||
//
|
||||
// extended=1
|
||||
//
|
||||
// https://vk.com/dev/newsfeed.search
|
||||
func (vk *VK) NewsfeedSearchExtended(params Params) (response NewsfeedSearchExtendedResponse, err error) {
|
||||
err = vk.RequestUnmarshal("newsfeed.search", &response, params, Params{"extended": true})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// NewsfeedUnignoreItem returns a hidden item to the newsfeed.
|
||||
//
|
||||
// https://vk.com/dev/newsfeed.unignoreItem
|
||||
func (vk *VK) NewsfeedUnignoreItem(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("newsfeed.unignoreItem", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// NewsfeedUnsubscribe unsubscribes the current user from specified newsfeeds.
|
||||
//
|
||||
// https://vk.com/dev/newsfeed.unsubscribe
|
||||
func (vk *VK) NewsfeedUnsubscribe(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("newsfeed.unsubscribe", &response, params)
|
||||
return
|
||||
}
|
||||
100
vendor/github.com/SevereCloud/vksdk/v2/api/notes.go
generated
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
package api // import "github.com/SevereCloud/vksdk/v2/api"
|
||||
|
||||
import (
|
||||
"github.com/SevereCloud/vksdk/v2/object"
|
||||
)
|
||||
|
||||
// NotesAdd creates a new note for the current user.
|
||||
//
|
||||
// https://vk.com/dev/notes.add
|
||||
func (vk *VK) NotesAdd(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("notes.add", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// NotesCreateComment adds a new comment on a note.
|
||||
//
|
||||
// https://vk.com/dev/notes.createComment
|
||||
func (vk *VK) NotesCreateComment(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("notes.createComment", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// NotesDelete deletes a note of the current user.
|
||||
//
|
||||
// https://vk.com/dev/notes.delete
|
||||
func (vk *VK) NotesDelete(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("notes.delete", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// NotesDeleteComment deletes a comment on a note.
|
||||
//
|
||||
// https://vk.com/dev/notes.deleteComment
|
||||
func (vk *VK) NotesDeleteComment(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("notes.deleteComment", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// NotesEdit edits a note of the current user.
|
||||
//
|
||||
// https://vk.com/dev/notes.edit
|
||||
func (vk *VK) NotesEdit(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("notes.edit", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// NotesEditComment edits a comment on a note.
|
||||
//
|
||||
// https://vk.com/dev/notes.editComment
|
||||
func (vk *VK) NotesEditComment(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("notes.editComment", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// NotesGetResponse struct.
|
||||
type NotesGetResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.NotesNote `json:"items"`
|
||||
}
|
||||
|
||||
// NotesGet returns a list of notes created by a user.
|
||||
//
|
||||
// https://vk.com/dev/notes.get
|
||||
func (vk *VK) NotesGet(params Params) (response NotesGetResponse, err error) {
|
||||
err = vk.RequestUnmarshal("notes.get", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// NotesGetByIDResponse struct.
|
||||
type NotesGetByIDResponse object.NotesNote
|
||||
|
||||
// NotesGetByID returns a note by its ID.
|
||||
//
|
||||
// https://vk.com/dev/notes.getById
|
||||
func (vk *VK) NotesGetByID(params Params) (response NotesGetByIDResponse, err error) {
|
||||
err = vk.RequestUnmarshal("notes.getById", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// NotesGetCommentsResponse struct.
|
||||
type NotesGetCommentsResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.NotesNoteComment `json:"items"`
|
||||
}
|
||||
|
||||
// NotesGetComments returns a list of comments on a note.
|
||||
//
|
||||
// https://vk.com/dev/notes.getComments
|
||||
func (vk *VK) NotesGetComments(params Params) (response NotesGetCommentsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("notes.getComments", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// NotesRestoreComment restores a deleted comment on a note.
|
||||
//
|
||||
// https://vk.com/dev/notes.restoreComment
|
||||
func (vk *VK) NotesRestoreComment(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("notes.restoreComment", &response, params)
|
||||
return
|
||||
}
|
||||
54
vendor/github.com/SevereCloud/vksdk/v2/api/notifications.go
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
package api // import "github.com/SevereCloud/vksdk/v2/api"
|
||||
|
||||
import (
|
||||
"github.com/SevereCloud/vksdk/v2/object"
|
||||
)
|
||||
|
||||
// NotificationsGetResponse struct.
|
||||
type NotificationsGetResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.NotificationsNotification `json:"items"`
|
||||
Profiles []object.UsersUser `json:"profiles"`
|
||||
Groups []object.GroupsGroup `json:"groups"`
|
||||
Photos []object.PhotosPhoto `json:"photos"`
|
||||
Videos []object.VideoVideo `json:"videos"`
|
||||
Apps []object.AppsApp `json:"apps"`
|
||||
LastViewed int `json:"last_viewed"`
|
||||
NextFrom string `json:"next_from"`
|
||||
TTL int `json:"ttl"`
|
||||
}
|
||||
|
||||
// NotificationsGet returns a list of notifications about other users' feedback to the current user's wall posts.
|
||||
//
|
||||
// https://vk.com/dev/notifications.get
|
||||
func (vk *VK) NotificationsGet(params Params) (response NotificationsGetResponse, err error) {
|
||||
err = vk.RequestUnmarshal("notifications.get", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// NotificationsMarkAsViewed resets the counter of new notifications
|
||||
// about other users' feedback to the current user's wall posts.
|
||||
//
|
||||
// https://vk.com/dev/notifications.markAsViewed
|
||||
func (vk *VK) NotificationsMarkAsViewed(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("notifications.markAsViewed", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// NotificationsSendMessageResponse struct.
|
||||
type NotificationsSendMessageResponse []struct {
|
||||
UserID int `json:"user_id"`
|
||||
Status object.BaseBoolInt `json:"status"`
|
||||
Error struct {
|
||||
Code int `json:"code"`
|
||||
Description string `json:"description"`
|
||||
} `json:"error"`
|
||||
}
|
||||
|
||||
// NotificationsSendMessage sends notification to the VK Apps user.
|
||||
//
|
||||
// https://vk.com/dev/notifications.sendMessage
|
||||
func (vk *VK) NotificationsSendMessage(params Params) (response NotificationsSendMessageResponse, err error) {
|
||||
err = vk.RequestUnmarshal("notifications.sendMessage", &response, params)
|
||||
return
|
||||
}
|
||||
90
vendor/github.com/SevereCloud/vksdk/v2/api/orders.go
generated
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
package api // import "github.com/SevereCloud/vksdk/v2/api"
|
||||
|
||||
import (
|
||||
"github.com/SevereCloud/vksdk/v2/object"
|
||||
)
|
||||
|
||||
// OrdersCancelSubscription allows to cancel subscription.
|
||||
//
|
||||
// https://vk.com/dev/orders.cancelSubscription
|
||||
func (vk *VK) OrdersCancelSubscription(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("orders.cancelSubscription", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// OrdersChangeStateResponse struct.
|
||||
type OrdersChangeStateResponse string // New state
|
||||
|
||||
// OrdersChangeState changes order status.
|
||||
//
|
||||
// https://vk.com/dev/orders.changeState
|
||||
func (vk *VK) OrdersChangeState(params Params) (response OrdersChangeStateResponse, err error) {
|
||||
err = vk.RequestUnmarshal("orders.changeState", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// OrdersGetResponse struct.
|
||||
type OrdersGetResponse []object.OrdersOrder
|
||||
|
||||
// OrdersGet returns a list of orders.
|
||||
//
|
||||
// https://vk.com/dev/orders.get
|
||||
func (vk *VK) OrdersGet(params Params) (response OrdersGetResponse, err error) {
|
||||
err = vk.RequestUnmarshal("orders.get", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// OrdersGetAmountResponse struct.
|
||||
type OrdersGetAmountResponse []object.OrdersAmount
|
||||
|
||||
// OrdersGetAmount returns the cost of votes in the user's consent.
|
||||
//
|
||||
// https://vk.com/dev/orders.getAmount
|
||||
func (vk *VK) OrdersGetAmount(params Params) (response OrdersGetAmountResponse, err error) {
|
||||
err = vk.RequestUnmarshal("orders.getAmount", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// OrdersGetByIDResponse struct.
|
||||
type OrdersGetByIDResponse []object.OrdersOrder
|
||||
|
||||
// OrdersGetByID returns information about orders by their IDs.
|
||||
//
|
||||
// https://vk.com/dev/orders.getByID
|
||||
func (vk *VK) OrdersGetByID(params Params) (response OrdersGetByIDResponse, err error) {
|
||||
err = vk.RequestUnmarshal("orders.getById", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// OrdersGetUserSubscriptionByIDResponse struct.
|
||||
type OrdersGetUserSubscriptionByIDResponse object.OrdersSubscription
|
||||
|
||||
// OrdersGetUserSubscriptionByID allows to get subscription by its ID.
|
||||
//
|
||||
// https://vk.com/dev/orders.getUserSubscriptionById
|
||||
func (vk *VK) OrdersGetUserSubscriptionByID(params Params) (response OrdersGetUserSubscriptionByIDResponse, err error) {
|
||||
err = vk.RequestUnmarshal("orders.getUserSubscriptionById", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// OrdersGetUserSubscriptionsResponse struct.
|
||||
type OrdersGetUserSubscriptionsResponse struct {
|
||||
Count int `json:"count"` // Total number
|
||||
Items []object.OrdersSubscription `json:"items"`
|
||||
}
|
||||
|
||||
// OrdersGetUserSubscriptions allows to get user's active subscriptions.
|
||||
//
|
||||
// https://vk.com/dev/orders.getUserSubscriptions
|
||||
func (vk *VK) OrdersGetUserSubscriptions(params Params) (response OrdersGetUserSubscriptionsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("orders.getUserSubscriptions", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// OrdersUpdateSubscription allows to update subscription price.
|
||||
//
|
||||
// https://vk.com/dev/orders.updateSubscription
|
||||
func (vk *VK) OrdersUpdateSubscription(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("orders.updateSubscription", &response, params)
|
||||
return
|
||||
}
|
||||
81
vendor/github.com/SevereCloud/vksdk/v2/api/pages.go
generated
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
package api // import "github.com/SevereCloud/vksdk/v2/api"
|
||||
|
||||
import (
|
||||
"github.com/SevereCloud/vksdk/v2/object"
|
||||
)
|
||||
|
||||
// PagesClearCache allows to clear the cache of particular external pages which may be attached to VK posts.
|
||||
//
|
||||
// https://vk.com/dev/pages.clearCache
|
||||
func (vk *VK) PagesClearCache(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("pages.clearCache", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PagesGetResponse struct.
|
||||
type PagesGetResponse object.PagesWikipageFull
|
||||
|
||||
// PagesGet returns information about a wiki page.
|
||||
//
|
||||
// https://vk.com/dev/pages.get
|
||||
func (vk *VK) PagesGet(params Params) (response PagesGetResponse, err error) {
|
||||
err = vk.RequestUnmarshal("pages.get", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PagesGetHistoryResponse struct.
|
||||
type PagesGetHistoryResponse []object.PagesWikipageHistory
|
||||
|
||||
// PagesGetHistory returns a list of all previous versions of a wiki page.
|
||||
//
|
||||
// https://vk.com/dev/pages.getHistory
|
||||
func (vk *VK) PagesGetHistory(params Params) (response PagesGetHistoryResponse, err error) {
|
||||
err = vk.RequestUnmarshal("pages.getHistory", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PagesGetTitlesResponse struct.
|
||||
type PagesGetTitlesResponse []object.PagesWikipageFull
|
||||
|
||||
// PagesGetTitles returns a list of wiki pages in a group.
|
||||
//
|
||||
// https://vk.com/dev/pages.getTitles
|
||||
func (vk *VK) PagesGetTitles(params Params) (response PagesGetTitlesResponse, err error) {
|
||||
err = vk.RequestUnmarshal("pages.getTitles", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PagesGetVersionResponse struct.
|
||||
type PagesGetVersionResponse object.PagesWikipageFull
|
||||
|
||||
// PagesGetVersion returns the text of one of the previous versions of a wiki page.
|
||||
//
|
||||
// https://vk.com/dev/pages.getVersion
|
||||
func (vk *VK) PagesGetVersion(params Params) (response PagesGetVersionResponse, err error) {
|
||||
err = vk.RequestUnmarshal("pages.getVersion", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PagesParseWiki returns HTML representation of the wiki markup.
|
||||
//
|
||||
// https://vk.com/dev/pages.parseWiki
|
||||
func (vk *VK) PagesParseWiki(params Params) (response string, err error) {
|
||||
err = vk.RequestUnmarshal("pages.parseWiki", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PagesSave saves the text of a wiki page.
|
||||
//
|
||||
// https://vk.com/dev/pages.save
|
||||
func (vk *VK) PagesSave(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("pages.save", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PagesSaveAccess saves modified read and edit access settings for a wiki page.
|
||||
//
|
||||
// https://vk.com/dev/pages.saveAccess
|
||||
func (vk *VK) PagesSaveAccess(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("pages.saveAccess", &response, params)
|
||||
return
|
||||
}
|
||||
613
vendor/github.com/SevereCloud/vksdk/v2/api/photos.go
generated
vendored
Normal file
@@ -0,0 +1,613 @@
|
||||
package api // import "github.com/SevereCloud/vksdk/v2/api"
|
||||
|
||||
import (
|
||||
"github.com/SevereCloud/vksdk/v2/object"
|
||||
)
|
||||
|
||||
// PhotosConfirmTag confirms a tag on a photo.
|
||||
//
|
||||
// https://vk.com/dev/photos.confirmTag
|
||||
func (vk *VK) PhotosConfirmTag(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("photos.confirmTag", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosCopy allows to copy a photo to the "Saved photos" album.
|
||||
//
|
||||
// https://vk.com/dev/photos.copy
|
||||
func (vk *VK) PhotosCopy(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("photos.copy", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosCreateAlbumResponse struct.
|
||||
type PhotosCreateAlbumResponse object.PhotosPhotoAlbumFull
|
||||
|
||||
// PhotosCreateAlbum creates an empty photo album.
|
||||
//
|
||||
// https://vk.com/dev/photos.createAlbum
|
||||
func (vk *VK) PhotosCreateAlbum(params Params) (response PhotosCreateAlbumResponse, err error) {
|
||||
err = vk.RequestUnmarshal("photos.createAlbum", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosCreateComment adds a new comment on the photo.
|
||||
//
|
||||
// https://vk.com/dev/photos.createComment
|
||||
func (vk *VK) PhotosCreateComment(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("photos.createComment", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosDelete deletes a photo.
|
||||
//
|
||||
// https://vk.com/dev/photos.delete
|
||||
func (vk *VK) PhotosDelete(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("photos.delete", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosDeleteAlbum deletes a photo album belonging to the current user.
|
||||
//
|
||||
// https://vk.com/dev/photos.deleteAlbum
|
||||
func (vk *VK) PhotosDeleteAlbum(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("photos.deleteAlbum", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosDeleteComment deletes a comment on the photo.
|
||||
//
|
||||
// https://vk.com/dev/photos.deleteComment
|
||||
func (vk *VK) PhotosDeleteComment(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("photos.deleteComment", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosEdit edits the caption of a photo.
|
||||
//
|
||||
// https://vk.com/dev/photos.edit
|
||||
func (vk *VK) PhotosEdit(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("photos.edit", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosEditAlbum edits information about a photo album.
|
||||
//
|
||||
// https://vk.com/dev/photos.editAlbum
|
||||
func (vk *VK) PhotosEditAlbum(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("photos.editAlbum", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosEditComment edits a comment on a photo.
|
||||
//
|
||||
// https://vk.com/dev/photos.editComment
|
||||
func (vk *VK) PhotosEditComment(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("photos.editComment", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosGetResponse struct.
|
||||
type PhotosGetResponse struct {
|
||||
Count int `json:"count"` // Total number
|
||||
Items []object.PhotosPhoto `json:"items"`
|
||||
}
|
||||
|
||||
// PhotosGet returns a list of a user's or community's photos.
|
||||
//
|
||||
// extended=0
|
||||
//
|
||||
// https://vk.com/dev/photos.get
|
||||
func (vk *VK) PhotosGet(params Params) (response PhotosGetResponse, err error) {
|
||||
err = vk.RequestUnmarshal("photos.get", &response, params, Params{"extended": false})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosGetExtendedResponse struct.
|
||||
type PhotosGetExtendedResponse struct {
|
||||
Count int `json:"count"` // Total number
|
||||
Items []object.PhotosPhotoFull `json:"items"`
|
||||
}
|
||||
|
||||
// PhotosGetExtended returns a list of a user's or community's photos.
|
||||
//
|
||||
// extended=1
|
||||
//
|
||||
// https://vk.com/dev/photos.get
|
||||
func (vk *VK) PhotosGetExtended(params Params) (response PhotosGetExtendedResponse, err error) {
|
||||
err = vk.RequestUnmarshal("photos.get", &response, params, Params{"extended": true})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosGetAlbumsResponse struct.
|
||||
type PhotosGetAlbumsResponse struct {
|
||||
Count int `json:"count"` // Total number
|
||||
Items []object.PhotosPhotoAlbumFull `json:"items"`
|
||||
}
|
||||
|
||||
// PhotosGetAlbums returns a list of a user's or community's photo albums.
|
||||
//
|
||||
// https://vk.com/dev/photos.getAlbums
|
||||
func (vk *VK) PhotosGetAlbums(params Params) (response PhotosGetAlbumsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("photos.getAlbums", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosGetAlbumsCount returns the number of photo albums belonging to a user or community.
|
||||
//
|
||||
// https://vk.com/dev/photos.getAlbumsCount
|
||||
func (vk *VK) PhotosGetAlbumsCount(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("photos.getAlbumsCount", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosGetAllResponse struct.
|
||||
type PhotosGetAllResponse struct {
|
||||
Count int `json:"count"` // Total number
|
||||
Items []object.PhotosPhotoXtrRealOffset `json:"items"`
|
||||
More object.BaseBoolInt `json:"more"` // Information whether next page is presented
|
||||
}
|
||||
|
||||
// PhotosGetAll returns a list of photos belonging to a user or community, in reverse chronological order.
|
||||
//
|
||||
// extended=0
|
||||
//
|
||||
// https://vk.com/dev/photos.getAll
|
||||
func (vk *VK) PhotosGetAll(params Params) (response PhotosGetAllResponse, err error) {
|
||||
err = vk.RequestUnmarshal("photos.getAll", &response, params, Params{"extended": false})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosGetAllExtendedResponse struct.
|
||||
type PhotosGetAllExtendedResponse struct {
|
||||
Count int `json:"count"` // Total number
|
||||
Items []object.PhotosPhotoFullXtrRealOffset `json:"items"`
|
||||
More object.BaseBoolInt `json:"more"` // Information whether next page is presented
|
||||
}
|
||||
|
||||
// PhotosGetAllExtended returns a list of photos belonging to a user or community, in reverse chronological order.
|
||||
//
|
||||
// extended=1
|
||||
//
|
||||
// https://vk.com/dev/photos.getAll
|
||||
func (vk *VK) PhotosGetAllExtended(params Params) (response PhotosGetAllExtendedResponse, err error) {
|
||||
err = vk.RequestUnmarshal("photos.getAll", &response, params, Params{"extended": true})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosGetAllCommentsResponse struct.
|
||||
type PhotosGetAllCommentsResponse struct {
|
||||
Count int `json:"count"` // Total number
|
||||
Items []object.PhotosCommentXtrPid `json:"items"`
|
||||
}
|
||||
|
||||
// PhotosGetAllComments returns a list of comments on a specific
|
||||
// photo album or all albums of the user sorted in reverse chronological order.
|
||||
//
|
||||
// https://vk.com/dev/photos.getAllComments
|
||||
func (vk *VK) PhotosGetAllComments(params Params) (response PhotosGetAllCommentsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("photos.getAllComments", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosGetByIDResponse struct.
|
||||
type PhotosGetByIDResponse []object.PhotosPhoto
|
||||
|
||||
// PhotosGetByID returns information about photos by their IDs.
|
||||
//
|
||||
// extended=0
|
||||
//
|
||||
// https://vk.com/dev/photos.getById
|
||||
func (vk *VK) PhotosGetByID(params Params) (response PhotosGetByIDResponse, err error) {
|
||||
err = vk.RequestUnmarshal("photos.getById", &response, params, Params{"extended": false})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosGetByIDExtendedResponse struct.
|
||||
type PhotosGetByIDExtendedResponse []object.PhotosPhotoFull
|
||||
|
||||
// PhotosGetByIDExtended returns information about photos by their IDs.
|
||||
//
|
||||
// extended=1
|
||||
//
|
||||
// https://vk.com/dev/photos.getById
|
||||
func (vk *VK) PhotosGetByIDExtended(params Params) (response PhotosGetByIDExtendedResponse, err error) {
|
||||
err = vk.RequestUnmarshal("photos.getById", &response, params, Params{"extended": true})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosGetChatUploadServerResponse struct.
|
||||
type PhotosGetChatUploadServerResponse struct {
|
||||
UploadURL string `json:"upload_url"`
|
||||
}
|
||||
|
||||
// PhotosGetChatUploadServer returns an upload link for chat cover pictures.
|
||||
//
|
||||
// https://vk.com/dev/photos.getChatUploadServer
|
||||
func (vk *VK) PhotosGetChatUploadServer(params Params) (response PhotosGetChatUploadServerResponse, err error) {
|
||||
err = vk.RequestUnmarshal("photos.getChatUploadServer", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosGetCommentsResponse struct.
|
||||
type PhotosGetCommentsResponse struct {
|
||||
Count int `json:"count"` // Total number
|
||||
RealOffset int `json:"real_offset"` // Real offset of the comments
|
||||
Items []object.WallWallComment `json:"items"`
|
||||
}
|
||||
|
||||
// PhotosGetComments returns a list of comments on a photo.
|
||||
//
|
||||
// extended=0
|
||||
//
|
||||
// https://vk.com/dev/photos.getComments
|
||||
func (vk *VK) PhotosGetComments(params Params) (response PhotosGetCommentsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("photos.getComments", &response, params, Params{"extended": false})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosGetCommentsExtendedResponse struct.
|
||||
type PhotosGetCommentsExtendedResponse struct {
|
||||
Count int `json:"count"` // Total number
|
||||
RealOffset int `json:"real_offset"` // Real offset of the comments
|
||||
Items []object.WallWallComment `json:"items"`
|
||||
Profiles []object.UsersUser `json:"profiles"`
|
||||
Groups []object.GroupsGroup `json:"groups"`
|
||||
}
|
||||
|
||||
// PhotosGetCommentsExtended returns a list of comments on a photo.
|
||||
//
|
||||
// extended=1
|
||||
//
|
||||
// https://vk.com/dev/photos.getComments
|
||||
func (vk *VK) PhotosGetCommentsExtended(params Params) (response PhotosGetCommentsExtendedResponse, err error) {
|
||||
err = vk.RequestUnmarshal("photos.getComments", &response, params, Params{"extended": true})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosGetMarketAlbumUploadServerResponse struct.
|
||||
type PhotosGetMarketAlbumUploadServerResponse struct {
|
||||
UploadURL string `json:"upload_url"`
|
||||
}
|
||||
|
||||
// PhotosGetMarketAlbumUploadServer returns the server address for market album photo upload.
|
||||
//
|
||||
// https://vk.com/dev/photos.getMarketAlbumUploadServer
|
||||
func (vk *VK) PhotosGetMarketAlbumUploadServer(params Params) (
|
||||
response PhotosGetMarketAlbumUploadServerResponse,
|
||||
err error,
|
||||
) {
|
||||
err = vk.RequestUnmarshal("photos.getMarketAlbumUploadServer", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosGetMarketUploadServerResponse struct.
|
||||
type PhotosGetMarketUploadServerResponse struct {
|
||||
UploadURL string `json:"upload_url"`
|
||||
}
|
||||
|
||||
// PhotosGetMarketUploadServer returns the server address for market photo upload.
|
||||
//
|
||||
// https://vk.com/dev/photos.getMarketUploadServer
|
||||
func (vk *VK) PhotosGetMarketUploadServer(params Params) (response PhotosGetMarketUploadServerResponse, err error) {
|
||||
err = vk.RequestUnmarshal("photos.getMarketUploadServer", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosGetMessagesUploadServerResponse struct.
|
||||
type PhotosGetMessagesUploadServerResponse struct {
|
||||
AlbumID int `json:"album_id"`
|
||||
UploadURL string `json:"upload_url"`
|
||||
UserID int `json:"user_id,omitempty"`
|
||||
GroupID int `json:"group_id,omitempty"`
|
||||
}
|
||||
|
||||
// PhotosGetMessagesUploadServer returns the server address for photo upload onto a messages.
|
||||
//
|
||||
// https://vk.com/dev/photos.getMessagesUploadServer
|
||||
func (vk *VK) PhotosGetMessagesUploadServer(params Params) (response PhotosGetMessagesUploadServerResponse, err error) {
|
||||
err = vk.RequestUnmarshal("photos.getMessagesUploadServer", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosGetNewTagsResponse struct.
|
||||
type PhotosGetNewTagsResponse struct {
|
||||
Count int `json:"count"` // Total number
|
||||
Items []object.PhotosPhotoXtrTagInfo `json:"items"`
|
||||
}
|
||||
|
||||
// PhotosGetNewTags returns a list of photos with tags that have not been viewed.
|
||||
//
|
||||
// https://vk.com/dev/photos.getNewTags
|
||||
func (vk *VK) PhotosGetNewTags(params Params) (response PhotosGetNewTagsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("photos.getNewTags", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosGetOwnerCoverPhotoUploadServerResponse struct.
|
||||
type PhotosGetOwnerCoverPhotoUploadServerResponse struct {
|
||||
UploadURL string `json:"upload_url"`
|
||||
}
|
||||
|
||||
// PhotosGetOwnerCoverPhotoUploadServer receives server address for uploading community cover.
|
||||
//
|
||||
// https://vk.com/dev/photos.getOwnerCoverPhotoUploadServer
|
||||
func (vk *VK) PhotosGetOwnerCoverPhotoUploadServer(params Params) (
|
||||
response PhotosGetOwnerCoverPhotoUploadServerResponse,
|
||||
err error,
|
||||
) {
|
||||
err = vk.RequestUnmarshal("photos.getOwnerCoverPhotoUploadServer", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosGetOwnerPhotoUploadServerResponse struct.
|
||||
type PhotosGetOwnerPhotoUploadServerResponse struct {
|
||||
UploadURL string `json:"upload_url"`
|
||||
}
|
||||
|
||||
// PhotosGetOwnerPhotoUploadServer returns an upload server address for a
|
||||
// profile or community photo.
|
||||
//
|
||||
// https://vk.com/dev/photos.getOwnerPhotoUploadServer
|
||||
func (vk *VK) PhotosGetOwnerPhotoUploadServer(params Params) (
|
||||
response PhotosGetOwnerPhotoUploadServerResponse,
|
||||
err error,
|
||||
) {
|
||||
err = vk.RequestUnmarshal("photos.getOwnerPhotoUploadServer", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosGetTagsResponse struct.
|
||||
type PhotosGetTagsResponse []object.PhotosPhotoTag
|
||||
|
||||
// PhotosGetTags returns a list of tags on a photo.
|
||||
//
|
||||
// https://vk.com/dev/photos.getTags
|
||||
func (vk *VK) PhotosGetTags(params Params) (response PhotosGetTagsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("photos.getTags", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosGetUploadServerResponse struct.
|
||||
type PhotosGetUploadServerResponse object.PhotosPhotoUpload
|
||||
|
||||
// PhotosGetUploadServer returns the server address for photo upload.
|
||||
//
|
||||
// https://vk.com/dev/photos.getUploadServer
|
||||
func (vk *VK) PhotosGetUploadServer(params Params) (response PhotosGetUploadServerResponse, err error) {
|
||||
err = vk.RequestUnmarshal("photos.getUploadServer", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosGetUserPhotosResponse struct.
|
||||
type PhotosGetUserPhotosResponse struct {
|
||||
Count int `json:"count"` // Total number
|
||||
Items []object.PhotosPhoto `json:"items"`
|
||||
}
|
||||
|
||||
// PhotosGetUserPhotos returns a list of photos in which a user is tagged.
|
||||
//
|
||||
// extended=0
|
||||
//
|
||||
// https://vk.com/dev/photos.getUserPhotos
|
||||
func (vk *VK) PhotosGetUserPhotos(params Params) (response PhotosGetUserPhotosResponse, err error) {
|
||||
err = vk.RequestUnmarshal("photos.getUserPhotos", &response, params, Params{"extended": false})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosGetUserPhotosExtendedResponse struct.
|
||||
type PhotosGetUserPhotosExtendedResponse struct {
|
||||
Count int `json:"count"` // Total number
|
||||
Items []object.PhotosPhotoFull `json:"items"`
|
||||
}
|
||||
|
||||
// PhotosGetUserPhotosExtended returns a list of photos in which a user is tagged.
|
||||
//
|
||||
// extended=1
|
||||
//
|
||||
// https://vk.com/dev/photos.getUserPhotos
|
||||
func (vk *VK) PhotosGetUserPhotosExtended(params Params) (response PhotosGetUserPhotosExtendedResponse, err error) {
|
||||
err = vk.RequestUnmarshal("photos.getUserPhotos", &response, params, Params{"extended": true})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosGetWallUploadServerResponse struct.
|
||||
type PhotosGetWallUploadServerResponse object.PhotosPhotoUpload
|
||||
|
||||
// PhotosGetWallUploadServer returns the server address for photo upload onto a user's wall.
|
||||
//
|
||||
// https://vk.com/dev/photos.getWallUploadServer
|
||||
func (vk *VK) PhotosGetWallUploadServer(params Params) (response PhotosGetWallUploadServerResponse, err error) {
|
||||
err = vk.RequestUnmarshal("photos.getWallUploadServer", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosMakeCover makes a photo into an album cover.
|
||||
//
|
||||
// https://vk.com/dev/photos.makeCover
|
||||
func (vk *VK) PhotosMakeCover(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("photos.makeCover", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosMove a photo from one album to another.
|
||||
//
|
||||
// https://vk.com/dev/photos.moveMoves
|
||||
func (vk *VK) PhotosMove(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("photos.move", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosPutTag adds a tag on the photo.
|
||||
//
|
||||
// https://vk.com/dev/photos.putTag
|
||||
func (vk *VK) PhotosPutTag(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("photos.putTag", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosRemoveTag removes a tag from a photo.
|
||||
//
|
||||
// https://vk.com/dev/photos.removeTag
|
||||
func (vk *VK) PhotosRemoveTag(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("photos.removeTag", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosReorderAlbums reorders the album in the list of user albums.
|
||||
//
|
||||
// https://vk.com/dev/photos.reorderAlbums
|
||||
func (vk *VK) PhotosReorderAlbums(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("photos.reorderAlbums", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosReorderPhotos reorders the photo in the list of photos of the user album.
|
||||
//
|
||||
// https://vk.com/dev/photos.reorderPhotos
|
||||
func (vk *VK) PhotosReorderPhotos(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("photos.reorderPhotos", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosReport reports (submits a complaint about) a photo.
|
||||
//
|
||||
// https://vk.com/dev/photos.report
|
||||
func (vk *VK) PhotosReport(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("photos.report", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosReportComment reports (submits a complaint about) a comment on a photo.
|
||||
//
|
||||
// https://vk.com/dev/photos.reportComment
|
||||
func (vk *VK) PhotosReportComment(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("photos.reportComment", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosRestore restores a deleted photo.
|
||||
//
|
||||
// https://vk.com/dev/photos.restore
|
||||
func (vk *VK) PhotosRestore(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("photos.restore", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosRestoreComment restores a deleted comment on a photo.
|
||||
//
|
||||
// https://vk.com/dev/photos.restoreComment
|
||||
func (vk *VK) PhotosRestoreComment(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("photos.restoreComment", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosSaveResponse struct.
|
||||
type PhotosSaveResponse []object.PhotosPhoto
|
||||
|
||||
// PhotosSave saves photos after successful uploading.
|
||||
//
|
||||
// https://vk.com/dev/photos.save
|
||||
func (vk *VK) PhotosSave(params Params) (response PhotosSaveResponse, err error) {
|
||||
err = vk.RequestUnmarshal("photos.save", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosSaveMarketAlbumPhotoResponse struct.
|
||||
type PhotosSaveMarketAlbumPhotoResponse []object.PhotosPhoto
|
||||
|
||||
// PhotosSaveMarketAlbumPhoto photo Saves market album photos after successful uploading.
|
||||
//
|
||||
// https://vk.com/dev/photos.saveMarketAlbumPhoto
|
||||
func (vk *VK) PhotosSaveMarketAlbumPhoto(params Params) (response PhotosSaveMarketAlbumPhotoResponse, err error) {
|
||||
err = vk.RequestUnmarshal("photos.saveMarketAlbumPhoto", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosSaveMarketPhotoResponse struct.
|
||||
type PhotosSaveMarketPhotoResponse []object.PhotosPhoto
|
||||
|
||||
// PhotosSaveMarketPhoto saves market photos after successful uploading.
|
||||
//
|
||||
// https://vk.com/dev/photos.saveMarketPhoto
|
||||
func (vk *VK) PhotosSaveMarketPhoto(params Params) (response PhotosSaveMarketPhotoResponse, err error) {
|
||||
err = vk.RequestUnmarshal("photos.saveMarketPhoto", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosSaveMessagesPhotoResponse struct.
|
||||
type PhotosSaveMessagesPhotoResponse []object.PhotosPhoto
|
||||
|
||||
// PhotosSaveMessagesPhoto saves a photo after being successfully.
|
||||
//
|
||||
// https://vk.com/dev/photos.saveMessagesPhoto
|
||||
func (vk *VK) PhotosSaveMessagesPhoto(params Params) (response PhotosSaveMessagesPhotoResponse, err error) {
|
||||
err = vk.RequestUnmarshal("photos.saveMessagesPhoto", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosSaveOwnerCoverPhotoResponse struct.
|
||||
type PhotosSaveOwnerCoverPhotoResponse struct {
|
||||
Images []object.PhotosImage `json:"images"`
|
||||
}
|
||||
|
||||
// PhotosSaveOwnerCoverPhoto saves cover photo after successful uploading.
|
||||
//
|
||||
// https://vk.com/dev/photos.saveOwnerCoverPhoto
|
||||
func (vk *VK) PhotosSaveOwnerCoverPhoto(params Params) (response PhotosSaveOwnerCoverPhotoResponse, err error) {
|
||||
err = vk.RequestUnmarshal("photos.saveOwnerCoverPhoto", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosSaveOwnerPhotoResponse struct.
|
||||
type PhotosSaveOwnerPhotoResponse struct {
|
||||
PhotoHash string `json:"photo_hash"`
|
||||
PhotoSrc string `json:"photo_src"`
|
||||
PhotoSrcBig string `json:"photo_src_big"`
|
||||
PhotoSrcSmall string `json:"photo_src_small"`
|
||||
Saved int `json:"saved"`
|
||||
PostID int `json:"post_id"`
|
||||
}
|
||||
|
||||
// PhotosSaveOwnerPhoto saves a profile or community photo.
|
||||
//
|
||||
// https://vk.com/dev/photos.saveOwnerPhoto
|
||||
func (vk *VK) PhotosSaveOwnerPhoto(params Params) (response PhotosSaveOwnerPhotoResponse, err error) {
|
||||
err = vk.RequestUnmarshal("photos.saveOwnerPhoto", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosSaveWallPhotoResponse struct.
|
||||
type PhotosSaveWallPhotoResponse []object.PhotosPhoto
|
||||
|
||||
// PhotosSaveWallPhoto saves a photo to a user's or community's wall after being uploaded.
|
||||
//
|
||||
// https://vk.com/dev/photos.saveWallPhoto
|
||||
func (vk *VK) PhotosSaveWallPhoto(params Params) (response PhotosSaveWallPhotoResponse, err error) {
|
||||
err = vk.RequestUnmarshal("photos.saveWallPhoto", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PhotosSearchResponse struct.
|
||||
type PhotosSearchResponse struct {
|
||||
Count int `json:"count"` // Total number
|
||||
Items []object.PhotosPhotoFull `json:"items"`
|
||||
}
|
||||
|
||||
// PhotosSearch returns a list of photos.
|
||||
//
|
||||
// https://vk.com/dev/photos.search
|
||||
func (vk *VK) PhotosSearch(params Params) (response PhotosSearchResponse, err error) {
|
||||
err = vk.RequestUnmarshal("photos.search", &response, params)
|
||||
return
|
||||
}
|
||||
179
vendor/github.com/SevereCloud/vksdk/v2/api/podcasts.go
generated
vendored
Normal file
@@ -0,0 +1,179 @@
|
||||
package api // import "github.com/SevereCloud/vksdk/v2/api"
|
||||
|
||||
import (
|
||||
"github.com/SevereCloud/vksdk/v2/object"
|
||||
)
|
||||
|
||||
// PodcastsGetCatalogResponse struct.
|
||||
type PodcastsGetCatalogResponse struct {
|
||||
Items []object.PodcastsItem `json:"items"`
|
||||
}
|
||||
|
||||
// PodcastsGetCatalog method.
|
||||
//
|
||||
// extended=0
|
||||
//
|
||||
// https://vk.com/dev/podcasts.getCatalog
|
||||
func (vk *VK) PodcastsGetCatalog(params Params) (response PodcastsGetCatalogResponse, err error) {
|
||||
err = vk.RequestUnmarshal("podcasts.getCatalog", &response, params, Params{"extended": false})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// PodcastsGetCatalogExtendedResponse struct.
|
||||
type PodcastsGetCatalogExtendedResponse struct {
|
||||
Items []object.PodcastsItem `json:"items"`
|
||||
object.ExtendedResponse
|
||||
}
|
||||
|
||||
// PodcastsGetCatalogExtended method.
|
||||
//
|
||||
// extended=1
|
||||
//
|
||||
// https://vk.com/dev/podcasts.getCatalog
|
||||
func (vk *VK) PodcastsGetCatalogExtended(params Params) (response PodcastsGetCatalogExtendedResponse, err error) {
|
||||
err = vk.RequestUnmarshal("podcasts.getCatalog", &response, params, Params{"extended": true})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// PodcastsGetCategoriesResponse struct.
|
||||
type PodcastsGetCategoriesResponse []object.PodcastsCategory
|
||||
|
||||
// PodcastsGetCategories method.
|
||||
//
|
||||
// https://vk.com/dev/podcasts.getCategories
|
||||
func (vk *VK) PodcastsGetCategories(params Params) (response PodcastsGetCategoriesResponse, err error) {
|
||||
err = vk.RequestUnmarshal("podcasts.getCategories", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PodcastsGetEpisodesResponse struct.
|
||||
type PodcastsGetEpisodesResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.PodcastsEpisode `json:"items"`
|
||||
}
|
||||
|
||||
// PodcastsGetEpisodes method.
|
||||
//
|
||||
// https://vk.com/dev/podcasts.getEpisodes
|
||||
func (vk *VK) PodcastsGetEpisodes(params Params) (response PodcastsGetEpisodesResponse, err error) {
|
||||
err = vk.RequestUnmarshal("podcasts.getEpisodes", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PodcastsGetFeedResponse struct.
|
||||
type PodcastsGetFeedResponse struct {
|
||||
Items []object.PodcastsEpisode `json:"items"`
|
||||
NextFrom string `json:"next_from"`
|
||||
}
|
||||
|
||||
// PodcastsGetFeed method.
|
||||
//
|
||||
// extended=0
|
||||
//
|
||||
// https://vk.com/dev/podcasts.getFeed
|
||||
func (vk *VK) PodcastsGetFeed(params Params) (response PodcastsGetFeedResponse, err error) {
|
||||
err = vk.RequestUnmarshal("podcasts.getFeed", &response, params, Params{"extended": false})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// PodcastsGetFeedExtendedResponse struct.
|
||||
type PodcastsGetFeedExtendedResponse struct {
|
||||
Items []object.PodcastsEpisode `json:"items"`
|
||||
NextFrom string `json:"next_from"`
|
||||
object.ExtendedResponse
|
||||
}
|
||||
|
||||
// PodcastsGetFeedExtended method.
|
||||
//
|
||||
// extended=1
|
||||
//
|
||||
// https://vk.com/dev/podcasts.getFeed
|
||||
func (vk *VK) PodcastsGetFeedExtended(params Params) (response PodcastsGetFeedExtendedResponse, err error) {
|
||||
err = vk.RequestUnmarshal("podcasts.getFeed", &response, params, Params{"extended": true})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// PodcastsGetStartPageResponse struct.
|
||||
type PodcastsGetStartPageResponse struct {
|
||||
Order []string `json:"order"`
|
||||
InProgress []object.PodcastsEpisode `json:"in_progress"`
|
||||
Bookmarks []object.PodcastsEpisode `json:"bookmarks"`
|
||||
Articles []object.Article `json:"articles"`
|
||||
StaticHowTo []bool `json:"static_how_to"`
|
||||
FriendsLiked []object.PodcastsEpisode `json:"friends_liked"`
|
||||
Subscriptions []object.PodcastsEpisode `json:"subscriptions"`
|
||||
CategoriesList []object.PodcastsCategory `json:"categories_list"`
|
||||
RecommendedEpisodes []object.PodcastsEpisode `json:"recommended_episodes"`
|
||||
Catalog []struct {
|
||||
Category object.PodcastsCategory `json:"category"`
|
||||
Items []object.PodcastsItem `json:"items"`
|
||||
} `json:"catalog"`
|
||||
}
|
||||
|
||||
// PodcastsGetStartPage method.
|
||||
//
|
||||
// extended=0
|
||||
//
|
||||
// https://vk.com/dev/podcasts.getStartPage
|
||||
func (vk *VK) PodcastsGetStartPage(params Params) (response PodcastsGetStartPageResponse, err error) {
|
||||
err = vk.RequestUnmarshal("podcasts.getStartPage", &response, params, Params{"extended": false})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// PodcastsGetStartPageExtendedResponse struct.
|
||||
type PodcastsGetStartPageExtendedResponse struct {
|
||||
Order []string `json:"order"`
|
||||
InProgress []object.PodcastsEpisode `json:"in_progress"`
|
||||
Bookmarks []object.PodcastsEpisode `json:"bookmarks"`
|
||||
Articles []object.Article `json:"articles"`
|
||||
StaticHowTo []bool `json:"static_how_to"`
|
||||
FriendsLiked []object.PodcastsEpisode `json:"friends_liked"`
|
||||
Subscriptions []object.PodcastsEpisode `json:"subscriptions"`
|
||||
CategoriesList []object.PodcastsCategory `json:"categories_list"`
|
||||
RecommendedEpisodes []object.PodcastsEpisode `json:"recommended_episodes"`
|
||||
Catalog []struct {
|
||||
Category object.PodcastsCategory `json:"category"`
|
||||
Items []object.PodcastsItem `json:"items"`
|
||||
} `json:"catalog"`
|
||||
object.ExtendedResponse
|
||||
}
|
||||
|
||||
// PodcastsGetStartPageExtended method.
|
||||
//
|
||||
// extended=1
|
||||
//
|
||||
// https://vk.com/dev/podcasts.getStartPage
|
||||
func (vk *VK) PodcastsGetStartPageExtended(params Params) (response PodcastsGetStartPageExtendedResponse, err error) {
|
||||
err = vk.RequestUnmarshal("podcasts.getStartPage", &response, params, Params{"extended": true})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// PodcastsMarkAsListened method.
|
||||
//
|
||||
// https://vk.com/dev/podcasts.markAsListened
|
||||
func (vk *VK) PodcastsMarkAsListened(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("podcasts.markAsListened", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PodcastsSubscribe method.
|
||||
//
|
||||
// https://vk.com/dev/podcasts.subscribe
|
||||
func (vk *VK) PodcastsSubscribe(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("podcasts.subscribe", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PodcastsUnsubscribe method.
|
||||
//
|
||||
// https://vk.com/dev/podcasts.unsubscribe
|
||||
func (vk *VK) PodcastsUnsubscribe(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("podcasts.unsubscribe", &response, params)
|
||||
return
|
||||
}
|
||||
106
vendor/github.com/SevereCloud/vksdk/v2/api/polls.go
generated
vendored
Normal file
@@ -0,0 +1,106 @@
|
||||
package api // import "github.com/SevereCloud/vksdk/v2/api"
|
||||
|
||||
import "github.com/SevereCloud/vksdk/v2/object"
|
||||
|
||||
// PollsAddVote adds the current user's vote to the selected answer in the poll.
|
||||
//
|
||||
// https://vk.com/dev/polls.addVote
|
||||
func (vk *VK) PollsAddVote(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("polls.addVote", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PollsCreateResponse struct.
|
||||
type PollsCreateResponse object.PollsPoll
|
||||
|
||||
// PollsCreate creates polls that can be attached to the users' or communities' posts.
|
||||
//
|
||||
// https://vk.com/dev/polls.create
|
||||
func (vk *VK) PollsCreate(params Params) (response PollsCreateResponse, err error) {
|
||||
err = vk.RequestUnmarshal("polls.create", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PollsDeleteVote deletes the current user's vote from the selected answer in the poll.
|
||||
//
|
||||
// https://vk.com/dev/polls.deleteVote
|
||||
func (vk *VK) PollsDeleteVote(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("polls.deleteVote", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PollsEdit edits created polls.
|
||||
//
|
||||
// https://vk.com/dev/polls.edit
|
||||
func (vk *VK) PollsEdit(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("polls.edit", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PollsGetBackgroundsResponse struct.
|
||||
type PollsGetBackgroundsResponse []object.PollsBackground
|
||||
|
||||
// PollsGetBackgrounds return default backgrounds for polls.
|
||||
//
|
||||
// https://vk.com/dev/polls.getBackgrounds
|
||||
func (vk *VK) PollsGetBackgrounds(params Params) (response PollsGetBackgroundsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("polls.getBackgrounds", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PollsGetByIDResponse struct.
|
||||
type PollsGetByIDResponse object.PollsPoll
|
||||
|
||||
// PollsGetByID returns detailed information about a poll by its ID.
|
||||
//
|
||||
// https://vk.com/dev/polls.getById
|
||||
func (vk *VK) PollsGetByID(params Params) (response PollsGetByIDResponse, err error) {
|
||||
err = vk.RequestUnmarshal("polls.getById", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PollsGetPhotoUploadServerResponse struct.
|
||||
type PollsGetPhotoUploadServerResponse struct {
|
||||
UploadURL string `json:"upload_url"`
|
||||
}
|
||||
|
||||
// PollsGetPhotoUploadServer returns a URL for uploading a photo to a poll.
|
||||
//
|
||||
// https://vk.com/dev/polls.getPhotoUploadServer
|
||||
func (vk *VK) PollsGetPhotoUploadServer(params Params) (response PollsGetPhotoUploadServerResponse, err error) {
|
||||
err = vk.RequestUnmarshal("polls.getPhotoUploadServer", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PollsGetVotersResponse struct.
|
||||
type PollsGetVotersResponse []object.PollsVoters
|
||||
|
||||
// PollsGetVoters returns a list of IDs of users who selected specific answers in the poll.
|
||||
//
|
||||
// https://vk.com/dev/polls.getVoters
|
||||
func (vk *VK) PollsGetVoters(params Params) (response PollsGetVotersResponse, err error) {
|
||||
err = vk.RequestUnmarshal("polls.getVoters", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PollsGetVotersFieldsResponse struct.
|
||||
type PollsGetVotersFieldsResponse []object.PollsVotersFields
|
||||
|
||||
// PollsGetVotersFields returns a list of IDs of users who selected specific answers in the poll.
|
||||
//
|
||||
// https://vk.com/dev/polls.getVoters
|
||||
func (vk *VK) PollsGetVotersFields(params Params) (response PollsGetVotersFieldsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("polls.getVoters", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PollsSavePhotoResponse struct.
|
||||
type PollsSavePhotoResponse object.PollsPhoto
|
||||
|
||||
// PollsSavePhoto allows to save poll's uploaded photo.
|
||||
//
|
||||
// https://vk.com/dev/polls.savePhoto
|
||||
func (vk *VK) PollsSavePhoto(params Params) (response PollsSavePhotoResponse, err error) {
|
||||
err = vk.RequestUnmarshal("polls.savePhoto", &response, params)
|
||||
return
|
||||
}
|
||||
79
vendor/github.com/SevereCloud/vksdk/v2/api/prettycards.go
generated
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
package api // import "github.com/SevereCloud/vksdk/v2/api"
|
||||
|
||||
import "github.com/SevereCloud/vksdk/v2/object"
|
||||
|
||||
// PrettyCardsCreateResponse struct.
|
||||
type PrettyCardsCreateResponse struct {
|
||||
OwnerID int `json:"owner_id"` // Owner ID of created pretty card
|
||||
CardID string `json:"card_id"` // Card ID of created pretty card
|
||||
}
|
||||
|
||||
// PrettyCardsCreate method.
|
||||
//
|
||||
// https://vk.com/dev/prettyCards.create
|
||||
func (vk *VK) PrettyCardsCreate(params Params) (response PrettyCardsCreateResponse, err error) {
|
||||
err = vk.RequestUnmarshal("prettyCards.create", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PrettyCardsDeleteResponse struct.
|
||||
type PrettyCardsDeleteResponse struct {
|
||||
OwnerID int `json:"owner_id"` // Owner ID of created pretty card
|
||||
CardID string `json:"card_id"` // Card ID of created pretty card
|
||||
Error string `json:"error"` // Error reason if error happened
|
||||
}
|
||||
|
||||
// PrettyCardsDelete method.
|
||||
//
|
||||
// https://vk.com/dev/prettyCards.delete
|
||||
func (vk *VK) PrettyCardsDelete(params Params) (response PrettyCardsDeleteResponse, err error) {
|
||||
err = vk.RequestUnmarshal("prettyCards.delete", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PrettyCardsEditResponse struct.
|
||||
type PrettyCardsEditResponse struct {
|
||||
OwnerID int `json:"owner_id"` // Owner ID of created pretty card
|
||||
CardID string `json:"card_id"` // Card ID of created pretty card
|
||||
}
|
||||
|
||||
// PrettyCardsEdit method.
|
||||
//
|
||||
// https://vk.com/dev/prettyCards.edit
|
||||
func (vk *VK) PrettyCardsEdit(params Params) (response PrettyCardsEditResponse, err error) {
|
||||
err = vk.RequestUnmarshal("prettyCards.edit", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PrettyCardsGetResponse struct.
|
||||
type PrettyCardsGetResponse struct {
|
||||
Count int `json:"count"` // Total number
|
||||
Items []object.PrettyCardsPrettyCard `json:"items"`
|
||||
}
|
||||
|
||||
// PrettyCardsGet method.
|
||||
//
|
||||
// https://vk.com/dev/prettyCards.get
|
||||
func (vk *VK) PrettyCardsGet(params Params) (response PrettyCardsGetResponse, err error) {
|
||||
err = vk.RequestUnmarshal("prettyCards.get", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PrettyCardsGetByIDResponse struct.
|
||||
type PrettyCardsGetByIDResponse []object.PrettyCardsPrettyCard
|
||||
|
||||
// PrettyCardsGetByID method.
|
||||
//
|
||||
// https://vk.com/dev/prettyCards.getById
|
||||
func (vk *VK) PrettyCardsGetByID(params Params) (response PrettyCardsGetByIDResponse, err error) {
|
||||
err = vk.RequestUnmarshal("prettyCards.getById", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// PrettyCardsGetUploadURL method.
|
||||
//
|
||||
// https://vk.com/dev/prettyCards.getUploadURL
|
||||
func (vk *VK) PrettyCardsGetUploadURL(params Params) (response string, err error) {
|
||||
err = vk.RequestUnmarshal("prettyCards.getUploadURL", &response, params)
|
||||
return
|
||||
}
|
||||
17
vendor/github.com/SevereCloud/vksdk/v2/api/search.go
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
package api // import "github.com/SevereCloud/vksdk/v2/api"
|
||||
|
||||
import "github.com/SevereCloud/vksdk/v2/object"
|
||||
|
||||
// SearchGetHintsResponse struct.
|
||||
type SearchGetHintsResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.SearchHint `json:"items"`
|
||||
}
|
||||
|
||||
// SearchGetHints allows the programmer to do a quick search for any substring.
|
||||
//
|
||||
// https://vk.com/dev/search.getHints
|
||||
func (vk *VK) SearchGetHints(params Params) (response SearchGetHintsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("search.getHints", &response, params)
|
||||
return
|
||||
}
|
||||
110
vendor/github.com/SevereCloud/vksdk/v2/api/secure.go
generated
vendored
Normal file
@@ -0,0 +1,110 @@
|
||||
package api // import "github.com/SevereCloud/vksdk/v2/api"
|
||||
|
||||
import (
|
||||
"github.com/SevereCloud/vksdk/v2/object"
|
||||
)
|
||||
|
||||
// SecureAddAppEventResponse struct.
|
||||
type SecureAddAppEventResponse int // FIXME: not found documentation. https://github.com/VKCOM/vk-api-schema/issues/98
|
||||
|
||||
// SecureAddAppEvent adds user activity information to an application.
|
||||
//
|
||||
// https://vk.com/dev/secure.addAppEvent
|
||||
func (vk *VK) SecureAddAppEvent(params Params) (response SecureAddAppEventResponse, err error) {
|
||||
err = vk.RequestUnmarshal("secure.addAppEvent", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// SecureCheckTokenResponse struct.
|
||||
type SecureCheckTokenResponse object.SecureTokenChecked
|
||||
|
||||
// SecureCheckToken checks the user authentication in IFrame and Flash apps using the access_token parameter.
|
||||
//
|
||||
// https://vk.com/dev/secure.checkToken
|
||||
func (vk *VK) SecureCheckToken(params Params) (response SecureCheckTokenResponse, err error) {
|
||||
err = vk.RequestUnmarshal("secure.checkToken", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// SecureGetAppBalance returns payment balance of the application in hundredth of a vote.
|
||||
//
|
||||
// https://vk.com/dev/secure.getAppBalance
|
||||
func (vk *VK) SecureGetAppBalance(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("secure.getAppBalance", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// SecureGetSMSHistoryResponse struct.
|
||||
type SecureGetSMSHistoryResponse []object.SecureSmsNotification
|
||||
|
||||
// SecureGetSMSHistory shows a list of SMS notifications sent by the
|
||||
// application using secure.sendSMSNotification method.
|
||||
//
|
||||
// https://vk.com/dev/secure.getSMSHistory
|
||||
func (vk *VK) SecureGetSMSHistory(params Params) (response SecureGetSMSHistoryResponse, err error) {
|
||||
err = vk.RequestUnmarshal("secure.getSMSHistory", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// SecureGetTransactionsHistoryResponse struct.
|
||||
type SecureGetTransactionsHistoryResponse []object.SecureTransaction
|
||||
|
||||
// SecureGetTransactionsHistory shows history of votes transaction between users and the application.
|
||||
//
|
||||
// https://vk.com/dev/secure.getTransactionsHistory
|
||||
func (vk *VK) SecureGetTransactionsHistory(params Params) (response SecureGetTransactionsHistoryResponse, err error) {
|
||||
err = vk.RequestUnmarshal("secure.getTransactionsHistory", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// SecureGetUserLevelResponse struct.
|
||||
type SecureGetUserLevelResponse []object.SecureLevel
|
||||
|
||||
// SecureGetUserLevel returns one of the previously set game levels of one or more users in the application.
|
||||
//
|
||||
// https://vk.com/dev/secure.getUserLevel
|
||||
func (vk *VK) SecureGetUserLevel(params Params) (response SecureGetUserLevelResponse, err error) {
|
||||
err = vk.RequestUnmarshal("secure.getUserLevel", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// SecureGiveEventStickerResponse struct.
|
||||
type SecureGiveEventStickerResponse []struct {
|
||||
UserID int `json:"user_id"`
|
||||
Status string `json:"status"`
|
||||
}
|
||||
|
||||
// SecureGiveEventSticker method.
|
||||
//
|
||||
// https://vk.com/dev/secure.giveEventSticker
|
||||
func (vk *VK) SecureGiveEventSticker(params Params) (response SecureGiveEventStickerResponse, err error) {
|
||||
err = vk.RequestUnmarshal("secure.giveEventSticker", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// SecureSendNotificationResponse struct.
|
||||
type SecureSendNotificationResponse []int // User ID
|
||||
|
||||
// SecureSendNotification sends notification to the user.
|
||||
//
|
||||
// https://vk.com/dev/secure.sendNotification
|
||||
func (vk *VK) SecureSendNotification(params Params) (response SecureSendNotificationResponse, err error) {
|
||||
err = vk.RequestUnmarshal("secure.sendNotification", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// SecureSendSMSNotification sends SMS notification to a user's mobile device.
|
||||
//
|
||||
// https://vk.com/dev/secure.sendSMSNotification
|
||||
func (vk *VK) SecureSendSMSNotification(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("secure.sendSMSNotification", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// SecureSetCounter sets a counter which is shown to the user in bold in the left menu.
|
||||
//
|
||||
// https://vk.com/dev/secure.setCounter
|
||||
func (vk *VK) SecureSetCounter(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("secure.setCounter", &response, params)
|
||||
return
|
||||
}
|
||||
35
vendor/github.com/SevereCloud/vksdk/v2/api/stats.go
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
package api // import "github.com/SevereCloud/vksdk/v2/api"
|
||||
|
||||
import (
|
||||
"github.com/SevereCloud/vksdk/v2/object"
|
||||
)
|
||||
|
||||
// StatsGetResponse struct.
|
||||
type StatsGetResponse []object.StatsPeriod
|
||||
|
||||
// StatsGet returns statistics of a community or an application.
|
||||
//
|
||||
// https://vk.com/dev/stats.get
|
||||
func (vk *VK) StatsGet(params Params) (response StatsGetResponse, err error) {
|
||||
err = vk.RequestUnmarshal("stats.get", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// StatsGetPostReachResponse struct.
|
||||
type StatsGetPostReachResponse []object.StatsWallpostStat
|
||||
|
||||
// StatsGetPostReach returns stats for a wall post.
|
||||
//
|
||||
// https://vk.com/dev/stats.getPostReach
|
||||
func (vk *VK) StatsGetPostReach(params Params) (response StatsGetPostReachResponse, err error) {
|
||||
err = vk.RequestUnmarshal("stats.getPostReach", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// StatsTrackVisitor adds current session's data in the application statistics.
|
||||
//
|
||||
// https://vk.com/dev/stats.trackVisitor
|
||||
func (vk *VK) StatsTrackVisitor(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("stats.trackVisitor", &response, params)
|
||||
return
|
||||
}
|
||||
23
vendor/github.com/SevereCloud/vksdk/v2/api/status.go
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
package api // import "github.com/SevereCloud/vksdk/v2/api"
|
||||
|
||||
import (
|
||||
"github.com/SevereCloud/vksdk/v2/object"
|
||||
)
|
||||
|
||||
// StatusGetResponse struct.
|
||||
type StatusGetResponse struct {
|
||||
Audio object.AudioAudio `json:"audio"`
|
||||
Text string `json:"text"`
|
||||
}
|
||||
|
||||
// StatusGet returns data required to show the status of a user or community.
|
||||
func (vk *VK) StatusGet(params Params) (response StatusGetResponse, err error) {
|
||||
err = vk.RequestUnmarshal("status.get", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// StatusSet sets a new status for the current user.
|
||||
func (vk *VK) StatusSet(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("status.set", &response, params)
|
||||
return
|
||||
}
|
||||
48
vendor/github.com/SevereCloud/vksdk/v2/api/storage.go
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
package api // import "github.com/SevereCloud/vksdk/v2/api"
|
||||
|
||||
import (
|
||||
"github.com/SevereCloud/vksdk/v2/object"
|
||||
)
|
||||
|
||||
// StorageGetResponse struct.
|
||||
type StorageGetResponse []object.BaseRequestParam
|
||||
|
||||
// ToMap return map from StorageGetResponse.
|
||||
func (s StorageGetResponse) ToMap() map[string]string {
|
||||
m := make(map[string]string)
|
||||
for _, item := range s {
|
||||
m[item.Key] = item.Value
|
||||
}
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
// StorageGet returns a value of variable with the name set by key parameter.
|
||||
//
|
||||
// StorageGet always return array!
|
||||
//
|
||||
// https://vk.com/dev/storage.get
|
||||
func (vk *VK) StorageGet(params Params) (response StorageGetResponse, err error) {
|
||||
err = vk.RequestUnmarshal("storage.get", &response, params)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// StorageGetKeysResponse struct.
|
||||
type StorageGetKeysResponse []string
|
||||
|
||||
// StorageGetKeys returns the names of all variables.
|
||||
//
|
||||
// https://vk.com/dev/storage.getKeys
|
||||
func (vk *VK) StorageGetKeys(params Params) (response StorageGetKeysResponse, err error) {
|
||||
err = vk.RequestUnmarshal("storage.getKeys", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// StorageSet saves a value of variable with the name set by key parameter.
|
||||
//
|
||||
// https://vk.com/dev/storage.set
|
||||
func (vk *VK) StorageSet(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("storage.set", &response, params)
|
||||
return
|
||||
}
|
||||
35
vendor/github.com/SevereCloud/vksdk/v2/api/store.go
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
package api // import "github.com/SevereCloud/vksdk/api"
|
||||
|
||||
import (
|
||||
"github.com/SevereCloud/vksdk/v2/object"
|
||||
)
|
||||
|
||||
// StoreAddStickersToFavorite add stickers to favorite.
|
||||
//
|
||||
// https://vk.com/dev/store.addStickersToFavorite
|
||||
func (vk *VK) StoreAddStickersToFavorite(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("store.addStickersToFavorite", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// StoreGetFavoriteStickersResponse struct.
|
||||
type StoreGetFavoriteStickersResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.BaseSticker `json:"items"`
|
||||
}
|
||||
|
||||
// StoreGetFavoriteStickers return favorite stickers.
|
||||
//
|
||||
// https://vk.com/dev/store.getFavoriteStickers
|
||||
func (vk *VK) StoreGetFavoriteStickers(params Params) (response StoreGetFavoriteStickersResponse, err error) {
|
||||
err = vk.RequestUnmarshal("store.getFavoriteStickers", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// StoreRemoveStickersFromFavorite remove stickers from favorite.
|
||||
//
|
||||
// https://vk.com/dev/store.removeStickersFromFavorite
|
||||
func (vk *VK) StoreRemoveStickersFromFavorite(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("store.removeStickersFromFavorite", &response, params)
|
||||
return
|
||||
}
|
||||
308
vendor/github.com/SevereCloud/vksdk/v2/api/stories.go
generated
vendored
Normal file
@@ -0,0 +1,308 @@
|
||||
package api // import "github.com/SevereCloud/vksdk/v2/api"
|
||||
|
||||
import (
|
||||
"github.com/SevereCloud/vksdk/v2/object"
|
||||
)
|
||||
|
||||
// StoriesBanOwner allows to hide stories from chosen sources from current user's feed.
|
||||
//
|
||||
// https://vk.com/dev/stories.banOwner
|
||||
func (vk *VK) StoriesBanOwner(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("stories.banOwner", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// StoriesDelete allows to delete story.
|
||||
//
|
||||
// https://vk.com/dev/stories.delete
|
||||
func (vk *VK) StoriesDelete(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("stories.delete", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// StoriesGetResponse struct.
|
||||
type StoriesGetResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.StoriesFeedItem `json:"items"`
|
||||
PromoData object.StoriesPromoData `json:"promo_data"`
|
||||
NeedUploadScreen object.BaseBoolInt `json:"need_upload_screen"`
|
||||
}
|
||||
|
||||
// StoriesGet returns stories available for current user.
|
||||
//
|
||||
// extended=0
|
||||
//
|
||||
// https://vk.com/dev/stories.get
|
||||
func (vk *VK) StoriesGet(params Params) (response StoriesGetResponse, err error) {
|
||||
err = vk.RequestUnmarshal("stories.get", &response, params, Params{"extended": false})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// StoriesGetExtendedResponse struct.
|
||||
type StoriesGetExtendedResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.StoriesFeedItem `json:"items"`
|
||||
PromoData object.StoriesPromoData `json:"promo_data"`
|
||||
NeedUploadScreen object.BaseBoolInt `json:"need_upload_screen"`
|
||||
object.ExtendedResponse
|
||||
}
|
||||
|
||||
// StoriesGetExtended returns stories available for current user.
|
||||
//
|
||||
// extended=1
|
||||
//
|
||||
// https://vk.com/dev/stories.get
|
||||
func (vk *VK) StoriesGetExtended(params Params) (response StoriesGetExtendedResponse, err error) {
|
||||
err = vk.RequestUnmarshal("stories.get", &response, params, Params{"extended": true})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// StoriesGetBannedResponse struct.
|
||||
type StoriesGetBannedResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []int `json:"items"`
|
||||
}
|
||||
|
||||
// StoriesGetBanned returns list of sources hidden from current user's feed.
|
||||
//
|
||||
// extended=0
|
||||
//
|
||||
// https://vk.com/dev/stories.getBanned
|
||||
func (vk *VK) StoriesGetBanned(params Params) (response StoriesGetBannedResponse, err error) {
|
||||
err = vk.RequestUnmarshal("stories.getBanned", &response, params, Params{"extended": false})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// StoriesGetBannedExtendedResponse struct.
|
||||
type StoriesGetBannedExtendedResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []int `json:"items"`
|
||||
object.ExtendedResponse
|
||||
}
|
||||
|
||||
// StoriesGetBannedExtended returns list of sources hidden from current user's feed.
|
||||
//
|
||||
// extended=1
|
||||
//
|
||||
// https://vk.com/dev/stories.getBanned
|
||||
func (vk *VK) StoriesGetBannedExtended(params Params) (response StoriesGetBannedExtendedResponse, err error) {
|
||||
err = vk.RequestUnmarshal("stories.getBanned", &response, params, Params{"extended": true})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// StoriesGetByIDResponse struct.
|
||||
type StoriesGetByIDResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.StoriesStory `json:"items"`
|
||||
}
|
||||
|
||||
// StoriesGetByID returns story by its ID.
|
||||
//
|
||||
// extended=0
|
||||
//
|
||||
// https://vk.com/dev/stories.getById
|
||||
func (vk *VK) StoriesGetByID(params Params) (response StoriesGetByIDResponse, err error) {
|
||||
err = vk.RequestUnmarshal("stories.getById", &response, params, Params{"extended": false})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// StoriesGetByIDExtendedResponse struct.
|
||||
type StoriesGetByIDExtendedResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.StoriesStory `json:"items"`
|
||||
object.ExtendedResponse
|
||||
}
|
||||
|
||||
// StoriesGetByIDExtended returns story by its ID.
|
||||
//
|
||||
// extended=1
|
||||
//
|
||||
// https://vk.com/dev/stories.getById
|
||||
func (vk *VK) StoriesGetByIDExtended(params Params) (response StoriesGetByIDExtendedResponse, err error) {
|
||||
err = vk.RequestUnmarshal("stories.getById", &response, params, Params{"extended": true})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// StoriesGetPhotoUploadServerResponse struct.
|
||||
type StoriesGetPhotoUploadServerResponse struct {
|
||||
UploadURL string `json:"upload_url"`
|
||||
PeerIDs []int `json:"peer_ids"`
|
||||
UserIDs []int `json:"user_ids"`
|
||||
}
|
||||
|
||||
// StoriesGetPhotoUploadServer returns URL for uploading a story with photo.
|
||||
//
|
||||
// https://vk.com/dev/stories.getPhotoUploadServer
|
||||
func (vk *VK) StoriesGetPhotoUploadServer(params Params) (response StoriesGetPhotoUploadServerResponse, err error) {
|
||||
err = vk.RequestUnmarshal("stories.getPhotoUploadServer", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// StoriesGetRepliesResponse struct.
|
||||
type StoriesGetRepliesResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.StoriesFeedItem `json:"items"`
|
||||
}
|
||||
|
||||
// StoriesGetReplies returns replies to the story.
|
||||
//
|
||||
// extended=0
|
||||
//
|
||||
// https://vk.com/dev/stories.getReplies
|
||||
func (vk *VK) StoriesGetReplies(params Params) (response StoriesGetRepliesResponse, err error) {
|
||||
err = vk.RequestUnmarshal("stories.getReplies", &response, params, Params{"extended": false})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// StoriesGetRepliesExtendedResponse struct.
|
||||
type StoriesGetRepliesExtendedResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.StoriesFeedItem `json:"items"`
|
||||
object.ExtendedResponse
|
||||
}
|
||||
|
||||
// StoriesGetRepliesExtended returns replies to the story.
|
||||
//
|
||||
// extended=1
|
||||
//
|
||||
// https://vk.com/dev/stories.getReplies
|
||||
func (vk *VK) StoriesGetRepliesExtended(params Params) (response StoriesGetRepliesExtendedResponse, err error) {
|
||||
err = vk.RequestUnmarshal("stories.getReplies", &response, params, Params{"extended": true})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// StoriesGetStatsResponse struct.
|
||||
type StoriesGetStatsResponse object.StoriesStoryStats
|
||||
|
||||
// StoriesGetStats return statistics data for the story.
|
||||
//
|
||||
// https://vk.com/dev/stories.getStats
|
||||
func (vk *VK) StoriesGetStats(params Params) (response StoriesGetStatsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("stories.getStats", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// StoriesGetVideoUploadServerResponse struct.
|
||||
type StoriesGetVideoUploadServerResponse struct {
|
||||
UploadURL string `json:"upload_url"`
|
||||
PeerIDs []int `json:"peer_ids"`
|
||||
UserIDs []int `json:"user_ids"`
|
||||
}
|
||||
|
||||
// StoriesGetVideoUploadServer allows to receive URL for uploading story with video.
|
||||
//
|
||||
// https://vk.com/dev/stories.getVideoUploadServer
|
||||
func (vk *VK) StoriesGetVideoUploadServer(params Params) (response StoriesGetVideoUploadServerResponse, err error) {
|
||||
err = vk.RequestUnmarshal("stories.getVideoUploadServer", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// StoriesGetViewersResponse struct.
|
||||
type StoriesGetViewersResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.StoriesViewer `json:"items"`
|
||||
}
|
||||
|
||||
// StoriesGetViewers returns a list of story viewers.
|
||||
//
|
||||
// extended=0
|
||||
//
|
||||
// https://vk.com/dev/stories.getViewers
|
||||
func (vk *VK) StoriesGetViewers(params Params) (response StoriesGetViewersResponse, err error) {
|
||||
err = vk.RequestUnmarshal("stories.getViewers", &response, params)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// StoriesHideAllReplies hides all replies in the last 24 hours from the user to current user's stories.
|
||||
//
|
||||
// https://vk.com/dev/stories.hideAllReplies
|
||||
func (vk *VK) StoriesHideAllReplies(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("stories.hideAllReplies", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// StoriesHideReply hides the reply to the current user's story.
|
||||
//
|
||||
// https://vk.com/dev/stories.hideReply
|
||||
func (vk *VK) StoriesHideReply(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("stories.hideReply", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// StoriesSaveResponse struct.
|
||||
type StoriesSaveResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.StoriesStory `json:"items"`
|
||||
object.ExtendedResponse
|
||||
}
|
||||
|
||||
// StoriesSave method.
|
||||
//
|
||||
// https://vk.com/dev/stories.save
|
||||
func (vk *VK) StoriesSave(params Params) (response StoriesSaveResponse, err error) {
|
||||
err = vk.RequestUnmarshal("stories.save", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// StoriesSearchResponse struct.
|
||||
type StoriesSearchResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.StoriesFeedItem `json:"items"`
|
||||
}
|
||||
|
||||
// StoriesSearch returns search results for stories.
|
||||
//
|
||||
// extended=0
|
||||
//
|
||||
// https://vk.com/dev/stories.search
|
||||
func (vk *VK) StoriesSearch(params Params) (response StoriesSearchResponse, err error) {
|
||||
err = vk.RequestUnmarshal("stories.search", &response, params, Params{"extended": false})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// StoriesSearchExtendedResponse struct.
|
||||
type StoriesSearchExtendedResponse struct {
|
||||
Count int `json:"count"`
|
||||
Items []object.StoriesFeedItem `json:"items"`
|
||||
object.ExtendedResponse
|
||||
}
|
||||
|
||||
// StoriesSearchExtended returns search results for stories.
|
||||
//
|
||||
// extended=1
|
||||
//
|
||||
// https://vk.com/dev/stories.search
|
||||
func (vk *VK) StoriesSearchExtended(params Params) (response StoriesSearchExtendedResponse, err error) {
|
||||
err = vk.RequestUnmarshal("stories.search", &response, params, Params{"extended": true})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// StoriesSendInteraction sends feedback to the story.
|
||||
//
|
||||
// Available for applications with type VK Mini Apps. The default method is
|
||||
// not available to applications.
|
||||
//
|
||||
// https://vk.com/dev/stories.sendInteraction
|
||||
func (vk *VK) StoriesSendInteraction(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("stories.sendInteraction", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// StoriesUnbanOwner allows to show stories from hidden sources in current user's feed.
|
||||
//
|
||||
// https://vk.com/dev/stories.unbanOwner
|
||||
func (vk *VK) StoriesUnbanOwner(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("stories.unbanOwner", &response, params)
|
||||
return
|
||||
}
|
||||
67
vendor/github.com/SevereCloud/vksdk/v2/api/streaming.go
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
package api // import "github.com/SevereCloud/vksdk/v2/api"
|
||||
|
||||
// StreamingGetServerURLResponse struct.
|
||||
type StreamingGetServerURLResponse struct {
|
||||
Endpoint string `json:"endpoint"`
|
||||
Key string `json:"key"`
|
||||
}
|
||||
|
||||
// StreamingGetServerURL allows to receive data for the connection to Streaming API.
|
||||
//
|
||||
// https://vk.com/dev/streaming.getServerUrl
|
||||
func (vk *VK) StreamingGetServerURL(params Params) (response StreamingGetServerURLResponse, err error) {
|
||||
err = vk.RequestUnmarshal("streaming.getServerUrl", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// StreamingGetSettingsResponse struct.
|
||||
type StreamingGetSettingsResponse struct {
|
||||
MonthlyLimit string `json:"monthly_limit"`
|
||||
}
|
||||
|
||||
// StreamingGetSettings allows to receive monthly tier for Streaming API.
|
||||
//
|
||||
// https://vk.com/dev/streaming.getSettings
|
||||
func (vk *VK) StreamingGetSettings(params Params) (response StreamingGetSettingsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("streaming.getSettings", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// StreamingGetStatsResponse struct.
|
||||
type StreamingGetStatsResponse []struct {
|
||||
EventType string `json:"event_type"`
|
||||
Stats []struct {
|
||||
Timestamp int `json:"timestamp"`
|
||||
Value int `json:"value"`
|
||||
} `json:"stats"`
|
||||
}
|
||||
|
||||
// StreamingGetStats allows to receive statistics for prepared and received events in Streaming API.
|
||||
//
|
||||
// https://vk.com/dev/streaming.getStats
|
||||
func (vk *VK) StreamingGetStats(params Params) (response StreamingGetStatsResponse, err error) {
|
||||
err = vk.RequestUnmarshal("streaming.getStats", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// StreamingGetStemResponse struct.
|
||||
type StreamingGetStemResponse struct {
|
||||
Stem string `json:"stem"`
|
||||
}
|
||||
|
||||
// StreamingGetStem allows to receive the stem of the word.
|
||||
//
|
||||
// https://vk.com/dev/streaming.getStem
|
||||
func (vk *VK) StreamingGetStem(params Params) (response StreamingGetStemResponse, err error) {
|
||||
err = vk.RequestUnmarshal("streaming.getStem", &response, params)
|
||||
return
|
||||
}
|
||||
|
||||
// StreamingSetSettings allows to set monthly tier for Streaming API.
|
||||
//
|
||||
// https://vk.com/dev/streaming.setSettings
|
||||
func (vk *VK) StreamingSetSettings(params Params) (response int, err error) {
|
||||
err = vk.RequestUnmarshal("streaming.setSettings", &response, params)
|
||||
|
||||
return
|
||||
}
|
||||
961
vendor/github.com/SevereCloud/vksdk/v2/api/upload.go
generated
vendored
Normal file
@@ -0,0 +1,961 @@
|
||||
package api // import "github.com/SevereCloud/vksdk/v2/api"
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"mime/multipart"
|
||||
|
||||
"github.com/SevereCloud/vksdk/v2/object"
|
||||
)
|
||||
|
||||
// UploadFile uploading file.
|
||||
func (vk *VK) UploadFile(url string, file io.Reader, fieldname, filename string) (bodyContent []byte, err error) {
|
||||
body := new(bytes.Buffer)
|
||||
writer := multipart.NewWriter(body)
|
||||
|
||||
part, err := writer.CreateFormFile(fieldname, filename)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
_, err = io.Copy(part, file)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
contentType := writer.FormDataContentType()
|
||||
_ = writer.Close()
|
||||
|
||||
resp, err := vk.Client.Post(url, contentType, body)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
bodyContent, err = ioutil.ReadAll(resp.Body)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// uploadPhoto uploading Photos into Album.
|
||||
//
|
||||
// Supported formats: JPG, PNG, GIF.
|
||||
//
|
||||
// Limits: width+height not more than 14000 px, file size up to 50 Mb,
|
||||
// aspect ratio of at least 1:20.
|
||||
func (vk *VK) uploadPhoto(params Params, file io.Reader) (response PhotosSaveResponse, err error) {
|
||||
uploadServer, err := vk.PhotosGetUploadServer(params)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
bodyContent, err := vk.UploadFile(uploadServer.UploadURL, file, "file1", "file1.jpeg")
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
var handler object.PhotosPhotoUploadResponse
|
||||
|
||||
err = json.Unmarshal(bodyContent, &handler)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
response, err = vk.PhotosSave(Params{
|
||||
"server": handler.Server,
|
||||
"photos_list": handler.PhotosList,
|
||||
"aid": handler.AID,
|
||||
"hash": handler.Hash,
|
||||
"album_id": params["album_id"],
|
||||
"group_id": params["group_id"],
|
||||
})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UploadPhoto uploading Photos into User Album.
|
||||
//
|
||||
// Supported formats: JPG, PNG, GIF.
|
||||
//
|
||||
// Limits: width+height not more than 14000 px, file size up to 50 Mb,
|
||||
// aspect ratio of at least 1:20.
|
||||
func (vk *VK) UploadPhoto(albumID int, file io.Reader) (response PhotosSaveResponse, err error) {
|
||||
response, err = vk.uploadPhoto(Params{
|
||||
"album_id": albumID,
|
||||
}, file)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UploadPhotoGroup uploading Photos into Group Album.
|
||||
//
|
||||
// Supported formats: JPG, PNG, GIF.
|
||||
//
|
||||
// Limits: width+height not more than 14000 px, file size up to 50 Mb,
|
||||
// aspect ratio of at least 1:20.
|
||||
func (vk *VK) UploadPhotoGroup(groupID, albumID int, file io.Reader) (response PhotosSaveResponse, err error) {
|
||||
response, err = vk.uploadPhoto(Params{
|
||||
"album_id": albumID,
|
||||
"group_id": groupID,
|
||||
}, file)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// uploadWallPhoto uploading Photos on Wall.
|
||||
//
|
||||
// Supported formats: JPG, PNG, GIF.
|
||||
//
|
||||
// Limits: width+height not more than 14000 px, file size up to 50 Mb,
|
||||
// aspect ratio of at least 1:20.
|
||||
func (vk *VK) uploadWallPhoto(params Params, file io.Reader) (response PhotosSaveWallPhotoResponse, err error) {
|
||||
uploadServer, err := vk.PhotosGetWallUploadServer(params)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
bodyContent, err := vk.UploadFile(uploadServer.UploadURL, file, "photo", "photo.jpeg")
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
var handler object.PhotosWallUploadResponse
|
||||
|
||||
err = json.Unmarshal(bodyContent, &handler)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
response, err = vk.PhotosSaveWallPhoto(Params{
|
||||
"server": handler.Server,
|
||||
"photo": handler.Photo,
|
||||
"hash": handler.Hash,
|
||||
"group_id": params["group_id"],
|
||||
})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UploadWallPhoto uploading Photos on User Wall.
|
||||
//
|
||||
// Supported formats: JPG, PNG, GIF.
|
||||
//
|
||||
// Limits: width+height not more than 14000 px, file size up to 50 Mb,
|
||||
// aspect ratio of at least 1:20.
|
||||
func (vk *VK) UploadWallPhoto(file io.Reader) (response PhotosSaveWallPhotoResponse, err error) {
|
||||
response, err = vk.uploadWallPhoto(Params{}, file)
|
||||
return
|
||||
}
|
||||
|
||||
// UploadGroupWallPhoto uploading Photos on Group Wall.
|
||||
//
|
||||
// Supported formats: JPG, PNG, GIF.
|
||||
//
|
||||
// Limits: width+height not more than 14000 px, file size up to 50 Mb,
|
||||
// aspect ratio of at least 1:20.
|
||||
func (vk *VK) UploadGroupWallPhoto(groupID int, file io.Reader) (response PhotosSaveWallPhotoResponse, err error) {
|
||||
response, err = vk.uploadWallPhoto(Params{
|
||||
"group_id": groupID,
|
||||
}, file)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// uploadOwnerPhoto uploading Photos into User Profile or Community
|
||||
// To upload a photo to a community send its negative id in the owner_id parameter.
|
||||
//
|
||||
// Following parameters can be sent in addition:
|
||||
// squareCrop in x,y,w (no quotes) format where x and y are the coordinates of
|
||||
// the preview upper-right corner and w is square side length.
|
||||
// That will create a square preview for a photo.
|
||||
//
|
||||
// Supported formats: JPG, PNG, GIF.
|
||||
//
|
||||
// Limits: size not less than 200x200px, aspect ratio from 0.25 to 3,
|
||||
// width+height not more than 14000 px, file size up to 50 Mb.
|
||||
func (vk *VK) uploadOwnerPhoto(params Params, squareCrop string, file io.Reader) (
|
||||
response PhotosSaveOwnerPhotoResponse,
|
||||
err error,
|
||||
) {
|
||||
uploadServer, err := vk.PhotosGetOwnerPhotoUploadServer(params)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
body := new(bytes.Buffer)
|
||||
writer := multipart.NewWriter(body)
|
||||
|
||||
part, err := writer.CreateFormFile("photo", "photo.jpeg")
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
_, err = io.Copy(part, file)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
contentType := writer.FormDataContentType()
|
||||
|
||||
if squareCrop != "" {
|
||||
err = writer.WriteField("_square_crop", squareCrop)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
_ = writer.Close()
|
||||
|
||||
resp, err := vk.Client.Post(uploadServer.UploadURL, contentType, body)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
bodyContent, err := ioutil.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
var handler object.PhotosOwnerUploadResponse
|
||||
|
||||
err = json.Unmarshal(bodyContent, &handler)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
response, err = vk.PhotosSaveOwnerPhoto(Params{
|
||||
"server": handler.Server,
|
||||
"photo": handler.Photo,
|
||||
"hash": handler.Hash,
|
||||
})
|
||||
|
||||
return response, err
|
||||
}
|
||||
|
||||
// UploadUserPhoto uploading Photos into User Profile.
|
||||
//
|
||||
// Supported formats: JPG, PNG, GIF.
|
||||
//
|
||||
// Limits: size not less than 200x200px, aspect ratio from 0.25 to 3,
|
||||
// width+height not more than 14000 px, file size up to 50 Mb.
|
||||
func (vk *VK) UploadUserPhoto(file io.Reader) (response PhotosSaveOwnerPhotoResponse, err error) {
|
||||
response, err = vk.uploadOwnerPhoto(Params{}, "", file)
|
||||
return
|
||||
}
|
||||
|
||||
// UploadOwnerPhoto uploading Photos into User Profile or Community
|
||||
// To upload a photo to a community send its negative id in the owner_id parameter.
|
||||
//
|
||||
// Following parameters can be sent in addition:
|
||||
// squareCrop in x,y,w (no quotes) format where x and y are the coordinates of
|
||||
// the preview upper-right corner and w is square side length.
|
||||
// That will create a square preview for a photo.
|
||||
//
|
||||
// Supported formats: JPG, PNG, GIF.
|
||||
//
|
||||
// Limits: size not less than 200x200px, aspect ratio from 0.25 to 3,
|
||||
// width+height not more than 14000 px, file size up to 50 Mb.
|
||||
func (vk *VK) UploadOwnerPhoto(ownerID int, squareCrop string, file io.Reader) (
|
||||
response PhotosSaveOwnerPhotoResponse,
|
||||
err error,
|
||||
) {
|
||||
response, err = vk.uploadOwnerPhoto(Params{
|
||||
"owner_id": ownerID,
|
||||
}, squareCrop, file)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UploadMessagesPhoto uploading Photos into a Private Message.
|
||||
//
|
||||
// Supported formats: JPG, PNG, GIF.
|
||||
//
|
||||
// Limits: width+height not more than 14000 px, file size up to 50 Mb,
|
||||
// aspect ratio of at least 1:20.
|
||||
func (vk *VK) UploadMessagesPhoto(peerID int, file io.Reader) (response PhotosSaveMessagesPhotoResponse, err error) {
|
||||
uploadServer, err := vk.PhotosGetMessagesUploadServer(Params{
|
||||
"peer_id": peerID,
|
||||
})
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
bodyContent, err := vk.UploadFile(uploadServer.UploadURL, file, "photo", "photo.jpeg")
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
var handler object.PhotosMessageUploadResponse
|
||||
|
||||
err = json.Unmarshal(bodyContent, &handler)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
response, err = vk.PhotosSaveMessagesPhoto(Params{
|
||||
"server": handler.Server,
|
||||
"photo": handler.Photo,
|
||||
"hash": handler.Hash,
|
||||
})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// uploadChatPhoto uploading a Main Photo to a Group Chat.
|
||||
//
|
||||
// Supported formats: JPG, PNG, GIF.
|
||||
//
|
||||
// Limits: size not less than 200x200px,
|
||||
// width+height not more than 14000 px, file size up to 50 Mb,
|
||||
// aspect ratio of at least 1:20.
|
||||
func (vk *VK) uploadChatPhoto(params Params, file io.Reader) (response MessagesSetChatPhotoResponse, err error) {
|
||||
uploadServer, err := vk.PhotosGetChatUploadServer(params)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
bodyContent, err := vk.UploadFile(uploadServer.UploadURL, file, "file", "photo.jpeg")
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
var handler object.PhotosChatUploadResponse
|
||||
|
||||
err = json.Unmarshal(bodyContent, &handler)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
response, err = vk.MessagesSetChatPhoto(Params{
|
||||
"file": handler.Response,
|
||||
})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UploadChatPhoto uploading a Main Photo to a Group Chat without crop.
|
||||
//
|
||||
// Supported formats: JPG, PNG, GIF.
|
||||
//
|
||||
// Limits: size not less than 200x200px,
|
||||
// width+height not more than 14000 px, file size up to 50 Mb,
|
||||
// aspect ratio of at least 1:20.
|
||||
func (vk *VK) UploadChatPhoto(chatID int, file io.Reader) (response MessagesSetChatPhotoResponse, err error) {
|
||||
response, err = vk.uploadChatPhoto(Params{
|
||||
"chat_id": chatID,
|
||||
}, file)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UploadChatPhotoCrop uploading a Main Photo to a Group Chat with crop.
|
||||
//
|
||||
// Supported formats: JPG, PNG, GIF.
|
||||
//
|
||||
// Limits: size not less than 200x200px,
|
||||
// width+height not more than 14000 px, file size up to 50 Mb,
|
||||
// aspect ratio of at least 1:20.
|
||||
func (vk *VK) UploadChatPhotoCrop(chatID, cropX, cropY, cropWidth int, file io.Reader) (
|
||||
response MessagesSetChatPhotoResponse,
|
||||
err error,
|
||||
) {
|
||||
response, err = vk.uploadChatPhoto(Params{
|
||||
"chat_id": chatID,
|
||||
"crop_x": cropX,
|
||||
"crop_y": cropY,
|
||||
"crop_width": cropWidth,
|
||||
}, file)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// uploadMarketPhoto uploading a Market Item Photo.
|
||||
//
|
||||
// Supported formats: JPG, PNG, GIF.
|
||||
//
|
||||
// Limits: size not less than 400x400px,
|
||||
// width+height not more than 14000 px, file size up to 50 Mb,
|
||||
// aspect ratio of at least 1:20.
|
||||
func (vk *VK) uploadMarketPhoto(params Params, file io.Reader) (response PhotosSaveMarketPhotoResponse, err error) {
|
||||
uploadServer, err := vk.PhotosGetMarketUploadServer(params)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
bodyContent, err := vk.UploadFile(uploadServer.UploadURL, file, "file", "photo.jpeg")
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
var handler object.PhotosMarketUploadResponse
|
||||
|
||||
err = json.Unmarshal(bodyContent, &handler)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
response, err = vk.PhotosSaveMarketPhoto(Params{
|
||||
"group_id": params["group_id"],
|
||||
"server": handler.Server,
|
||||
"photo": handler.Photo,
|
||||
"hash": handler.Hash,
|
||||
"crop_data": handler.CropData,
|
||||
"crop_hash": handler.CropHash,
|
||||
})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UploadMarketPhoto uploading a Market Item Photo without crop.
|
||||
//
|
||||
// Supported formats: JPG, PNG, GIF.
|
||||
//
|
||||
// Limits: size not less than 400x400px,
|
||||
// width+height not more than 14000 px, file size up to 50 Mb,
|
||||
// aspect ratio of at least 1:20.
|
||||
func (vk *VK) UploadMarketPhoto(groupID int, mainPhoto bool, file io.Reader) (
|
||||
response PhotosSaveMarketPhotoResponse,
|
||||
err error,
|
||||
) {
|
||||
response, err = vk.uploadMarketPhoto(Params{
|
||||
"group_id": groupID,
|
||||
"main_photo": mainPhoto,
|
||||
}, file)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UploadMarketPhotoCrop uploading a Market Item Photo with crop.
|
||||
//
|
||||
// Supported formats: JPG, PNG, GIF.
|
||||
//
|
||||
// Limits: size not less than 400x400px,
|
||||
// width+height not more than 14000 px, file size up to 50 Mb,
|
||||
// aspect ratio of at least 1:20.
|
||||
func (vk *VK) UploadMarketPhotoCrop(groupID, cropX, cropY, cropWidth int, file io.Reader) (
|
||||
response PhotosSaveMarketPhotoResponse,
|
||||
err error,
|
||||
) {
|
||||
response, err = vk.uploadMarketPhoto(Params{
|
||||
"group_id": groupID,
|
||||
"main_photo": true,
|
||||
"crop_x": cropX,
|
||||
"crop_y": cropY,
|
||||
"crop_width": cropWidth,
|
||||
}, file)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UploadMarketAlbumPhoto uploading a Main Photo to a Group Chat.
|
||||
//
|
||||
// Supported formats: JPG, PNG, GIF.
|
||||
//
|
||||
// Limits: size not less than 1280x720px,
|
||||
// width+height not more than 14000 px, file size up to 50 Mb,
|
||||
// aspect ratio of at least 1:20.
|
||||
func (vk *VK) UploadMarketAlbumPhoto(groupID int, file io.Reader) (
|
||||
response PhotosSaveMarketAlbumPhotoResponse,
|
||||
err error,
|
||||
) {
|
||||
uploadServer, err := vk.PhotosGetMarketAlbumUploadServer(Params{
|
||||
"group_id": groupID,
|
||||
})
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
bodyContent, err := vk.UploadFile(uploadServer.UploadURL, file, "file", "photo.jpeg")
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
var handler object.PhotosMarketAlbumUploadResponse
|
||||
|
||||
err = json.Unmarshal(bodyContent, &handler)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
return vk.PhotosSaveMarketAlbumPhoto(Params{
|
||||
"group_id": groupID,
|
||||
"server": handler.Server,
|
||||
"photo": handler.Photo,
|
||||
"hash": handler.Hash,
|
||||
})
|
||||
}
|
||||
|
||||
// UploadVideo uploading Video Files.
|
||||
//
|
||||
// Supported formats: AVI, MP4, 3GP, MPEG, MOV, FLV, WMV.
|
||||
func (vk *VK) UploadVideo(params Params, file io.Reader) (response VideoSaveResponse, err error) {
|
||||
response, err = vk.VideoSave(params)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
bodyContent, err := vk.UploadFile(response.UploadURL, file, "video_file", "video.mp4")
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
var videoUploadError UploadError
|
||||
|
||||
err = json.Unmarshal(bodyContent, &videoUploadError)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if videoUploadError.Code != 0 {
|
||||
err = &videoUploadError
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// uploadDoc uploading Documents.
|
||||
//
|
||||
// Supported formats: any formats excepting mp3 and executable files.
|
||||
//
|
||||
// Limits: file size up to 200 MB.
|
||||
func (vk *VK) uploadDoc(url, title, tags string, file io.Reader) (response DocsSaveResponse, err error) {
|
||||
bodyContent, err := vk.UploadFile(url, file, "file", title)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
var docUploadError UploadError
|
||||
|
||||
err = json.Unmarshal(bodyContent, &docUploadError)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if docUploadError.Err != "" {
|
||||
err = &docUploadError
|
||||
return
|
||||
}
|
||||
|
||||
var handler object.DocsDocUploadResponse
|
||||
|
||||
err = json.Unmarshal(bodyContent, &handler)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
response, err = vk.DocsSave(Params{
|
||||
"file": handler.File,
|
||||
"title": title,
|
||||
"tags": tags,
|
||||
})
|
||||
|
||||
return response, err
|
||||
}
|
||||
|
||||
// UploadDoc uploading Documents.
|
||||
//
|
||||
// Supported formats: any formats excepting mp3 and executable files.
|
||||
//
|
||||
// Limits: file size up to 200 MB.
|
||||
func (vk *VK) UploadDoc(title, tags string, file io.Reader) (response DocsSaveResponse, err error) {
|
||||
uploadServer, err := vk.DocsGetUploadServer(nil)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
response, err = vk.uploadDoc(uploadServer.UploadURL, title, tags, file)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UploadGroupDoc uploading Documents into Community.
|
||||
//
|
||||
// Supported formats: any formats excepting mp3 and executable files.
|
||||
//
|
||||
// Limits: file size up to 200 MB.
|
||||
func (vk *VK) UploadGroupDoc(groupID int, title, tags string, file io.Reader) (response DocsSaveResponse, err error) {
|
||||
uploadServer, err := vk.DocsGetUploadServer(Params{
|
||||
"group_id": groupID,
|
||||
})
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
response, err = vk.uploadDoc(uploadServer.UploadURL, title, tags, file)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UploadWallDoc uploading Documents on Wall.
|
||||
//
|
||||
// Supported formats: any formats excepting mp3 and executable files.
|
||||
//
|
||||
// Limits: file size up to 200 MB.
|
||||
func (vk *VK) UploadWallDoc(title, tags string, file io.Reader) (response DocsSaveResponse, err error) {
|
||||
uploadServer, err := vk.DocsGetWallUploadServer(nil)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
response, err = vk.uploadDoc(uploadServer.UploadURL, title, tags, file)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UploadGroupWallDoc uploading Documents on Group Wall.
|
||||
//
|
||||
// Supported formats: any formats excepting mp3 and executable files.
|
||||
//
|
||||
// Limits: file size up to 200 MB.
|
||||
func (vk *VK) UploadGroupWallDoc(groupID int, title, tags string, file io.Reader) (
|
||||
response DocsSaveResponse,
|
||||
err error,
|
||||
) {
|
||||
uploadServer, err := vk.DocsGetWallUploadServer(Params{
|
||||
"group_id": groupID,
|
||||
})
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
response, err = vk.uploadDoc(uploadServer.UploadURL, title, tags, file)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UploadMessagesDoc uploading Documents into a Private Message.
|
||||
//
|
||||
// Supported formats: any formats excepting mp3 and executable files.
|
||||
//
|
||||
// Limits: file size up to 200 MB.
|
||||
func (vk *VK) UploadMessagesDoc(peerID int, typeDoc, title, tags string, file io.Reader) (
|
||||
response DocsSaveResponse,
|
||||
err error,
|
||||
) {
|
||||
uploadServer, err := vk.DocsGetMessagesUploadServer(Params{
|
||||
"peer_id": peerID,
|
||||
"type": typeDoc,
|
||||
})
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
response, err = vk.uploadDoc(uploadServer.UploadURL, title, tags, file)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UploadOwnerCoverPhoto uploading a Main Photo to a Group Chat.
|
||||
//
|
||||
// Supported formats: JPG, PNG, GIF.
|
||||
//
|
||||
// Limits: minimum photo size 795x200px, width+height not more than 14000px,
|
||||
// file size up to 50 MB. Recommended size: 1590x400px.
|
||||
func (vk *VK) UploadOwnerCoverPhoto(groupID, cropX, cropY, cropX2, cropY2 int, file io.Reader) (
|
||||
response PhotosSaveOwnerCoverPhotoResponse,
|
||||
err error,
|
||||
) {
|
||||
uploadServer, err := vk.PhotosGetOwnerCoverPhotoUploadServer(Params{
|
||||
"group_id": groupID,
|
||||
"crop_x": cropX,
|
||||
"crop_y": cropY,
|
||||
"crop_x2": cropX2,
|
||||
"crop_y2": cropY2,
|
||||
})
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
bodyContent, err := vk.UploadFile(uploadServer.UploadURL, file, "photo", "photo.jpeg")
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
var handler object.PhotosOwnerUploadResponse
|
||||
|
||||
err = json.Unmarshal(bodyContent, &handler)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
return vk.PhotosSaveOwnerCoverPhoto(Params{
|
||||
"photo": handler.Photo,
|
||||
"hash": handler.Hash,
|
||||
})
|
||||
}
|
||||
|
||||
// UploadStories struct.
|
||||
type UploadStories struct {
|
||||
UploadResult string `json:"upload_result"`
|
||||
Sig string `json:"_sig"`
|
||||
}
|
||||
|
||||
type rawUploadStoriesPhoto struct {
|
||||
Response UploadStories `json:"response"`
|
||||
Error struct {
|
||||
ErrorCode int `json:"error_code"`
|
||||
Type string `json:"type"`
|
||||
} `json:"error"`
|
||||
}
|
||||
|
||||
type rawUploadStoriesVideo struct {
|
||||
Response UploadStories `json:"response"`
|
||||
UploadError
|
||||
}
|
||||
|
||||
// UploadStoriesPhoto uploading Story.
|
||||
//
|
||||
// Supported formats: JPG, PNG, GIF.
|
||||
// Limits: sum of with and height no more than 14000px, file size no
|
||||
// more than 10 MB. Video format: h264 video, aac audio,
|
||||
// maximum 720х1280, 30fps.
|
||||
//
|
||||
// https://vk.com/dev/stories.getPhotoUploadServer
|
||||
func (vk *VK) UploadStoriesPhoto(params Params, file io.Reader) (response StoriesSaveResponse, err error) {
|
||||
uploadServer, err := vk.StoriesGetPhotoUploadServer(params)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
bodyContent, err := vk.UploadFile(uploadServer.UploadURL, file, "file", "file.jpeg")
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
var handler rawUploadStoriesPhoto
|
||||
|
||||
err = json.Unmarshal(bodyContent, &handler)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if handler.Error.ErrorCode != 0 {
|
||||
err = &UploadError{
|
||||
Code: handler.Error.ErrorCode,
|
||||
Err: handler.Error.Type,
|
||||
}
|
||||
|
||||
return response, err
|
||||
}
|
||||
|
||||
response, err = vk.StoriesSave(Params{
|
||||
"upload_results": handler.Response.UploadResult,
|
||||
})
|
||||
|
||||
return response, err
|
||||
}
|
||||
|
||||
// UploadStoriesVideo uploading Story.
|
||||
//
|
||||
// Video format: h264 video, aac audio, maximum 720х1280, 30fps.
|
||||
func (vk *VK) UploadStoriesVideo(params Params, file io.Reader) (response StoriesSaveResponse, err error) {
|
||||
uploadServer, err := vk.StoriesGetVideoUploadServer(params)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
bodyContent, err := vk.UploadFile(uploadServer.UploadURL, file, "video_file", "video.mp4")
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
var handler rawUploadStoriesVideo
|
||||
|
||||
err = json.Unmarshal(bodyContent, &handler)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if handler.UploadError.Code != 0 {
|
||||
return response, &handler.UploadError
|
||||
}
|
||||
|
||||
response, err = vk.StoriesSave(Params{
|
||||
"upload_results": handler.Response.UploadResult,
|
||||
})
|
||||
|
||||
return response, err
|
||||
}
|
||||
|
||||
// uploadPollsPhoto uploading a Poll Photo.
|
||||
//
|
||||
// Supported formats: JPG, PNG, GIF.
|
||||
//
|
||||
// Limits: minimum photo size 795x200px, width+height not more than 14000px,
|
||||
// file size up to 50 MB. Recommended size: 1590x400px.
|
||||
func (vk *VK) uploadPollsPhoto(params Params, file io.Reader) (response PollsSavePhotoResponse, err error) {
|
||||
uploadServer, err := vk.PollsGetPhotoUploadServer(params)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
bodyContent, err := vk.UploadFile(uploadServer.UploadURL, file, "photo", "photo.jpeg")
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
var handler object.PollsPhotoUploadResponse
|
||||
|
||||
err = json.Unmarshal(bodyContent, &handler)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
response, err = vk.PollsSavePhoto(Params{
|
||||
"photo": handler.Photo,
|
||||
"hash": handler.Hash,
|
||||
})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UploadPollsPhoto uploading a Poll Photo.
|
||||
//
|
||||
// Supported formats: JPG, PNG, GIF.
|
||||
//
|
||||
// Limits: minimum photo size 795x200px, width+height not more than 14000px,
|
||||
// file size up to 50 MB. Recommended size: 1590x400px.
|
||||
func (vk *VK) UploadPollsPhoto(file io.Reader) (response PollsSavePhotoResponse, err error) {
|
||||
return vk.uploadPollsPhoto(Params{}, file)
|
||||
}
|
||||
|
||||
// UploadOwnerPollsPhoto uploading a Poll Photo.
|
||||
//
|
||||
// Supported formats: JPG, PNG, GIF.
|
||||
//
|
||||
// Limits: minimum photo size 795x200px, width+height not more than 14000px,
|
||||
// file size up to 50 MB. Recommended size: 1590x400px.
|
||||
func (vk *VK) UploadOwnerPollsPhoto(ownerID int, file io.Reader) (response PollsSavePhotoResponse, err error) {
|
||||
return vk.uploadPollsPhoto(Params{"owner_id": ownerID}, file)
|
||||
}
|
||||
|
||||
type uploadPrettyCardsPhotoHandler struct {
|
||||
Photo string `json:"photo"`
|
||||
ErrCode int `json:"errcode"`
|
||||
}
|
||||
|
||||
// UploadPrettyCardsPhoto uploading a Pretty Card Photo.
|
||||
//
|
||||
// Supported formats: JPG, PNG, GIF.
|
||||
func (vk *VK) UploadPrettyCardsPhoto(file io.Reader) (response string, err error) {
|
||||
uploadURL, err := vk.PrettyCardsGetUploadURL(nil)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
bodyContent, err := vk.UploadFile(uploadURL, file, "file", "photo.jpg")
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
var handler uploadPrettyCardsPhotoHandler
|
||||
|
||||
err = json.Unmarshal(bodyContent, &handler)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
response = handler.Photo
|
||||
|
||||
if handler.ErrCode != 0 {
|
||||
err = &UploadError{Code: handler.ErrCode}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
type uploadLeadFormsPhotoHandler struct {
|
||||
Photo string `json:"photo"`
|
||||
ErrCode int `json:"errcode"`
|
||||
}
|
||||
|
||||
// UploadLeadFormsPhoto uploading a Pretty Card Photo.
|
||||
//
|
||||
// Supported formats: JPG, PNG, GIF.
|
||||
func (vk *VK) UploadLeadFormsPhoto(file io.Reader) (response string, err error) {
|
||||
uploadURL, err := vk.LeadFormsGetUploadURL(nil)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
bodyContent, err := vk.UploadFile(uploadURL, file, "file", "photo.jpg")
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
var handler uploadLeadFormsPhotoHandler
|
||||
|
||||
err = json.Unmarshal(bodyContent, &handler)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
response = handler.Photo
|
||||
|
||||
if handler.ErrCode != 0 {
|
||||
err = &UploadError{Code: handler.ErrCode}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UploadAppImage uploading a Image into App collection for community app widgets.
|
||||
func (vk *VK) UploadAppImage(imageType string, file io.Reader) (response object.AppWidgetsImage, err error) {
|
||||
uploadServer, err := vk.AppWidgetsGetAppImageUploadServer(Params{
|
||||
"image_type": imageType,
|
||||
})
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
bodyContent, err := vk.UploadFile(uploadServer.UploadURL, file, "image", "photo.jpeg")
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
var handler object.AppWidgetsAppImageUploadResponse
|
||||
|
||||
err = json.Unmarshal(bodyContent, &handler)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
response, err = vk.AppWidgetsSaveAppImage(Params{
|
||||
"image": handler.Image,
|
||||
"hash": handler.Hash,
|
||||
})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UploadGroupImage uploading a Image into Community collection for community app widgets.
|
||||
func (vk *VK) UploadGroupImage(imageType string, file io.Reader) (response object.AppWidgetsImage, err error) {
|
||||
uploadServer, err := vk.AppWidgetsGetGroupImageUploadServer(Params{
|
||||
"image_type": imageType,
|
||||
})
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
bodyContent, err := vk.UploadFile(uploadServer.UploadURL, file, "image", "photo.jpeg")
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
var handler object.AppWidgetsGroupImageUploadResponse
|
||||
|
||||
err = json.Unmarshal(bodyContent, &handler)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
response, err = vk.AppWidgetsSaveGroupImage(Params{
|
||||
"image": handler.Image,
|
||||
"hash": handler.Hash,
|
||||
})
|
||||
|
||||
return
|
||||
}
|
||||