Compare commits
	
		
			19 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 8b26e42a3a | ||
|   | acca011f15 | ||
|   | 2f59abdda7 | ||
|   | 17747a5c88 | ||
|   | cec63546ff | ||
|   | 75f67d2de4 | ||
|   | 712385ffd5 | ||
|   | ad90cf09fe | ||
|   | f9928c9e25 | ||
|   | a0741d99b8 | ||
|   | c63f08c811 | ||
|   | 58b6c4d277 | ||
|   | 27c02549c8 | ||
|   | 88d371c71c | ||
|   | b339524613 | ||
|   | d5feda5c8a | ||
|   | 2f506425c2 | ||
|   | e8167ee3d7 | ||
|   | 2f5e211065 | 
							
								
								
									
										2
									
								
								.dockerignore
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								.dockerignore
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,2 @@ | ||||
| Dockerfile | ||||
| tgs.Dockerfile | ||||
| @@ -1,4 +1,4 @@ | ||||
| FROM alpine:edge AS builder | ||||
| FROM alpine AS builder | ||||
|  | ||||
| COPY . /go/src/github.com/42wim/matterbridge | ||||
| RUN apk update && apk add go git gcc musl-dev \ | ||||
| @@ -7,7 +7,7 @@ RUN apk update && apk add go git gcc musl-dev \ | ||||
|         && go get \ | ||||
|         && go build -x -ldflags "-X main.githash=$(git log --pretty=format:'%h' -n 1)" -o /bin/matterbridge | ||||
|  | ||||
| FROM alpine:edge | ||||
| FROM alpine | ||||
| RUN apk --no-cache add ca-certificates mailcap | ||||
| COPY --from=builder /bin/matterbridge /bin/matterbridge | ||||
| RUN mkdir /etc/matterbridge \ | ||||
|   | ||||
							
								
								
									
										65
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										65
									
								
								README.md
									
									
									
									
									
								
							| @@ -146,13 +146,13 @@ Questions or want to test on your favorite platform? Join below: | ||||
|  | ||||
| ## Screenshots | ||||
|  | ||||
| See https://github.com/42wim/matterbridge/wiki | ||||
| See <https://github.com/42wim/matterbridge/wiki> | ||||
|  | ||||
| ## Installing / upgrading | ||||
|  | ||||
| ### Binaries | ||||
|  | ||||
| - Latest stable release [v1.18.1](https://github.com/42wim/matterbridge/releases/latest) | ||||
| - Latest stable release [v1.18.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) and 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. | ||||
| @@ -169,14 +169,13 @@ Most people just want to use binaries, you can find those [here](https://github. | ||||
| If you really want to build from source, follow these instructions: | ||||
| Go 1.12+ is required. Make sure you have [Go](https://golang.org/doc/install) properly installed. | ||||
|  | ||||
|  | ||||
| ``` | ||||
| ```bash | ||||
| go get github.com/42wim/matterbridge | ||||
| ``` | ||||
|  | ||||
| You should now have matterbridge binary in the ~/go/bin directory: | ||||
|  | ||||
| ``` | ||||
| ```bash | ||||
| $ ls ~/go/bin/ | ||||
| matterbridge | ||||
| ``` | ||||
| @@ -259,7 +258,7 @@ RemoteNickFormat="[{PROTOCOL}/{BRIDGE}] <{NICK}> " | ||||
|  | ||||
| See [howto](https://github.com/42wim/matterbridge/wiki/How-to-create-your-config) for a step by step walkthrough for creating your configuration. | ||||
|  | ||||
| ``` | ||||
| ```bash | ||||
| Usage of ./matterbridge: | ||||
|   -conf string | ||||
|         config file (default "matterbridge.toml") | ||||
| @@ -300,15 +299,14 @@ See [FAQ](https://github.com/42wim/matterbridge/wiki/FAQ) | ||||
| ## Articles | ||||
|  | ||||
| - [matterbridge on kubernetes](https://medium.freecodecamp.org/using-kubernetes-to-deploy-a-chat-gateway-or-when-technology-works-like-its-supposed-to-a169a8cd69a3) | ||||
| - https://mattermost.com/blog/connect-irc-to-mattermost/ | ||||
| - https://blog.valvin.fr/2016/09/17/mattermost-et-un-channel-irc-cest-possible/ | ||||
| - https://blog.brightscout.com/top-10-mattermost-integrations/ | ||||
| - http://bencey.co.nz/2018/09/17/bridge/ | ||||
| - https://www.algoo.fr/blog/2018/01/19/recouvrez-votre-liberte-en-quittant-slack-pour-un-mattermost-auto-heberge/ | ||||
| - https://kopano.com/blog/matterbridge-bridging-mattermost-chat/ | ||||
| - https://www.stitcher.com/s/?eid=52382713 | ||||
| - https://daniele.tech/2019/02/how-to-use-matterbridge-to-connect-2-different-slack-workspaces/ | ||||
| - https://userlinux.net/mattermost-and-matterbridge.html | ||||
| - <https://mattermost.com/blog/connect-irc-to-mattermost/> | ||||
| - <https://blog.valvin.fr/2016/09/17/mattermost-et-un-channel-irc-cest-possible/> | ||||
| - <https://blog.brightscout.com/top-10-mattermost-integrations/> | ||||
| - <https://www.algoo.fr/blog/2018/01/19/recouvrez-votre-liberte-en-quittant-slack-pour-un-mattermost-auto-heberge/> | ||||
| - <https://kopano.com/blog/matterbridge-bridging-mattermost-chat/> | ||||
| - <https://www.stitcher.com/s/?eid=52382713> | ||||
| - <https://daniele.tech/2019/02/how-to-use-matterbridge-to-connect-2-different-slack-workspaces/> | ||||
| - <https://userlinux.net/mattermost-and-matterbridge.html> | ||||
|  | ||||
| ## Thanks | ||||
|  | ||||
| @@ -321,24 +319,25 @@ See [FAQ](https://github.com/42wim/matterbridge/wiki/FAQ) | ||||
|  | ||||
| Matterbridge wouldn't exist without these libraries: | ||||
|  | ||||
| - discord - https://github.com/bwmarrin/discordgo | ||||
| - echo - https://github.com/labstack/echo | ||||
| - gitter - https://github.com/sromku/go-gitter | ||||
| - gops - https://github.com/google/gops | ||||
| - gozulipbot - https://github.com/ifo/gozulipbot | ||||
| - irc - https://github.com/lrstanley/girc | ||||
| - keybase - https://github.com/keybase/go-keybase-chat-bot | ||||
| - matrix - https://github.com/matrix-org/gomatrix | ||||
| - mattermost - https://github.com/mattermost/mattermost-server | ||||
| - msgraph.go - https://github.com/yaegashi/msgraph.go | ||||
| - slack - https://github.com/nlopes/slack | ||||
| - sshchat - https://github.com/shazow/ssh-chat | ||||
| - steam - https://github.com/Philipp15b/go-steam | ||||
| - telegram - https://github.com/go-telegram-bot-api/telegram-bot-api | ||||
| - tengo - https://github.com/d5/tengo | ||||
| - whatsapp - https://github.com/Rhymen/go-whatsapp/ | ||||
| - xmpp - https://github.com/mattn/go-xmpp | ||||
| - zulip - https://github.com/ifo/gozulipbot | ||||
| - discord - <https://github.com/bwmarrin/discordgo> | ||||
| - echo - <https://github.com/labstack/echo> | ||||
| - gitter - <https://github.com/sromku/go-gitter> | ||||
| - gops - <https://github.com/google/gops> | ||||
| - gozulipbot - <https://github.com/ifo/gozulipbot> | ||||
| - irc - <https://github.com/lrstanley/girc> | ||||
| - keybase - <https://github.com/keybase/go-keybase-chat-bot> | ||||
| - matrix - <https://github.com/matrix-org/gomatrix> | ||||
| - mattermost - <https://github.com/mattermost/mattermost-server> | ||||
| - msgraph.go - <https://github.com/yaegashi/msgraph.go> | ||||
| - nctalk - <https://github.com/gary-kim/go-nc-talk> | ||||
| - slack - <https://github.com/nlopes/slack> | ||||
| - sshchat - <https://github.com/shazow/ssh-chat> | ||||
| - steam - <https://github.com/Philipp15b/go-steam> | ||||
| - telegram - <https://github.com/go-telegram-bot-api/telegram-bot-api> | ||||
| - tengo - <https://github.com/d5/tengo> | ||||
| - whatsapp - <https://github.com/Rhymen/go-whatsapp> | ||||
| - xmpp - <https://github.com/mattn/go-xmpp> | ||||
| - zulip - <https://github.com/ifo/gozulipbot> | ||||
|  | ||||
| <!-- Links --> | ||||
|  | ||||
|   | ||||
| @@ -6,9 +6,10 @@ import ( | ||||
| 	"sync" | ||||
| 	"time" | ||||
|  | ||||
| 	"gopkg.in/olahol/melody.v1" | ||||
|  | ||||
| 	"github.com/42wim/matterbridge/bridge" | ||||
| 	"github.com/42wim/matterbridge/bridge/config" | ||||
| 	"github.com/gorilla/websocket" | ||||
| 	"github.com/labstack/echo/v4" | ||||
| 	"github.com/labstack/echo/v4/middleware" | ||||
| 	ring "github.com/zfjagann/golang-ring" | ||||
| @@ -18,6 +19,7 @@ type API struct { | ||||
| 	Messages ring.Ring | ||||
| 	sync.RWMutex | ||||
| 	*bridge.Config | ||||
| 	mrouter *melody.Melody | ||||
| } | ||||
|  | ||||
| type Message struct { | ||||
| @@ -33,6 +35,32 @@ func New(cfg *bridge.Config) bridge.Bridger { | ||||
| 	e := echo.New() | ||||
| 	e.HideBanner = true | ||||
| 	e.HidePort = true | ||||
|  | ||||
| 	b.mrouter = melody.New() | ||||
| 	b.mrouter.HandleMessage(func(s *melody.Session, msg []byte) { | ||||
| 		message := config.Message{} | ||||
| 		err := json.Unmarshal(msg, &message) | ||||
| 		if err != nil { | ||||
| 			b.Log.Errorf("failed to decode message from byte[] '%s'", string(msg)) | ||||
| 			return | ||||
| 		} | ||||
| 		b.handleWebsocketMessage(message, s) | ||||
| 	}) | ||||
| 	b.mrouter.HandleConnect(func(session *melody.Session) { | ||||
| 		greet := b.getGreeting() | ||||
| 		data, err := json.Marshal(greet) | ||||
| 		if err != nil { | ||||
| 			b.Log.Errorf("failed to encode message '%v'", greet) | ||||
| 			return | ||||
| 		} | ||||
| 		err = session.Write(data) | ||||
| 		if err != nil { | ||||
| 			b.Log.Errorf("failed to write message '%s'", string(data)) | ||||
| 			return | ||||
| 		} | ||||
| 		// TODO: send message history buffer from `b.Messages` here | ||||
| 	}) | ||||
|  | ||||
| 	b.Messages = ring.Ring{} | ||||
| 	if b.GetInt("Buffer") != 0 { | ||||
| 		b.Messages.SetCapacity(b.GetInt("Buffer")) | ||||
| @@ -67,13 +95,13 @@ func New(cfg *bridge.Config) bridge.Bridger { | ||||
| func (b *API) Connect() error { | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func (b *API) Disconnect() error { | ||||
| 	return nil | ||||
|  | ||||
| } | ||||
|  | ||||
| func (b *API) JoinChannel(channel config.ChannelInfo) error { | ||||
| 	return nil | ||||
|  | ||||
| } | ||||
|  | ||||
| func (b *API) Send(msg config.Message) (string, error) { | ||||
| @@ -83,7 +111,14 @@ func (b *API) Send(msg config.Message) (string, error) { | ||||
| 	if msg.Event == config.EventMsgDelete { | ||||
| 		return "", nil | ||||
| 	} | ||||
| 	b.Messages.Enqueue(&msg) | ||||
| 	b.Log.Debugf("enqueueing message from %s on ring buffer", msg.Username) | ||||
| 	b.Messages.Enqueue(msg) | ||||
|  | ||||
| 	data, err := json.Marshal(msg) | ||||
| 	if err != nil { | ||||
| 		b.Log.Errorf("failed to encode message  '%s'", msg) | ||||
| 	} | ||||
| 	_ = b.mrouter.Broadcast(data) | ||||
| 	return "", nil | ||||
| } | ||||
|  | ||||
| @@ -131,6 +166,7 @@ func (b *API) handleStream(c echo.Context) error { | ||||
| 	} | ||||
| 	c.Response().Flush() | ||||
| 	for { | ||||
| 		// TODO: this causes issues, messages should be broadcasted to all connected clients | ||||
| 		msg := b.Messages.Dequeue() | ||||
| 		if msg != nil { | ||||
| 			if err := json.NewEncoder(c.Response()).Encode(msg); err != nil { | ||||
| @@ -142,51 +178,30 @@ func (b *API) handleStream(c echo.Context) error { | ||||
| 	} | ||||
| } | ||||
|  | ||||
| func (b *API) handleWebsocketMessage(message config.Message) { | ||||
| func (b *API) handleWebsocketMessage(message config.Message, s *melody.Session) { | ||||
| 	message.Channel = "api" | ||||
| 	message.Protocol = "api" | ||||
| 	message.Account = b.Account | ||||
| 	message.ID = "" | ||||
| 	message.Timestamp = time.Now() | ||||
|  | ||||
| 	data, err := json.Marshal(message) | ||||
| 	if err != nil { | ||||
| 		b.Log.Errorf("failed to encode message for loopback '%v'", message) | ||||
| 		return | ||||
| 	} | ||||
| 	_ = b.mrouter.BroadcastOthers(data, s) | ||||
|  | ||||
| 	b.Log.Debugf("Sending websocket message from %s on %s to gateway", message.Username, "api") | ||||
| 	b.Remote <- message | ||||
| } | ||||
|  | ||||
| func (b *API) writePump(conn *websocket.Conn) { | ||||
| 	for { | ||||
| 		msg := b.Messages.Dequeue() | ||||
| 		if msg != nil { | ||||
| 			err := conn.WriteJSON(msg) | ||||
| 			if err != nil { | ||||
| 				break | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
|  | ||||
| func (b *API) readPump(conn *websocket.Conn) { | ||||
| 	for { | ||||
| 		message := config.Message{} | ||||
| 		err := conn.ReadJSON(&message) | ||||
| 		if err != nil { | ||||
| 			break | ||||
| 		} | ||||
| 		b.handleWebsocketMessage(message) | ||||
| 	} | ||||
| } | ||||
|  | ||||
| func (b *API) handleWebsocket(c echo.Context) error { | ||||
| 	conn, err := websocket.Upgrade(c.Response().Writer, c.Request(), nil, 1024, 1024) | ||||
| 	err := b.mrouter.HandleRequest(c.Response(), c.Request()) | ||||
| 	if err != nil { | ||||
| 		b.Log.Errorf("error in websocket handling  '%v'", err) | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	greet := b.getGreeting() | ||||
| 	_ = conn.WriteJSON(greet) | ||||
|  | ||||
| 	go b.writePump(conn) | ||||
| 	go b.readPump(conn) | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|   | ||||
| @@ -14,7 +14,7 @@ import ( | ||||
| 	"github.com/42wim/matterbridge/bridge" | ||||
| 	"github.com/42wim/matterbridge/bridge/config" | ||||
| 	"github.com/42wim/matterbridge/bridge/helper" | ||||
| 	matrix "github.com/matterbridge/gomatrix" | ||||
| 	matrix "github.com/matrix-org/gomatrix" | ||||
| ) | ||||
|  | ||||
| type Bmatrix struct { | ||||
| @@ -49,9 +49,10 @@ func (b *Bmatrix) Connect() error { | ||||
| 		return err | ||||
| 	} | ||||
| 	resp, err := b.mc.Login(&matrix.ReqLogin{ | ||||
| 		Type:     "m.login.password", | ||||
| 		User:     b.GetString("Login"), | ||||
| 		Password: b.GetString("Password"), | ||||
| 		Type:       "m.login.password", | ||||
| 		User:       b.GetString("Login"), | ||||
| 		Password:   b.GetString("Password"), | ||||
| 		Identifier: matrix.NewUserIdentifier(b.GetString("Login")), | ||||
| 	}) | ||||
| 	if err != nil { | ||||
| 		return err | ||||
| @@ -166,7 +167,7 @@ func (b *Bmatrix) Send(msg config.Message) (string, error) { | ||||
| 	} | ||||
|  | ||||
| 	// Post normal message with HTML support (eg riot.im) | ||||
| 	resp, err := b.mc.SendHTML(channel, plainUsername+msg.Text, username+helper.ParseMarkdown(msg.Text)) | ||||
| 	resp, err := b.mc.SendFormattedText(channel, plainUsername+msg.Text, username+helper.ParseMarkdown(msg.Text)) | ||||
| 	if err != nil { | ||||
| 		return "", err | ||||
| 	} | ||||
| @@ -370,13 +371,29 @@ func (b *Bmatrix) handleUploadFile(msg *config.Message, channel string, fi *conf | ||||
| 		} | ||||
| 	case strings.Contains(mtype, "application"): | ||||
| 		b.Log.Debugf("sendFile %s", res.ContentURI) | ||||
| 		_, err = b.mc.SendFile(channel, fi.Name, res.ContentURI, mtype, uint(len(*fi.Data))) | ||||
| 		_, err = b.mc.SendMessageEvent(channel, "m.room.message", matrix.FileMessage{ | ||||
| 			MsgType: "m.file", | ||||
| 			Body:    fi.Name, | ||||
| 			URL:     res.ContentURI, | ||||
| 			Info: matrix.FileInfo{ | ||||
| 				Mimetype: mtype, | ||||
| 				Size:     uint(len(*fi.Data)), | ||||
| 			}, | ||||
| 		}) | ||||
| 		if err != nil { | ||||
| 			b.Log.Errorf("sendFile failed: %#v", err) | ||||
| 		} | ||||
| 	case strings.Contains(mtype, "audio"): | ||||
| 		b.Log.Debugf("sendAudio %s", res.ContentURI) | ||||
| 		_, err = b.mc.SendAudio(channel, fi.Name, res.ContentURI, mtype, uint(len(*fi.Data))) | ||||
| 		_, err = b.mc.SendMessageEvent(channel, "m.room.message", matrix.AudioMessage{ | ||||
| 			MsgType: "m.audio", | ||||
| 			Body:    fi.Name, | ||||
| 			URL:     res.ContentURI, | ||||
| 			Info: matrix.AudioInfo{ | ||||
| 				Mimetype: mtype, | ||||
| 				Size:     uint(len(*fi.Data)), | ||||
| 			}, | ||||
| 		}) | ||||
| 		if err != nil { | ||||
| 			b.Log.Errorf("sendAudio failed: %#v", err) | ||||
| 		} | ||||
| @@ -402,12 +419,18 @@ func (b *Bmatrix) containsAttachment(content map[string]interface{}) bool { | ||||
|  | ||||
| // getAvatarURL returns the avatar URL of the specified sender | ||||
| func (b *Bmatrix) getAvatarURL(sender string) string { | ||||
| 	mxcURL, err := b.mc.GetSenderAvatarURL(sender) | ||||
| 	urlPath := b.mc.BuildURL("profile", sender, "avatar_url") | ||||
|  | ||||
| 	s := struct { | ||||
| 		AvatarURL string `json:"avatar_url"` | ||||
| 	}{} | ||||
|  | ||||
| 	err := b.mc.MakeRequest("GET", urlPath, nil, &s) | ||||
| 	if err != nil { | ||||
| 		b.Log.Errorf("getAvatarURL failed: %s", err) | ||||
| 		return "" | ||||
| 	} | ||||
| 	url := strings.ReplaceAll(mxcURL, "mxc://", b.GetString("Server")+"/_matrix/media/r0/thumbnail/") | ||||
| 	url := strings.ReplaceAll(s.AvatarURL, "mxc://", b.GetString("Server")+"/_matrix/media/r0/thumbnail/") | ||||
| 	if url != "" { | ||||
| 		url += "?width=37&height=37&method=crop" | ||||
| 	} | ||||
|   | ||||
| @@ -2,7 +2,9 @@ package nctalk | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"crypto/tls" | ||||
| 	"strconv" | ||||
| 	"strings" | ||||
|  | ||||
| 	"github.com/42wim/matterbridge/bridge" | ||||
| 	"github.com/42wim/matterbridge/bridge/config" | ||||
| @@ -31,8 +33,18 @@ type Broom struct { | ||||
|  | ||||
| func (b *Btalk) Connect() error { | ||||
| 	b.Log.Info("Connecting") | ||||
| 	b.user = talk.NewUser(b.GetString("Server"), b.GetString("Login"), b.GetString("Password")) | ||||
| 	_, err := b.user.Capabilities() | ||||
| 	tconfig := &user.TalkUserConfig{ | ||||
| 		TLSConfig: &tls.Config{ | ||||
| 			InsecureSkipVerify: b.GetBool("SkipTLSVerify"), //nolint:gosec | ||||
| 		}, | ||||
| 	} | ||||
| 	var err error | ||||
| 	b.user, err = user.NewUser(b.GetString("Server"), b.GetString("Login"), b.GetString("Password"), tconfig) | ||||
| 	if err != nil { | ||||
| 		b.Log.Error("Config could not be used") | ||||
| 		return err | ||||
| 	} | ||||
| 	_, err = b.user.Capabilities() | ||||
| 	if err != nil { | ||||
| 		b.Log.Error("Cannot Connect") | ||||
| 		return err | ||||
| @@ -67,7 +79,7 @@ func (b *Btalk) JoinChannel(channel config.ChannelInfo) error { | ||||
| 				continue | ||||
| 			} | ||||
| 			remoteMessage := config.Message{ | ||||
| 				Text:     msg.Message, | ||||
| 				Text:     formatRichObjectString(msg.Message, msg.MessageParameters), | ||||
| 				Channel:  newRoom.room.Token, | ||||
| 				Username: msg.ActorDisplayName, | ||||
| 				UserID:   msg.ActorID, | ||||
| @@ -112,3 +124,23 @@ func (b *Btalk) getRoom(token string) *Broom { | ||||
| 	} | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| // 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 { | ||||
| 		text := parameter.Name | ||||
|  | ||||
| 		switch parameter.Type { | ||||
| 		case ocs.ROSTypeUser, ocs.ROSTypeGroup: | ||||
| 			text = "@" + text | ||||
| 		case ocs.ROSTypeFile: | ||||
| 			if parameter.Link != "" { | ||||
| 				text = parameter.Link | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 		message = strings.ReplaceAll(message, "{"+id+"}", text) | ||||
| 	} | ||||
|  | ||||
| 	return message | ||||
| } | ||||
|   | ||||
| @@ -78,7 +78,7 @@ func (b *Bwhatsapp) HandleTextMessage(message whatsapp.TextMessage) { | ||||
| 	senderJID := message.Info.SenderJid | ||||
| 	if len(senderJID) == 0 { | ||||
| 		// TODO workaround till https://github.com/Rhymen/go-whatsapp/issues/86 resolved | ||||
| 		if message.Info.Source != nil { | ||||
| 		if message.Info.Source != nil && message.Info.Source.Participant != nil { | ||||
| 			senderJID = *message.Info.Source.Participant | ||||
| 		} | ||||
| 	} | ||||
|   | ||||
| @@ -184,7 +184,7 @@ func (b *Bwhatsapp) Disconnect() error { | ||||
| } | ||||
|  | ||||
| func isGroupJid(identifier string) bool { | ||||
| 	return strings.HasSuffix(identifier, "@g.us") || strings.HasSuffix(identifier, "@temp") | ||||
| 	return strings.HasSuffix(identifier, "@g.us") || strings.HasSuffix(identifier, "@temp") || strings.HasSuffix(identifier, "@broadcast") | ||||
| } | ||||
|  | ||||
| // JoinChannel Join a WhatsApp group specified in gateway config as channel='number-id@g.us' or channel='Channel name' | ||||
|   | ||||
| @@ -135,19 +135,25 @@ func (b *Bzulip) handleQueue() error { | ||||
| 			if m.SenderEmail == b.GetString("login") { | ||||
| 				continue | ||||
| 			} | ||||
|  | ||||
| 			avatarURL := m.AvatarURL | ||||
| 			if !strings.HasPrefix(avatarURL, "http") { | ||||
| 				avatarURL = b.GetString("server") + avatarURL | ||||
| 			} | ||||
|  | ||||
| 			rmsg := config.Message{ | ||||
| 				Username: m.SenderFullName, | ||||
| 				Text:     m.Content, | ||||
| 				Channel:  b.getChannel(m.StreamID) + "/topic:" + m.Subject, | ||||
| 				Account:  b.Account, | ||||
| 				UserID:   strconv.Itoa(m.SenderID), | ||||
| 				Avatar:   m.AvatarURL, | ||||
| 				Avatar:   avatarURL, | ||||
| 			} | ||||
| 			b.Log.Debugf("<= Sending message from %s on %s to gateway", rmsg.Username, b.Account) | ||||
| 			b.Log.Debugf("<= Message is %#v", rmsg) | ||||
| 			b.Remote <- rmsg | ||||
| 			b.q.LastEventID = m.ID | ||||
| 		} | ||||
|  | ||||
| 		time.Sleep(time.Second * 3) | ||||
| 	} | ||||
| } | ||||
|   | ||||
							
								
								
									
										30
									
								
								changelog.md
									
									
									
									
									
								
							
							
						
						
									
										30
									
								
								changelog.md
									
									
									
									
									
								
							| @@ -1,3 +1,33 @@ | ||||
| # v1.18.3 | ||||
|  | ||||
| ## Enhancements | ||||
|  | ||||
| - nctalk: Add TLSConfig to nctalk (#1195) | ||||
| - whatsapp: Handle broadcasts as groups in Whatsapp #1213 | ||||
| - matrix: switch to upstream gomatrix #1219 | ||||
| - api: support multiple websocket clients #1205 | ||||
|  | ||||
| ## Bugfix | ||||
|  | ||||
| - general: update vendor | ||||
| - zulip: Check location of avatarURL (zulip). Fixes #1214 (#1227) | ||||
| - nctalk: Fix issue with too many open files #1223 | ||||
| - nctalk: Fix mentions #1222 | ||||
| - nctalk: Fix message replays #1220 | ||||
|  | ||||
| This release couldn't exist without the following contributors: | ||||
| @gary-kim, @tilosp, @NikkyAI, @escoand, @42wim | ||||
|  | ||||
| # v1.18.2 | ||||
|  | ||||
| ## Bugfix | ||||
|  | ||||
| - zulip: Fix error loop (zulip) (#1210) | ||||
| - whatsapp: Update whatsapp vendor and fix a panic (#1209) | ||||
|  | ||||
| This release couldn't exist without the following contributors: | ||||
| @SuperSandro2000, @42wim | ||||
|  | ||||
| # v1.18.1 | ||||
|  | ||||
| ## New features | ||||
|   | ||||
							
								
								
									
										29
									
								
								go.mod
									
									
									
									
									
								
							
							
						
						
									
										29
									
								
								go.mod
									
									
									
									
									
								
							| @@ -5,26 +5,26 @@ require ( | ||||
| 	github.com/Baozisoftware/qrcode-terminal-go v0.0.0-20170407111555-c0650d8dff0f | ||||
| 	github.com/Jeffail/gabs v1.1.1 // indirect | ||||
| 	github.com/Philipp15b/go-steam v1.0.1-0.20190816133340-b04c5a83c1c0 | ||||
| 	github.com/Rhymen/go-whatsapp v0.1.1-0.20200421062035-31e8111ac334 | ||||
| 	github.com/Rhymen/go-whatsapp v0.1.1-0.20200818115958-f07a700b9819 | ||||
| 	github.com/d5/tengo/v2 v2.6.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-20200609195525-3f9352745725 | ||||
| 	github.com/google/gops v0.3.10 | ||||
| 	github.com/gomarkdown/markdown v0.0.0-20200824053859-8c8b3816f167 | ||||
| 	github.com/google/gops v0.3.11 | ||||
| 	github.com/gopackage/ddp v0.0.0-20170117053602-652027933df4 // indirect | ||||
| 	github.com/gorilla/schema v1.1.0 | ||||
| 	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.16 | ||||
| 	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-20200411204219-d5c18ce75048 | ||||
| 	github.com/matterbridge/discordgo v0.21.2-0.20200718144317-01fe5db6c78d | ||||
| 	github.com/matterbridge/discordgo v0.22.0 | ||||
| 	github.com/matterbridge/emoji v2.1.1-0.20191117213217-af507f6b02db+incompatible | ||||
| 	github.com/matterbridge/go-xmpp v0.0.0-20200418225040-c8a3a57b4050 | ||||
| 	github.com/matterbridge/gomatrix v0.0.0-20200209224845-c2104d7936a6 | ||||
| 	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.25.2 | ||||
| @@ -40,16 +40,17 @@ require ( | ||||
| 	github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca | ||||
| 	github.com/shazow/ssh-chat v1.8.3-0.20200308224626-80ddf1f43a98 | ||||
| 	github.com/sirupsen/logrus v1.6.0 | ||||
| 	github.com/slack-go/slack v0.6.5 | ||||
| 	github.com/spf13/viper v1.7.0 | ||||
| 	github.com/stretchr/testify v1.5.1 | ||||
| 	github.com/slack-go/slack v0.6.6 | ||||
| 	github.com/spf13/viper v1.7.1 | ||||
| 	github.com/stretchr/testify v1.6.1 | ||||
| 	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.3 | ||||
| 	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-20200618115811-c13761719519 | ||||
| 	golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d | ||||
| 	gomod.garykim.dev/nc-talk v0.0.2 | ||||
| 	golang.org/x/image v0.0.0-20200801110659-972c09e46d76 | ||||
| 	golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 | ||||
| 	gomod.garykim.dev/nc-talk v0.1.3 | ||||
| 	gopkg.in/olahol/melody.v1 v1.0.0-20170518105555-d52139073376 | ||||
| ) | ||||
|  | ||||
| go 1.13 | ||||
|   | ||||
							
								
								
									
										242
									
								
								go.sum
									
									
									
									
									
								
							
							
						
						
									
										242
									
								
								go.sum
									
									
									
									
									
								
							| @@ -8,11 +8,32 @@ cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6A | ||||
| cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= | ||||
| cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= | ||||
| cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= | ||||
| cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= | ||||
| cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= | ||||
| cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= | ||||
| cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= | ||||
| cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= | ||||
| 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/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= | ||||
| cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= | ||||
| cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= | ||||
| cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= | ||||
| cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= | ||||
| cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= | ||||
| cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= | ||||
| cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= | ||||
| cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= | ||||
| cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= | ||||
| cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= | ||||
| cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= | ||||
| cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= | ||||
| cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= | ||||
| cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= | ||||
| cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= | ||||
| contrib.go.opencensus.io/exporter/ocagent v0.4.9/go.mod h1:ueLzZcP7LPhPulEBukGn4aLh7Mx9YJwpVJ9nL2FYltw= | ||||
| dmitri.shuralyov.com/app/changes v0.0.0-20180602232624-0a106ad413e3/go.mod h1:Yl+fi1br7+Rr3LqpNJf1/uxUdtRUV+Tnj0o93V2B9MU= | ||||
| dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= | ||||
| @@ -43,8 +64,8 @@ github.com/PaulARoy/azurestoragecache v0.0.0-20170906084534-3c249a3ba788/go.mod | ||||
| github.com/Philipp15b/go-steam v1.0.1-0.20190816133340-b04c5a83c1c0 h1:TO7d4rocnNFng6ZQrPe7U6WqHtK5eHEMrgrnnM/72IQ= | ||||
| github.com/Philipp15b/go-steam v1.0.1-0.20190816133340-b04c5a83c1c0/go.mod h1:HuVM+sZFzumUdKPWiz+IlCMb4RdsKdT3T+nQBKL+sYg= | ||||
| github.com/Rhymen/go-whatsapp v0.0.0/go.mod h1:rdQr95g2C1xcOfM7QGOhza58HeI3I+tZ/bbluv7VazA= | ||||
| github.com/Rhymen/go-whatsapp v0.1.1-0.20200421062035-31e8111ac334 h1:kb1zvD+xd+XbPUdQ0lMxnRaQ76N5C9vMAClLi8Dyw1Y= | ||||
| github.com/Rhymen/go-whatsapp v0.1.1-0.20200421062035-31e8111ac334/go.mod h1:o7jjkvKnigfu432dMbQ/w4PH0Yp5u4Y6ysCNjUlcYCk= | ||||
| github.com/Rhymen/go-whatsapp v0.1.1-0.20200818115958-f07a700b9819 h1:LthbEFUDcL9ZSRIs9m9JjThBSKrW6aIj8YGIT7G/SSk= | ||||
| github.com/Rhymen/go-whatsapp v0.1.1-0.20200818115958-f07a700b9819/go.mod h1:o7jjkvKnigfu432dMbQ/w4PH0Yp5u4Y6ysCNjUlcYCk= | ||||
| github.com/Rhymen/go-whatsapp/examples/echo v0.0.0-20190325075644-cc2581bbf24d/go.mod h1:zgCiQtBtZ4P4gFWvwl9aashsdwOcbb/EHOGRmSzM8ME= | ||||
| github.com/Rhymen/go-whatsapp/examples/restoreSession v0.0.0-20190325075644-cc2581bbf24d/go.mod h1:5sCUSpG616ZoSJhlt9iBNI/KXBqrVLcNUJqg7J9+8pU= | ||||
| github.com/Rhymen/go-whatsapp/examples/sendImage v0.0.0-20190325075644-cc2581bbf24d/go.mod h1:RdiyhanVEGXTam+mZ3k6Y3VDCCvXYCwReOoxGozqhHw= | ||||
| @@ -53,6 +74,7 @@ github.com/RoaringBitmap/roaring v0.4.21/go.mod h1:D0gp8kJQgE1A4LQ5wFLggQEyvDi06 | ||||
| github.com/RoaringBitmap/roaring v0.4.23/go.mod h1:D0gp8kJQgE1A4LQ5wFLggQEyvDi06Mq5mKs52e1TwOo= | ||||
| 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/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= | ||||
| github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= | ||||
| @@ -91,6 +113,9 @@ github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA | ||||
| github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= | ||||
| github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= | ||||
| github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= | ||||
| github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= | ||||
| github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= | ||||
| github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= | ||||
| github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= | ||||
| github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= | ||||
| github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= | ||||
| @@ -161,11 +186,14 @@ github.com/go-asn1-ber/asn1-ber v1.4.1 h1:qP/QDxOtmMoJVgXHCXNzDpA0+wkgYB2x5QoLMV | ||||
| github.com/go-asn1-ber/asn1-ber v1.4.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0= | ||||
| github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= | ||||
| github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= | ||||
| github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= | ||||
| github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= | ||||
| github.com/go-gorp/gorp v2.0.0+incompatible/go.mod h1:7IfkAQnO7jfT/9IQ3R9wL1dFhukN6aQxzKTHnkxzA/E= | ||||
| github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= | ||||
| github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= | ||||
| github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= | ||||
| github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= | ||||
| 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-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= | ||||
| github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= | ||||
| @@ -180,10 +208,17 @@ github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zV | ||||
| 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-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= | ||||
| github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= | ||||
| github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= | ||||
| github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= | ||||
| github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= | ||||
| github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= | ||||
| github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= | ||||
| github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= | ||||
| github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= | ||||
| 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/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= | ||||
| github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= | ||||
| github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= | ||||
| @@ -191,17 +226,19 @@ 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= | ||||
| github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= | ||||
| github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= | ||||
| github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= | ||||
| 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/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/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/gomarkdown/markdown v0.0.0-20200609195525-3f9352745725 h1:X6sZdr+t2E2jwajTy/FfXbmAKPFTYxEq9hiFgzMiuPQ= | ||||
| github.com/gomarkdown/markdown v0.0.0-20200609195525-3f9352745725/go.mod h1:aii0r/K0ZnHv7G0KF7xy1v0A7s2Ljrb5byB7MO5p6TU= | ||||
| github.com/gomarkdown/markdown v0.0.0-20200824053859-8c8b3816f167 h1:LP/6EfrZ/LyCc+SXvANDrIJ4sP9u2NAtqyv6QknetNQ= | ||||
| github.com/gomarkdown/markdown v0.0.0-20200824053859-8c8b3816f167/go.mod h1:aii0r/K0ZnHv7G0KF7xy1v0A7s2Ljrb5byB7MO5p6TU= | ||||
| 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= | ||||
| github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= | ||||
| @@ -210,14 +247,24 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw | ||||
| 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-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.10 h1:M2XZYgfUW+P7AOCLiu4CRb0rQfwnslLyB4B9Mp0vXmE= | ||||
| github.com/google/gops v0.3.10/go.mod h1:38bMPVKFh+1X106CPpbLAWtZIR1+xwgzT9gew0kn6w4= | ||||
| github.com/google/gops v0.3.11 h1:TJThjZOyavVoT7C+tkjLMzcUGud9WiWHKPLRCcd2Sro= | ||||
| github.com/google/gops v0.3.11/go.mod h1:38bMPVKFh+1X106CPpbLAWtZIR1+xwgzT9gew0kn6w4= | ||||
| 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/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= | ||||
| github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= | ||||
| 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/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= | ||||
| @@ -238,6 +285,8 @@ github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2z | ||||
| github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= | ||||
| github.com/gorilla/schema v1.1.0 h1:CamqUDOFUBqzrvxuz2vEwo8+SUdwsluFh7IlzJh30LY= | ||||
| github.com/gorilla/schema v1.1.0/go.mod h1:kgLaKoK1FELgZqMAVxx/5cbj0kT+57qxUrAlIO2eleU= | ||||
| 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 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= | ||||
| @@ -291,6 +340,7 @@ github.com/hashicorp/yamux v0.0.0-20190923154419-df201c70410d/go.mod h1:+NfK9FKe | ||||
| github.com/howeyc/gopass v0.0.0-20170109162249-bf9dde6d0d2c/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/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= | ||||
| github.com/icrowley/fake v0.0.0-20180203215853-4178557ae428/go.mod h1:uhpZMVGznybq1itEKXj6RYw9I71qK4kH+OGMjRC4KEo= | ||||
| github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= | ||||
| github.com/jamiealquiza/envy v1.1.0/go.mod h1:MP36BriGCLwEHhi1OU8E9569JNZrjWfCvzG7RsPnHus= | ||||
| @@ -307,11 +357,13 @@ github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX | ||||
| github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= | ||||
| github.com/json-iterator/go v1.1.9/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= | ||||
| github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= | ||||
| github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= | ||||
| 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/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= | ||||
| @@ -327,8 +379,8 @@ 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/labstack/echo/v4 v4.1.16 h1:8swiwjE5Jkai3RPfZoahp8kjVCRNq+y7Q0hPji2Kz0o= | ||||
| github.com/labstack/echo/v4 v4.1.16/go.mod h1:awO+5TzAjvL8XpibdsfXxPgHr+orhtXZJZIQCVjogKI= | ||||
| 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/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= | ||||
| @@ -344,16 +396,16 @@ github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czP | ||||
| github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= | ||||
| github.com/mailru/easyjson v0.7.1/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= | ||||
| 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-20200411204219-d5c18ce75048 h1:B9HaistmV+MD8/33BXmZe1zPIn+RImAFVXNNSOrwU2E= | ||||
| github.com/matterbridge/Rocket.Chat.Go.SDK v0.0.0-20200411204219-d5c18ce75048/go.mod h1:c6MxwqHD+0HvtAJjsHMIdPCiAwGiQwPRPTp69ACMg8A= | ||||
| github.com/matterbridge/discordgo v0.21.2-0.20200718144317-01fe5db6c78d h1:NBckP4nw7qVspbt7cOZYsrOrEbq7tATdMjSjc1hW63A= | ||||
| github.com/matterbridge/discordgo v0.21.2-0.20200718144317-01fe5db6c78d/go.mod h1:411nZYv0UMMrtppR5glXop1foboJiFAowy+42U+Ahvw= | ||||
| github.com/matterbridge/discordgo v0.22.0 h1:6EnYacrU28X5Bc6BQDOqR6O8/b+588RKqoQJPUXEJAw= | ||||
| github.com/matterbridge/discordgo v0.22.0/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/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/gomatrix v0.0.0-20200209224845-c2104d7936a6 h1:Kl65VJv38HjYFnnwH+MP6Z8hcJT5UHuSpHVU5vW1HH0= | ||||
| github.com/matterbridge/gomatrix v0.0.0-20200209224845-c2104d7936a6/go.mod h1:+jWeaaUtXQbBRdKYWfjW6JDDYiI2XXE+3NnTjW5kg8g= | ||||
| github.com/matterbridge/gozulipbot v0.0.0-20200820220548-be5824faa913 h1:5UGr9fLsvAvhjP6i5XJmd0ZIwYVR2gZCzU1lJZ7wfLY= | ||||
| github.com/matterbridge/gozulipbot v0.0.0-20200820220548-be5824faa913/go.mod h1:yAjnZ34DuDyPHMPHHjOsTk/FefW4JJjoMMCGt/8uuQA= | ||||
| github.com/matterbridge/logrus-prefixed-formatter v0.5.3-0.20200523233437-d971309a77ba h1:XleOY4IjAEIcxAh+IFwT5JT5Ze3RHiYz6m+4ZfZ0rc0= | ||||
| @@ -374,6 +426,8 @@ github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVc | ||||
| github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= | ||||
| github.com/mattn/go-colorable v0.1.6 h1:6Su7aK7lXmJ/U79bYtBjLNaha4Fs1Rg9plHpcH+vvnE= | ||||
| github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= | ||||
| 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-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= | ||||
| github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= | ||||
| github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= | ||||
| @@ -420,8 +474,8 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJ | ||||
| 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= | ||||
| github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= | ||||
| github.com/monaco-io/request v1.0.3 h1:FsiIwXCCbHEyWx9A7lgg6JBTMHhHlEEsADsgAOvZ9HA= | ||||
| github.com/monaco-io/request v1.0.3/go.mod h1:EmggwHktBsbJmCgwZXqy7o0H1NNsAstQBWZrFVd3xtQ= | ||||
| github.com/monaco-io/request v1.0.4 h1:AbogA+IvPOWqyGZIFU7kSb8YS2Jv5Dnl5ncMj8cQV+o= | ||||
| github.com/monaco-io/request v1.0.4/go.mod h1:EmggwHktBsbJmCgwZXqy7o0H1NNsAstQBWZrFVd3xtQ= | ||||
| 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/mrexodia/wray v0.0.0-20160318003008-78a2c1f284ff h1:HLGD5/9UxxfEuO9DtP8gnTmNtMxbPyhYltfxsITel8g= | ||||
| @@ -533,6 +587,7 @@ github.com/shazow/rateio v0.0.0-20150116013248-e8e00881e5c1 h1:Lx3BlDGFElJt4u/zK | ||||
| github.com/shazow/rateio v0.0.0-20150116013248-e8e00881e5c1/go.mod h1:vt2jWY/3Qw1bIzle5thrJWucsLuuX9iUNnp20CqCciI= | ||||
| github.com/shazow/ssh-chat v1.8.3-0.20200308224626-80ddf1f43a98 h1:sN07ff+PSRsUNhpSod4uGKAQ+Nc0FXsBPG9FmYMNg4w= | ||||
| github.com/shazow/ssh-chat v1.8.3-0.20200308224626-80ddf1f43a98/go.mod h1:xkTgfD+WP+KR4HuG76oal25BBEeu5kJyi2EOsgiu/4Q= | ||||
| 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/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= | ||||
| @@ -564,8 +619,8 @@ github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I | ||||
| github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= | ||||
| github.com/skip2/go-qrcode v0.0.0-20190110000554-dc11ecdae0a9 h1:lpEzuenPuO1XNTeikEmvqYFcU37GVLl8SRNblzyvGBE= | ||||
| github.com/skip2/go-qrcode v0.0.0-20190110000554-dc11ecdae0a9/go.mod h1:PLPIyL7ikehBD1OAjmKKiOEhbvWyHGaNDjquXMcYABo= | ||||
| github.com/slack-go/slack v0.6.5 h1:IkDKtJ2IROJNoe3d6mW870/NRKvq2fhLB/Q5XmzWk00= | ||||
| github.com/slack-go/slack v0.6.5/go.mod h1:FGqNzJBmxIsZURAxh2a8D21AnOVvvXZvGligs4npPUM= | ||||
| github.com/slack-go/slack v0.6.6 h1:ln0fO794CudStSJEfhZ08Ok5JanMjvW6/k2xBuHqedU= | ||||
| github.com/slack-go/slack v0.6.6/go.mod h1:FGqNzJBmxIsZURAxh2a8D21AnOVvvXZvGligs4npPUM= | ||||
| github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= | ||||
| 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= | ||||
| @@ -598,8 +653,8 @@ 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.0 h1:xVKxvI7ouOI5I+U9s2eeiUfMaWBVoXA3AWskkrqK0VM= | ||||
| github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= | ||||
| 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/ssor/bom v0.0.0-20170718123548-6386211fdfcf/go.mod h1:RJID2RhlZKId02nZ62WenDCkgHFerpIOmW0iT7GKmXM= | ||||
| github.com/steveyen/gtreap v0.1.0/go.mod h1:kl/5J7XbrOmlIbYIXdRHDDE5QxHqpk0cmkT7Z4dM9/Y= | ||||
| github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= | ||||
| @@ -610,6 +665,8 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV | ||||
| 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/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= | ||||
| @@ -630,8 +687,8 @@ github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljT | ||||
| github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= | ||||
| github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= | ||||
| github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= | ||||
| github.com/valyala/fasttemplate v1.1.0 h1:RZqt0yGBsps8NGvLSGW804QQqCUYYLsaOjTVHy1Ocw4= | ||||
| github.com/valyala/fasttemplate v1.1.0/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= | ||||
| github.com/valyala/fasttemplate v1.2.1 h1:TVEnxayobAdVkhQfrfes2IzOB6o+z4roRkPF52WA1u4= | ||||
| github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= | ||||
| github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU= | ||||
| github.com/viant/toolbox v0.24.0/go.mod h1:OxMCG57V0PXuIP2HNQrtJf2CjqdmbrOx5EkMILuUhzM= | ||||
| github.com/wiggin77/cfg v1.0.2/go.mod h1:b3gotba2e5bXTqTW48DwIFoLc+4lWKP7WPi/CdvZ4aE= | ||||
| @@ -644,13 +701,16 @@ github.com/writeas/go-strip-markdown v2.0.1+incompatible/go.mod h1:Rsyu10ZhbEK9p | ||||
| github.com/x-cray/logrus-prefixed-formatter v0.5.2 h1:00txxvfBM9muc0jiLIEAkAcIMJzfthRT6usrui8uGmg= | ||||
| github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7VPsoEPHyzalCE06qoARUCeBBE= | ||||
| 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= | ||||
| github.com/yaegashi/msgraph.go v0.1.3 h1:xeknrGbPGqUVvjjtXGuxvesHLNJ6jEfiOtqJToZe0qw= | ||||
| github.com/yaegashi/msgraph.go v0.1.3/go.mod h1:dpty8G9hMEC1xBQeXp6Z2hCXKalqczk2BLvK9me/TUU= | ||||
| github.com/yaegashi/msgraph.go v0.1.4 h1:leDXSczAbwBpYFSmmZrdByTiPoUw8dbTfNMetAjJvbw= | ||||
| github.com/yaegashi/msgraph.go v0.1.4/go.mod h1:vgeYhHa5skJt/3lTyjGXThTZhwbhRnGo6uUxzoJIGME= | ||||
| github.com/yaegashi/wtz.go v0.0.2/go.mod h1:nOLA5QXsmdkRxBkP5tljhua13ADHCKirLBrzPf4PEJc= | ||||
| github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= | ||||
| github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= | ||||
| github.com/yuin/goldmark v1.1.32/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/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0= | ||||
| @@ -661,6 +721,9 @@ go.opencensus.io v0.19.1/go.mod h1:gug0GbSHa8Pafr0d2urOSgoXHZ6x/RUlaiT0d9pqb4A= | ||||
| go.opencensus.io v0.19.2/go.mod h1:NO/8qkisMZLZ1FCsKNqtJPwc8/TaclWyY0B6wcYNg9M= | ||||
| go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= | ||||
| 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.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.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= | ||||
| @@ -692,23 +755,30 @@ golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f/go.mod h1:yigFU9vqHzYiE8U | ||||
| golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/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-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= | ||||
| golang.org/x/crypto v0.0.0-20200429183012-4b2356b1ed79/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/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= | ||||
| golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= | ||||
| golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= | ||||
| golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= | ||||
| golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= | ||||
| golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= | ||||
| golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= | ||||
| golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= | ||||
| golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= | ||||
| golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= | ||||
| 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-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= | ||||
| golang.org/x/image v0.0.0-20200618115811-c13761719519 h1:1e2ufUJNM3lCHEY5jIgac/7UTjd6cgJNdatjPdFWf34= | ||||
| golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= | ||||
| golang.org/x/image v0.0.0-20200801110659-972c09e46d76 h1:U7GPaoQyQmX+CBRWXKrvRzWTbd+slqeSh8uARsIyhAw= | ||||
| golang.org/x/image v0.0.0-20200801110659-972c09e46d76/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= | ||||
| 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= | ||||
| @@ -718,6 +788,8 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl | ||||
| golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= | ||||
| golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= | ||||
| 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/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= | ||||
| @@ -725,8 +797,11 @@ golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCc | ||||
| 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/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= | ||||
| golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= | ||||
| @@ -749,21 +824,37 @@ golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR | ||||
| golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= | ||||
| golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= | ||||
| golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= | ||||
| golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= | ||||
| golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= | ||||
| golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= | ||||
| golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= | ||||
| golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= | ||||
| golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= | ||||
| 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= | ||||
| golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/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/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= | ||||
| golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= | ||||
| 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-20200902213428-5d25da1a8d43 h1:ld7aEMNHoBnnDAX15v1T6z31v8HwR2A9FYOuAhWqkwc= | ||||
| golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/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= | ||||
| @@ -772,6 +863,7 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJ | ||||
| golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | ||||
| 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/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= | ||||
| @@ -795,27 +887,45 @@ golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7w | ||||
| golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| 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-20200523222454-059865788121/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/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/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/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= | ||||
| @@ -841,19 +951,45 @@ golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtn | ||||
| golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= | ||||
| golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= | ||||
| golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= | ||||
| golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= | ||||
| golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= | ||||
| golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= | ||||
| golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= | ||||
| golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= | ||||
| golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= | ||||
| golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= | ||||
| golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= | ||||
| golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= | ||||
| golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= | ||||
| golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= | ||||
| golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= | ||||
| golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= | ||||
| golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= | ||||
| golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= | ||||
| golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= | ||||
| golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= | ||||
| golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= | ||||
| golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= | ||||
| golang.org/x/tools v0.0.0-20200428021058-7ae4988eb4d9/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= | ||||
| 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-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/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= | ||||
| gomod.garykim.dev/nc-talk v0.0.2 h1:QagJzL1Ie/sJDachAC42fEXlIh2mK8IDk1/ue0u8IcI= | ||||
| gomod.garykim.dev/nc-talk v0.0.2/go.mod h1:0/Ksg0osAYmnWKs1OcCG+gBQ4HU1xiF1699g9B6jWZw= | ||||
| 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.3 h1:u4TPUR5++xjNTHoiO82/E8xhGFpCbwwfcY/yUv3Rp60= | ||||
| gomod.garykim.dev/nc-talk v0.1.3/go.mod h1:zKg8yxCk2KaTy6aPDEfRac0Jik72czX+nRsG8CZuhtc= | ||||
| 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= | ||||
| @@ -864,6 +1000,17 @@ google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E | ||||
| google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= | ||||
| google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= | ||||
| google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= | ||||
| google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= | ||||
| google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= | ||||
| google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= | ||||
| google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= | ||||
| google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= | ||||
| google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= | ||||
| google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= | ||||
| google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= | ||||
| 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/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= | ||||
| @@ -871,6 +1018,9 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 | ||||
| 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/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= | ||||
| @@ -887,7 +1037,27 @@ google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98 | ||||
| google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= | ||||
| google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= | ||||
| google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= | ||||
| google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= | ||||
| google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= | ||||
| google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= | ||||
| google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= | ||||
| google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= | ||||
| google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= | ||||
| google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= | ||||
| google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= | ||||
| google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= | ||||
| google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= | ||||
| google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= | ||||
| google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= | ||||
| google.golang.org/genproto v0.0.0-20200424135956-bca184e23272/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-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/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= | ||||
| @@ -899,16 +1069,25 @@ google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ij | ||||
| google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= | ||||
| google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= | ||||
| google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= | ||||
| google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= | ||||
| google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= | ||||
| google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= | ||||
| google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= | ||||
| 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/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= | ||||
| 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= | ||||
| @@ -928,6 +1107,8 @@ gopkg.in/ini.v1 v1.55.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= | ||||
| gopkg.in/mail.v2 v2.3.1/go.mod h1:htwXN1Qh09vZJ1NVKxQqHPBaCBbzKhp5GzuJEA4VJWw= | ||||
| gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= | ||||
| gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= | ||||
| gopkg.in/olahol/melody.v1 v1.0.0-20170518105555-d52139073376 h1:sY2a+y0j4iDrajJcorb+a0hJIQ6uakU5gybjfLWHlXo= | ||||
| gopkg.in/olahol/melody.v1 v1.0.0-20170518105555-d52139073376/go.mod h1:BHKOc1m5wm8WwQkMqYBoo4vNxhmF7xg8+xhG8L+Cy3M= | ||||
| gopkg.in/olivere/elastic.v6 v6.2.30/go.mod h1:2cTT8Z+/LcArSWpCgvZqBgt3VOqXiy7v00w12Lz8bd4= | ||||
| gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= | ||||
| gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= | ||||
| @@ -939,6 +1120,8 @@ 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.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= | ||||
| gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/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= | ||||
| @@ -949,8 +1132,13 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh | ||||
| 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= | ||||
| 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= | ||||
| sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck= | ||||
| sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0= | ||||
| willnorris.com/go/gifresize v1.0.0/go.mod h1:eBM8gogBGCcaH603vxSpnfjwXIpq6nmnj/jauBDKtAk= | ||||
|   | ||||
| @@ -16,7 +16,7 @@ import ( | ||||
| ) | ||||
|  | ||||
| var ( | ||||
| 	version = "1.18.1" | ||||
| 	version = "1.18.3" | ||||
| 	githash string | ||||
|  | ||||
| 	flagConfig  = flag.String("conf", "matterbridge.toml", "config file") | ||||
|   | ||||
| @@ -1394,6 +1394,11 @@ ShowTopicChange=false | ||||
| # Url of your Nextcloud server | ||||
| Server = "https://cloud.youdomain.me" | ||||
|  | ||||
| # Enable to not verify the certificate on your Nextcloud server. | ||||
| # e.g. when using selfsigned certificates | ||||
| # OPTIONAL (default false) | ||||
| SkipTLSVerify=true | ||||
|  | ||||
| # Username of the bot | ||||
| Login = "talkuser" | ||||
|  | ||||
| @@ -1540,6 +1545,8 @@ Buffer=1000 | ||||
|  | ||||
| #Bearer token used for authentication | ||||
| #curl -H "Authorization: Bearer token" http://localhost:4242/api/messages | ||||
| # https://github.com/vi/websocat | ||||
| # websocat -H="Authorization: Bearer token" ws://127.0.0.1:4242/api/websocket | ||||
| #OPTIONAL (no authorization if token is empty) | ||||
| Token="mytoken" | ||||
|  | ||||
|   | ||||
							
								
								
									
										38
									
								
								tgs.Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								tgs.Dockerfile
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,38 @@ | ||||
| FROM alpine AS builder | ||||
|  | ||||
| COPY . /go/src/github.com/42wim/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 | ||||
|  | ||||
| FROM alpine | ||||
| RUN apk --no-cache add \ | ||||
|     ca-certificates \ | ||||
|     cairo \ | ||||
|     libjpeg-turbo \ | ||||
|     mailcap \ | ||||
|     py3-webencodings \ | ||||
|     python3 \ | ||||
|   && apk --no-cache add --virtual .compile \ | ||||
|     gcc \ | ||||
|     libffi-dev \ | ||||
|     libjpeg-turbo-dev \ | ||||
|     musl-dev \ | ||||
|     py3-pip \ | ||||
|     py3-wheel \ | ||||
|     python3-dev \ | ||||
|     zlib-dev \ | ||||
|   && pip3 install --no-cache-dir lottie[PNG] \ | ||||
|   && apk --no-cache del .compile | ||||
|  | ||||
| COPY --from=builder /bin/matterbridge /bin/matterbridge | ||||
| RUN mkdir /etc/matterbridge \ | ||||
|   && touch /etc/matterbridge/matterbridge.toml \ | ||||
|   && ln -sf /matterbridge.toml /etc/matterbridge/matterbridge.toml | ||||
| ENTRYPOINT ["/bin/matterbridge", "-conf", "/etc/matterbridge/matterbridge.toml"] | ||||
							
								
								
									
										4
									
								
								vendor/github.com/Rhymen/go-whatsapp/README.md
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								vendor/github.com/Rhymen/go-whatsapp/README.md
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -70,6 +70,10 @@ func (myHandler) HandleContactMessage(message whatsapp.ContactMessage) { | ||||
| 	fmt.Println(message) | ||||
| } | ||||
|  | ||||
| func (myHandler) HandleBatteryMessage(msg whatsapp.BatteryMessage) { | ||||
| 	fmt.Println(message) | ||||
| } | ||||
|  | ||||
| wac.AddHandler(myHandler{}) | ||||
| ``` | ||||
| The message handlers are all optional, you don't need to implement anything but the error handler to implement the interface. The ImageMessage, VideoMessage, AudioMessage and DocumentMessage provide a Download function to get the media data. | ||||
|   | ||||
							
								
								
									
										14
									
								
								vendor/github.com/Rhymen/go-whatsapp/conn.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										14
									
								
								vendor/github.com/Rhymen/go-whatsapp/conn.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -88,6 +88,8 @@ type Conn struct { | ||||
| 	Store          *Store | ||||
| 	ServerLastSeen time.Time | ||||
|  | ||||
| 	timeTag string // last 3 digits obtained after a successful login takeover | ||||
|  | ||||
| 	longClientName  string | ||||
| 	shortClientName string | ||||
| 	clientVersion   string | ||||
| @@ -156,8 +158,8 @@ func (wac *Conn) connect() (err error) { | ||||
| 	}() | ||||
|  | ||||
| 	dialer := &websocket.Dialer{ | ||||
| 		ReadBufferSize:   25 * 1024 * 1024, | ||||
| 		WriteBufferSize:  10 * 1024 * 1024, | ||||
| 		ReadBufferSize:   0, | ||||
| 		WriteBufferSize:  0, | ||||
| 		HandshakeTimeout: wac.msgTimeout, | ||||
| 		Proxy:            wac.Proxy, | ||||
| 	} | ||||
| @@ -246,3 +248,11 @@ func (wac *Conn) keepAlive(minIntervalMs int, maxIntervalMs int) { | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
|  | ||||
| func (wac *Conn) GetConnected() bool { | ||||
| 	return  wac.connected | ||||
| } | ||||
|  | ||||
| func (wac *Conn) GetLoggedIn() bool { | ||||
| 	return  wac.loggedIn | ||||
| } | ||||
|   | ||||
							
								
								
									
										2
									
								
								vendor/github.com/Rhymen/go-whatsapp/errors.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/Rhymen/go-whatsapp/errors.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -2,6 +2,7 @@ package whatsapp | ||||
|  | ||||
| import ( | ||||
| 	"fmt" | ||||
|  | ||||
| 	"github.com/pkg/errors" | ||||
| ) | ||||
|  | ||||
| @@ -20,6 +21,7 @@ var ( | ||||
| 	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") | ||||
| 	ErrInvalidWebsocket           = errors.New("invalid websocket") | ||||
| ) | ||||
|  | ||||
| type ErrConnectionFailed struct { | ||||
|   | ||||
							
								
								
									
										23
									
								
								vendor/github.com/Rhymen/go-whatsapp/handler.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										23
									
								
								vendor/github.com/Rhymen/go-whatsapp/handler.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -133,6 +133,14 @@ type ChatListHandler interface { | ||||
| 	HandleChatList(contacts []Chat) | ||||
| } | ||||
|  | ||||
| /** | ||||
| The BatteryMessageHandler interface needs to be implemented to receive percentage the device connected dispatched by the dispatcher. | ||||
| */ | ||||
| type BatteryMessageHandler interface { | ||||
| 	Handler | ||||
| 	HandleBatteryMessage(battery BatteryMessage) | ||||
| } | ||||
|  | ||||
| /* | ||||
| AddHandler adds an handler to the list of handler that receive dispatched messages. | ||||
| The provided handler must at least implement the Handler interface. Additionally implemented | ||||
| @@ -285,6 +293,17 @@ func (wac *Conn) handleWithCustomHandlers(message interface{}, handlers []Handle | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
| 	 | ||||
| 	case BatteryMessage: | ||||
| 		for _, h := range handlers { | ||||
| 			if x, ok := h.(BatteryMessageHandler); ok { | ||||
| 				if wac.shouldCallSynchronously(h) { | ||||
| 					x.HandleBatteryMessage(m) | ||||
| 				} else { | ||||
| 					go x.HandleBatteryMessage(m) | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 	case *proto.WebMessageInfo: | ||||
| 		for _, h := range handlers { | ||||
| @@ -379,6 +398,10 @@ func (wac *Conn) dispatch(msg interface{}) { | ||||
| 						wac.handle(ParseProtoMessage(v)) | ||||
| 					} | ||||
| 				} | ||||
| 			} else if con, ok := message.Content.([]binary.Node); ok { | ||||
| 				for a := range con { | ||||
| 					wac.handle(ParseNodeMessage(con[a])) | ||||
| 				} | ||||
| 			} | ||||
| 		} else if message.Description == "response" && message.Attributes["type"] == "contacts" { | ||||
| 			wac.updateContacts(message.Content) | ||||
|   | ||||
							
								
								
									
										23
									
								
								vendor/github.com/Rhymen/go-whatsapp/media.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										23
									
								
								vendor/github.com/Rhymen/go-whatsapp/media.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -93,18 +93,21 @@ func downloadMedia(url string) (file []byte, mac []byte, err error) { | ||||
| 	return data[:n-10], data[n-10 : n], nil | ||||
| } | ||||
|  | ||||
| type MediaConn struct { | ||||
| 	Status    int `json:"status"` | ||||
| 	MediaConn struct { | ||||
| 		Auth  string `json:"auth"` | ||||
| 		TTL   int    `json:"ttl"` | ||||
| 		Hosts []struct { | ||||
| 			Hostname string   `json:"hostname"` | ||||
| 			IPs      []string `json:"ips"` | ||||
| 		} `json:"hosts"` | ||||
| 	} `json:"media_conn"` | ||||
|                                                                                  | ||||
| type MediaConn struct {                                                          | ||||
|         Status int `json:"status"`                                               | ||||
|         MediaConn struct {                                                       | ||||
|                 Auth string `json:"auth"`                                        | ||||
|                 TTL int `json:"ttl"`                                             | ||||
|                 Hosts []struct {                                                 | ||||
|                         Hostname string `json:"hostname"`                        | ||||
|                         IPs []interface{}  `json:"ips"`                                               | ||||
|                 } `json:"hosts"`                                                 | ||||
|         } `json:"media_conn"`                                                    | ||||
| } | ||||
|  | ||||
|  | ||||
|  | ||||
| func (wac *Conn) queryMediaConn() (hostname, auth string, ttl int, err error) { | ||||
| 	queryReq := []interface{}{"query", "mediaConn"} | ||||
| 	ch, err := wac.writeJson(queryReq) | ||||
|   | ||||
							
								
								
									
										136
									
								
								vendor/github.com/Rhymen/go-whatsapp/message.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										136
									
								
								vendor/github.com/Rhymen/go-whatsapp/message.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -81,7 +81,7 @@ func (wac *Conn) Send(msg interface{}) (string, error) { | ||||
| 			return "ERROR", fmt.Errorf("error decoding sending response: %v\n", err) | ||||
| 		} | ||||
| 		if int(resp["status"].(float64)) != 200 { | ||||
| 			return "ERROR", fmt.Errorf("message sending responded with %d", resp["status"]) | ||||
| 			return "ERROR", fmt.Errorf("message sending responded with %v", resp["status"]) | ||||
| 		} | ||||
| 		if int(resp["status"].(float64)) == 200 { | ||||
| 			return getMessageInfo(msgProto).Id, nil | ||||
| @@ -105,6 +105,105 @@ func (wac *Conn) sendProto(p *proto.WebMessageInfo) (<-chan string, error) { | ||||
| 	return wac.writeBinary(n, message, ignore, p.Key.GetId()) | ||||
| } | ||||
|  | ||||
| // RevokeMessage revokes a message (marks as "message removed") for everyone | ||||
| func (wac *Conn) RevokeMessage(remotejid, msgid string, fromme bool) (revokeid string, err error) { | ||||
| 	// create a revocation ID (required) | ||||
| 	rawrevocationID := make([]byte, 10) | ||||
| 	rand.Read(rawrevocationID) | ||||
| 	revocationID := strings.ToUpper(hex.EncodeToString(rawrevocationID)) | ||||
| 	// | ||||
| 	ts := uint64(time.Now().Unix()) | ||||
| 	status := proto.WebMessageInfo_PENDING | ||||
| 	mtype := proto.ProtocolMessage_REVOKE | ||||
|  | ||||
| 	revoker := &proto.WebMessageInfo{ | ||||
| 		Key: &proto.MessageKey{ | ||||
| 			FromMe:    &fromme, | ||||
| 			Id:        &revocationID, | ||||
| 			RemoteJid: &remotejid, | ||||
| 		}, | ||||
| 		MessageTimestamp: &ts, | ||||
| 		Message: &proto.Message{ | ||||
| 			ProtocolMessage: &proto.ProtocolMessage{ | ||||
| 				Type: &mtype, | ||||
| 				Key: &proto.MessageKey{ | ||||
| 					FromMe:    &fromme, | ||||
| 					Id:        &msgid, | ||||
| 					RemoteJid: &remotejid, | ||||
| 				}, | ||||
| 			}, | ||||
| 		}, | ||||
| 		Status: &status, | ||||
| 	} | ||||
| 	if _, err := wac.Send(revoker); err != nil { | ||||
| 		return revocationID, err | ||||
| 	} | ||||
| 	return revocationID, nil | ||||
| } | ||||
|  | ||||
| // DeleteMessage deletes a single message for the user (removes the msgbox). To | ||||
| // delete the message for everyone, use RevokeMessage | ||||
| func (wac *Conn) DeleteMessage(remotejid, msgid string, fromMe bool) error { | ||||
| 	ch, err := wac.deleteChatProto(remotejid, msgid, fromMe) | ||||
| 	if err != nil { | ||||
| 		return fmt.Errorf("could not send proto: %v", err) | ||||
| 	} | ||||
|  | ||||
| 	select { | ||||
| 	case response := <-ch: | ||||
| 		var resp map[string]interface{} | ||||
| 		if err = json.Unmarshal([]byte(response), &resp); err != nil { | ||||
| 			return fmt.Errorf("error decoding deletion response: %v", err) | ||||
| 		} | ||||
| 		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) { | ||||
| 	tag := fmt.Sprintf("%s.--%d", wac.timeTag, wac.msgCount) | ||||
|  | ||||
| 	owner := "true" | ||||
| 	if !fromMe { | ||||
| 		owner = "false" | ||||
| 	} | ||||
| 	n := binary.Node{ | ||||
| 		Description: "action", | ||||
| 		Attributes: map[string]string{ | ||||
| 			"epoch": strconv.Itoa(wac.msgCount), | ||||
| 			"type":  "set", | ||||
| 		}, | ||||
| 		Content: []interface{}{ | ||||
| 			binary.Node{ | ||||
| 				Description: "chat", | ||||
| 				Attributes: map[string]string{ | ||||
| 					"type":  "clear", | ||||
| 					"jid":   remotejid, | ||||
| 					"media": "true", | ||||
| 				}, | ||||
| 				Content: []binary.Node{ | ||||
| 					{ | ||||
| 						Description: "item", | ||||
| 						Attributes: map[string]string{ | ||||
| 							"owner": owner, | ||||
| 							"index": msgid, | ||||
| 						}, | ||||
| 					}, | ||||
| 				}, | ||||
| 			}, | ||||
| 		}, | ||||
| 	} | ||||
| 	return wac.writeBinary(n, chat, expires|skipOffline, tag) | ||||
| } | ||||
|  | ||||
| func init() { | ||||
| 	rand.Seed(time.Now().UTC().UnixNano()) | ||||
| } | ||||
| @@ -744,3 +843,38 @@ func ParseProtoMessage(msg *proto.WebMessageInfo) interface{} { | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
|  | ||||
| /* | ||||
| BatteryMessage represents a battery level and charging state. | ||||
| */ | ||||
| type BatteryMessage struct { | ||||
| 	Plugged bool | ||||
| 	Powersave bool | ||||
| 	Percentage int | ||||
| } | ||||
|  | ||||
| func getBatteryMessage(msg map[string]string) BatteryMessage { | ||||
| 	plugged, _ := strconv.ParseBool(msg["live"]) | ||||
| 	powersave, _ := strconv.ParseBool(msg["powersave"]) | ||||
| 	percentage, _ := strconv.Atoi(msg["value"]) | ||||
| 	batteryMessage := BatteryMessage{ | ||||
| 		Plugged: plugged, | ||||
| 		Powersave: powersave, | ||||
| 		Percentage: percentage, | ||||
| 	} | ||||
|  | ||||
| 	return batteryMessage | ||||
| } | ||||
|  | ||||
|  | ||||
| func ParseNodeMessage(msg binary.Node) interface{} { | ||||
| 	switch msg.Description { | ||||
| 	case "battery": | ||||
| 		return getBatteryMessage(msg.Attributes) | ||||
| 	default: | ||||
| 		//cannot match message | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|   | ||||
							
								
								
									
										11
									
								
								vendor/github.com/Rhymen/go-whatsapp/read.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										11
									
								
								vendor/github.com/Rhymen/go-whatsapp/read.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -5,13 +5,14 @@ import ( | ||||
| 	"crypto/sha256" | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io" | ||||
| 	"io/ioutil" | ||||
| 	"strings" | ||||
|  | ||||
| 	"github.com/Rhymen/go-whatsapp/binary" | ||||
| 	"github.com/Rhymen/go-whatsapp/crypto/cbc" | ||||
| 	"github.com/gorilla/websocket" | ||||
| 	"github.com/pkg/errors" | ||||
| 	"io" | ||||
| 	"io/ioutil" | ||||
| 	"strings" | ||||
| ) | ||||
|  | ||||
| func (wac *Conn) readPump() { | ||||
| @@ -27,7 +28,9 @@ func (wac *Conn) readPump() { | ||||
| 	for { | ||||
| 		readerFound := make(chan struct{}) | ||||
| 		go func() { | ||||
| 			msgType, reader, readErr = wac.ws.conn.NextReader() | ||||
| 			if wac.ws != nil { | ||||
| 				msgType, reader, readErr = wac.ws.conn.NextReader() | ||||
| 			} | ||||
| 			close(readerFound) | ||||
| 		}() | ||||
| 		select { | ||||
|   | ||||
							
								
								
									
										24
									
								
								vendor/github.com/Rhymen/go-whatsapp/session.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										24
									
								
								vendor/github.com/Rhymen/go-whatsapp/session.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -18,7 +18,7 @@ import ( | ||||
| ) | ||||
|  | ||||
| //represents the WhatsAppWeb client version | ||||
| var waVersion = []int{0, 4, 2080} | ||||
| var waVersion = []int{2, 2033, 7} | ||||
|  | ||||
| /* | ||||
| Session contains session individual information. To be able to resume the connection without scanning the qr code | ||||
| @@ -141,11 +141,11 @@ 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) error { | ||||
| 	if wac.session != nil && (wac.session.EncKey != nil || wac.session.MacKey != nil) { | ||||
| 		return fmt.Errorf("cannot change client name after logging in") | ||||
| 	} | ||||
| 	wac.longClientName, wac.shortClientName, wac.clientVersion = long, short, version | ||||
| 	wac.longClientName, wac.shortClientName = long, short | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| @@ -231,7 +231,12 @@ func (wac *Conn) Login(qrChan chan<- string) (Session, error) { | ||||
| 		return session, fmt.Errorf("error decoding login resp: %v\n", err) | ||||
| 	} | ||||
|  | ||||
| 	ref := resp["ref"].(string) | ||||
| 	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 { | ||||
| @@ -390,9 +395,11 @@ func (wac *Conn) Restore() error { | ||||
| 		} | ||||
|  | ||||
| 		if int(resp["status"].(float64)) != 200 { | ||||
| 			wac.timeTag = "" | ||||
| 			return fmt.Errorf("init responded with %d", resp["status"]) | ||||
| 		} | ||||
| 	case <-time.After(wac.msgTimeout): | ||||
| 		wac.timeTag = "" | ||||
| 		return fmt.Errorf("restore session init timed out") | ||||
| 	} | ||||
|  | ||||
| @@ -401,10 +408,11 @@ func (wac *Conn) Restore() error { | ||||
| 	select { | ||||
| 	case r1 := <-s1: | ||||
| 		if err := json.Unmarshal([]byte(r1), &connResp); err != nil { | ||||
| 			wac.timeTag = "" | ||||
| 			return fmt.Errorf("error decoding s1 message: %v\n", err) | ||||
| 		} | ||||
| 	case <-time.After(wac.msgTimeout): | ||||
|  | ||||
| 		wac.timeTag = "" | ||||
| 		//check for an error message | ||||
| 		select { | ||||
| 		case r := <-loginChan: | ||||
| @@ -429,15 +437,18 @@ func (wac *Conn) Restore() error { | ||||
| 		wac.listener.Unlock() | ||||
|  | ||||
| 		if err := wac.resolveChallenge(connResp[1].(map[string]interface{})["challenge"].(string)); err != nil { | ||||
| 			wac.timeTag = "" | ||||
| 			return fmt.Errorf("error resolving challenge: %v\n", err) | ||||
| 		} | ||||
|  | ||||
| 		select { | ||||
| 		case r := <-s2: | ||||
| 			if err := json.Unmarshal([]byte(r), &connResp); err != nil { | ||||
| 				wac.timeTag = "" | ||||
| 				return fmt.Errorf("error decoding s2 message: %v\n", err) | ||||
| 			} | ||||
| 		case <-time.After(wac.msgTimeout): | ||||
| 			wac.timeTag = "" | ||||
| 			return fmt.Errorf("restore session challenge timed out") | ||||
| 		} | ||||
| 	} | ||||
| @@ -447,13 +458,16 @@ func (wac *Conn) Restore() error { | ||||
| 	case r := <-loginChan: | ||||
| 		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) | ||||
| 		} | ||||
|  | ||||
| 		if int(resp["status"].(float64)) != 200 { | ||||
| 			wac.timeTag = "" | ||||
| 			return fmt.Errorf("admin login responded with %d", resp["status"]) | ||||
| 		} | ||||
| 	case <-time.After(wac.msgTimeout): | ||||
| 		wac.timeTag = "" | ||||
| 		return fmt.Errorf("restore session login timed out") | ||||
| 	} | ||||
|  | ||||
|   | ||||
							
								
								
									
										8
									
								
								vendor/github.com/Rhymen/go-whatsapp/write.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								vendor/github.com/Rhymen/go-whatsapp/write.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -30,6 +30,11 @@ func (wac *Conn) writeJson(data []interface{}) (<-chan string, error) { | ||||
| 	messageTag := fmt.Sprintf("%d.--%d", ts, wac.msgCount) | ||||
| 	bytes := []byte(fmt.Sprintf("%s,%s", messageTag, d)) | ||||
|  | ||||
| 	if wac.timeTag == "" { | ||||
| 		tss := fmt.Sprintf("%d", ts) | ||||
| 		wac.timeTag = tss[len(tss)-3:] | ||||
| 	} | ||||
|  | ||||
| 	ch, err := wac.write(websocket.TextMessage, messageTag, bytes) | ||||
| 	if err != nil { | ||||
| 		return nil, err | ||||
| @@ -127,6 +132,9 @@ func (wac *Conn) write(messageType int, answerMessageTag string, data []byte) (< | ||||
| 		wac.listener.Unlock() | ||||
| 	} | ||||
|  | ||||
| 	if wac == nil || wac.ws == nil { | ||||
| 		return nil, ErrInvalidWebsocket | ||||
| 	} | ||||
| 	wac.ws.Lock() | ||||
| 	err := wac.ws.conn.WriteMessage(messageType, data) | ||||
| 	wac.ws.Unlock() | ||||
|   | ||||
							
								
								
									
										2
									
								
								vendor/github.com/gomarkdown/markdown/README.md
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/gomarkdown/markdown/README.md
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -113,7 +113,7 @@ opts := html.RendererOptions{ | ||||
| } | ||||
| renderer := html.NewRenderer(opts) | ||||
| md := "test\n```\nthis code block will be dropped from output\n```\ntext" | ||||
| html := markdown.ToHTML([]byte(s), nil, renderer) | ||||
| html := markdown.ToHTML([]byte(md), nil, renderer) | ||||
| ```` | ||||
|  | ||||
| ## Sanitize untrusted content | ||||
|   | ||||
							
								
								
									
										1
									
								
								vendor/github.com/gomarkdown/markdown/go.sum
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								vendor/github.com/gomarkdown/markdown/go.sum
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1 @@ | ||||
| golang.org/dl v0.0.0-20190829154251-82a15e2f2ead/go.mod h1:IUMfjQLJQd4UTqG1Z90tenwKoCX93Gn3MAQJMOSBsDQ= | ||||
							
								
								
									
										33
									
								
								vendor/github.com/gomarkdown/markdown/parser/block.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										33
									
								
								vendor/github.com/gomarkdown/markdown/parser/block.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -26,8 +26,10 @@ var ( | ||||
| 	blockTags = map[string]struct{}{ | ||||
| 		"blockquote": {}, | ||||
| 		"del":        {}, | ||||
| 		"dd":         {}, | ||||
| 		"div":        {}, | ||||
| 		"dl":         {}, | ||||
| 		"dt":         {}, | ||||
| 		"fieldset":   {}, | ||||
| 		"form":       {}, | ||||
| 		"h1":         {}, | ||||
| @@ -36,23 +38,28 @@ var ( | ||||
| 		"h4":         {}, | ||||
| 		"h5":         {}, | ||||
| 		"h6":         {}, | ||||
| 		"iframe":     {}, | ||||
| 		"ins":        {}, | ||||
| 		"math":       {}, | ||||
| 		"noscript":   {}, | ||||
| 		"ol":         {}, | ||||
| 		"pre":        {}, | ||||
| 		"p":          {}, | ||||
| 		"script":     {}, | ||||
| 		"style":      {}, | ||||
| 		"table":      {}, | ||||
| 		"ul":         {}, | ||||
| 		// TODO: technically block but breaks Inline HTML (Simple).text | ||||
| 		//"hr":         {}, | ||||
| 		"iframe":   {}, | ||||
| 		"ins":      {}, | ||||
| 		"li":       {}, | ||||
| 		"math":     {}, | ||||
| 		"noscript": {}, | ||||
| 		"ol":       {}, | ||||
| 		"pre":      {}, | ||||
| 		"p":        {}, | ||||
| 		"script":   {}, | ||||
| 		"style":    {}, | ||||
| 		"table":    {}, | ||||
| 		"ul":       {}, | ||||
|  | ||||
| 		// HTML5 | ||||
| 		"address":    {}, | ||||
| 		"article":    {}, | ||||
| 		"aside":      {}, | ||||
| 		"canvas":     {}, | ||||
| 		"details":    {}, | ||||
| 		"dialog":     {}, | ||||
| 		"figcaption": {}, | ||||
| 		"figure":     {}, | ||||
| 		"footer":     {}, | ||||
| @@ -230,8 +237,10 @@ func (p *Parser) block(data []byte) { | ||||
| 		// or | ||||
| 		// ______ | ||||
| 		if p.isHRule(data) { | ||||
| 			p.addBlock(&ast.HorizontalRule{}) | ||||
| 			i := skipUntilChar(data, 0, '\n') | ||||
| 			hr := ast.HorizontalRule{} | ||||
| 			hr.Literal = bytes.Trim(data[:i], " \n") | ||||
| 			p.addBlock(&hr) | ||||
| 			data = data[i:] | ||||
| 			continue | ||||
| 		} | ||||
|   | ||||
							
								
								
									
										3
									
								
								vendor/github.com/google/gops/agent/agent.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								vendor/github.com/google/gops/agent/agent.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -222,7 +222,10 @@ func handle(conn io.ReadWriter, msg []byte) error { | ||||
| 		fmt.Fprintf(conn, "last-gc: %v\n", lastGC) | ||||
| 		fmt.Fprintf(conn, "gc-pause-total: %v\n", time.Duration(s.PauseTotalNs)) | ||||
| 		fmt.Fprintf(conn, "gc-pause: %v\n", s.PauseNs[(s.NumGC+255)%256]) | ||||
| 		fmt.Fprintf(conn, "gc-pause-end: %v\n", s.PauseEnd[(s.NumGC+255)%256]) | ||||
| 		fmt.Fprintf(conn, "num-gc: %v\n", s.NumGC) | ||||
| 		fmt.Fprintf(conn, "num-forced-gc: %v\n", s.NumForcedGC) | ||||
| 		fmt.Fprintf(conn, "gc-cpu-fraction: %v\n", s.GCCPUFraction) | ||||
| 		fmt.Fprintf(conn, "enable-gc: %v\n", s.EnableGC) | ||||
| 		fmt.Fprintf(conn, "debug-gc: %v\n", s.DebugGC) | ||||
| 	case signal.Version: | ||||
|   | ||||
							
								
								
									
										18
									
								
								vendor/github.com/gorilla/schema/.travis.yml
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										18
									
								
								vendor/github.com/gorilla/schema/.travis.yml
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -1,18 +0,0 @@ | ||||
| language: go | ||||
| sudo: false | ||||
|  | ||||
| matrix: | ||||
|   include: | ||||
|     - go: 1.5 | ||||
|     - go: 1.6 | ||||
|     - go: 1.7 | ||||
|     - go: 1.8 | ||||
|     - go: tip | ||||
|   allow_failures: | ||||
|     - go: tip | ||||
|  | ||||
| script: | ||||
|   - go get -t -v ./... | ||||
|   - diff -u <(echo -n) <(gofmt -d .) | ||||
|   - go vet $(go list ./... | grep -v /vendor/) | ||||
|   - go test -v -race ./... | ||||
							
								
								
									
										19
									
								
								vendor/github.com/gorilla/schema/decoder.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										19
									
								
								vendor/github.com/gorilla/schema/decoder.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -152,9 +152,15 @@ type fieldWithPrefix struct { | ||||
| func isEmptyFields(fields []fieldWithPrefix, src map[string][]string) bool { | ||||
| 	for _, f := range fields { | ||||
| 		for _, path := range f.paths(f.prefix) { | ||||
| 			if !isEmpty(f.typ, src[path]) { | ||||
| 			v, ok := src[path] | ||||
| 			if ok && !isEmpty(f.typ, v) { | ||||
| 				return false | ||||
| 			} | ||||
| 			for key := range src { | ||||
| 				if !isEmpty(f.typ, src[key]) && strings.HasPrefix(key, path) { | ||||
| 					return false | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| 	return true | ||||
| @@ -182,6 +188,17 @@ func (d *Decoder) decode(v reflect.Value, path string, parts []pathPart, values | ||||
| 			} | ||||
| 			v = v.Elem() | ||||
| 		} | ||||
|  | ||||
| 		// alloc embedded structs | ||||
| 		if v.Type().Kind() == reflect.Struct { | ||||
| 			for i := 0; i < v.NumField(); i++ { | ||||
| 				field := v.Field(i) | ||||
| 				if field.Type().Kind() == reflect.Ptr && field.IsNil() && v.Type().Field(i).Anonymous == true { | ||||
| 					field.Set(reflect.New(field.Type().Elem())) | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 		v = v.FieldByName(name) | ||||
| 	} | ||||
| 	// Don't even bother for unexported fields. | ||||
|   | ||||
							
								
								
									
										7
									
								
								vendor/github.com/gorilla/schema/encoder.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										7
									
								
								vendor/github.com/gorilla/schema/encoder.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -57,6 +57,13 @@ func isZero(v reflect.Value) bool { | ||||
| 		} | ||||
| 		return z | ||||
| 	case reflect.Struct: | ||||
| 		type zero interface { | ||||
| 			IsZero() bool | ||||
| 		} | ||||
| 		if v.Type().Implements(reflect.TypeOf((*zero)(nil)).Elem()) { | ||||
| 			iz := v.MethodByName("IsZero").Call([]reflect.Value{})[0] | ||||
| 			return iz.Interface().(bool) | ||||
| 		} | ||||
| 		z := true | ||||
| 		for i := 0; i < v.NumField(); i++ { | ||||
| 			z = z && isZero(v.Field(i)) | ||||
|   | ||||
							
								
								
									
										4
									
								
								vendor/github.com/labstack/echo/v4/.travis.yml
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								vendor/github.com/labstack/echo/v4/.travis.yml
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -1,7 +1,7 @@ | ||||
| language: go | ||||
| go: | ||||
|   - 1.12.x | ||||
|   - 1.13.x | ||||
|   - 1.14.x | ||||
|   - 1.15.x | ||||
|   - tip | ||||
| env: | ||||
|   - GO111MODULE=on | ||||
|   | ||||
							
								
								
									
										4
									
								
								vendor/github.com/labstack/echo/v4/README.md
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								vendor/github.com/labstack/echo/v4/README.md
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -17,7 +17,7 @@ Therefore a Go version capable of understanding /vN suffixed imports is required | ||||
|  | ||||
| - 1.9.7+ | ||||
| - 1.10.3+ | ||||
| - 1.11+ | ||||
| - 1.14+ | ||||
|  | ||||
| Any of these versions will allow you to import Echo as `github.com/labstack/echo/v4` which is the recommended | ||||
| way of using Echo going forward. | ||||
| @@ -52,7 +52,7 @@ Lower is better! | ||||
|  | ||||
| ### Installation | ||||
|  | ||||
| ```go | ||||
| ```sh | ||||
| // go get github.com/labstack/echo/{version} | ||||
| go get github.com/labstack/echo/v4 | ||||
| ``` | ||||
|   | ||||
							
								
								
									
										34
									
								
								vendor/github.com/labstack/echo/v4/echo.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										34
									
								
								vendor/github.com/labstack/echo/v4/echo.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -48,6 +48,7 @@ import ( | ||||
| 	"net" | ||||
| 	"net/http" | ||||
| 	"net/url" | ||||
| 	"os" | ||||
| 	"path" | ||||
| 	"path/filepath" | ||||
| 	"reflect" | ||||
| @@ -230,7 +231,7 @@ const ( | ||||
|  | ||||
| const ( | ||||
| 	// Version of Echo | ||||
| 	Version = "4.1.16" | ||||
| 	Version = "4.1.17" | ||||
| 	website = "https://echo.labstack.com" | ||||
| 	// http://patorjk.com/software/taag/#p=display&f=Small%20Slant&t=Echo | ||||
| 	banner = ` | ||||
| @@ -479,7 +480,20 @@ func (common) static(prefix, root string, get func(string, HandlerFunc, ...Middl | ||||
| 		if err != nil { | ||||
| 			return err | ||||
| 		} | ||||
|  | ||||
| 		name := filepath.Join(root, path.Clean("/"+p)) // "/"+ for security | ||||
| 		fi, err := os.Stat(name) | ||||
| 		if err != nil { | ||||
| 			// The access path does not exist | ||||
| 			return NotFoundHandler(c) | ||||
| 		} | ||||
|  | ||||
| 		// If the request is for a directory and does not end with "/" | ||||
| 		p = c.Request().URL.Path // path must not be empty. | ||||
| 		if fi.IsDir() && p[len(p)-1] != '/' { | ||||
| 			// Redirect to ends with "/" | ||||
| 			return c.Redirect(http.StatusMovedPermanently, p+"/") | ||||
| 		} | ||||
| 		return c.File(name) | ||||
| 	} | ||||
| 	if prefix == "/" { | ||||
| @@ -504,11 +518,7 @@ func (e *Echo) add(host, method, path string, handler HandlerFunc, middleware .. | ||||
| 	name := handlerName(handler) | ||||
| 	router := e.findRouter(host) | ||||
| 	router.Add(method, path, func(c Context) error { | ||||
| 		h := handler | ||||
| 		// Chain middleware | ||||
| 		for i := len(middleware) - 1; i >= 0; i-- { | ||||
| 			h = middleware[i](h) | ||||
| 		} | ||||
| 		h := applyMiddleware(handler, middleware...) | ||||
| 		return h(c) | ||||
| 	}) | ||||
| 	r := &Route{ | ||||
| @@ -606,12 +616,12 @@ func (e *Echo) ServeHTTP(w http.ResponseWriter, r *http.Request) { | ||||
| 	h := NotFoundHandler | ||||
|  | ||||
| 	if e.premiddleware == nil { | ||||
| 		e.findRouter(r.Host).Find(r.Method, getPath(r), c) | ||||
| 		e.findRouter(r.Host).Find(r.Method, GetPath(r), c) | ||||
| 		h = c.Handler() | ||||
| 		h = applyMiddleware(h, e.middleware...) | ||||
| 	} else { | ||||
| 		h = func(c Context) error { | ||||
| 			e.findRouter(r.Host).Find(r.Method, getPath(r), c) | ||||
| 			e.findRouter(r.Host).Find(r.Method, GetPath(r), c) | ||||
| 			h := c.Handler() | ||||
| 			h = applyMiddleware(h, e.middleware...) | ||||
| 			return h(c) | ||||
| @@ -795,6 +805,11 @@ func (he *HTTPError) SetInternal(err error) *HTTPError { | ||||
| 	return he | ||||
| } | ||||
|  | ||||
| // Unwrap satisfies the Go 1.13 error wrapper interface. | ||||
| func (he *HTTPError) Unwrap() error { | ||||
| 	return he.Internal | ||||
| } | ||||
|  | ||||
| // WrapHandler wraps `http.Handler` into `echo.HandlerFunc`. | ||||
| func WrapHandler(h http.Handler) HandlerFunc { | ||||
| 	return func(c Context) error { | ||||
| @@ -817,7 +832,8 @@ func WrapMiddleware(m func(http.Handler) http.Handler) MiddlewareFunc { | ||||
| 	} | ||||
| } | ||||
|  | ||||
| func getPath(r *http.Request) string { | ||||
| // GetPath returns RawPath, if it's empty returns Path from URL | ||||
| func GetPath(r *http.Request) string { | ||||
| 	path := r.URL.RawPath | ||||
| 	if path == "" { | ||||
| 		path = r.URL.Path | ||||
|   | ||||
							
								
								
									
										13
									
								
								vendor/github.com/labstack/echo/v4/go.mod
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										13
									
								
								vendor/github.com/labstack/echo/v4/go.mod
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -1,14 +1,15 @@ | ||||
| module github.com/labstack/echo/v4 | ||||
|  | ||||
| go 1.14 | ||||
| go 1.15 | ||||
|  | ||||
| require ( | ||||
| 	github.com/dgrijalva/jwt-go v3.2.0+incompatible | ||||
| 	github.com/labstack/gommon v0.3.0 | ||||
| 	github.com/mattn/go-colorable v0.1.6 // indirect | ||||
| 	github.com/mattn/go-colorable v0.1.7 // indirect | ||||
| 	github.com/stretchr/testify v1.4.0 | ||||
| 	github.com/valyala/fasttemplate v1.1.0 | ||||
| 	golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d | ||||
| 	golang.org/x/net v0.0.0-20200226121028-0de0cce0169b | ||||
| 	golang.org/x/text v0.3.2 // indirect | ||||
| 	github.com/valyala/fasttemplate v1.2.1 | ||||
| 	golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a | ||||
| 	golang.org/x/net v0.0.0-20200822124328-c89045814202 | ||||
| 	golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6 // indirect | ||||
| 	golang.org/x/text v0.3.3 // indirect | ||||
| ) | ||||
|   | ||||
							
								
								
									
										26
									
								
								vendor/github.com/labstack/echo/v4/go.sum
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										26
									
								
								vendor/github.com/labstack/echo/v4/go.sum
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -1,14 +1,13 @@ | ||||
| github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= | ||||
| github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= | ||||
| github.com/dgrijalva/jwt-go v1.0.2 h1:KPldsxuKGsS2FPWsNeg9ZO18aCrGKujPoWXn2yo+KQM= | ||||
| github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= | ||||
| github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= | ||||
| github.com/labstack/gommon v0.3.0 h1:JEeO0bvc78PKdyHxloTKiF8BD5iGrH8T6MSeGvSgob0= | ||||
| github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= | ||||
| github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU= | ||||
| github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= | ||||
| github.com/mattn/go-colorable v0.1.6 h1:6Su7aK7lXmJ/U79bYtBjLNaha4Fs1Rg9plHpcH+vvnE= | ||||
| github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= | ||||
| 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-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= | ||||
| github.com/mattn/go-isatty v0.0.9 h1:d5US/mDsogSGW37IV293h//ZFaeajb69h+EHFsv2xGg= | ||||
| github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= | ||||
| @@ -23,14 +22,15 @@ github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6Kllzaw | ||||
| github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= | ||||
| github.com/valyala/fasttemplate v1.0.1 h1:tY9CJiPnMXf1ERmG2EyK7gNUd+c6RKGD0IfU8WdUSz8= | ||||
| github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= | ||||
| github.com/valyala/fasttemplate v1.1.0 h1:RZqt0yGBsps8NGvLSGW804QQqCUYYLsaOjTVHy1Ocw4= | ||||
| github.com/valyala/fasttemplate v1.1.0/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= | ||||
| github.com/valyala/fasttemplate v1.2.1 h1:TVEnxayobAdVkhQfrfes2IzOB6o+z4roRkPF52WA1u4= | ||||
| github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= | ||||
| golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= | ||||
| golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d h1:1ZiEyfaQIg3Qh0EoqpwAakHVhecoE5wlSg5GjnafJGw= | ||||
| golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= | ||||
| golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/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/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= | ||||
| golang.org/x/net v0.0.0-20200226121028-0de0cce0169b h1:0mm1VjtFUOIlE1SbDlwjYaDxZVDP2S5ou6y0gSgXHu8= | ||||
| golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= | ||||
| 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/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= | ||||
| golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= | ||||
| golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| @@ -39,11 +39,15 @@ golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7w | ||||
| golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae h1:/WDfKMnPU+m5M4xB+6x4kaepxRw6jWvR5iDRdvjHgy8= | ||||
| golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
| golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/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/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= | ||||
| golang.org/x/text v0.3.0/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/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= | ||||
| gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= | ||||
| gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||||
| gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= | ||||
| gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= | ||||
|   | ||||
							
								
								
									
										2
									
								
								vendor/github.com/labstack/echo/v4/group.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/labstack/echo/v4/group.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -109,7 +109,7 @@ func (g *Group) Static(prefix, root string) { | ||||
|  | ||||
| // File implements `Echo#File()` for sub-routes within the Group. | ||||
| func (g *Group) File(path, file string) { | ||||
| 	g.file(g.prefix+path, file, g.GET) | ||||
| 	g.file(path, file, g.GET) | ||||
| } | ||||
|  | ||||
| // Add implements `Echo#Add()` for sub-routes within the Group. | ||||
|   | ||||
							
								
								
									
										7
									
								
								vendor/github.com/labstack/echo/v4/middleware/compress.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										7
									
								
								vendor/github.com/labstack/echo/v4/middleware/compress.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -119,3 +119,10 @@ func (w *gzipResponseWriter) Flush() { | ||||
| func (w *gzipResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) { | ||||
| 	return w.ResponseWriter.(http.Hijacker).Hijack() | ||||
| } | ||||
|  | ||||
| func (w *gzipResponseWriter) Push(target string, opts *http.PushOptions) error { | ||||
| 	if p, ok := w.ResponseWriter.(http.Pusher); ok { | ||||
| 		return p.Push(target, opts) | ||||
| 	} | ||||
| 	return http.ErrNotSupported | ||||
| } | ||||
|   | ||||
							
								
								
									
										5
									
								
								vendor/github.com/labstack/echo/v4/middleware/proxy.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								vendor/github.com/labstack/echo/v4/middleware/proxy.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -45,6 +45,9 @@ type ( | ||||
| 		// Examples: If custom TLS certificates are required. | ||||
| 		Transport http.RoundTripper | ||||
|  | ||||
| 		// ModifyResponse defines function to modify response from ProxyTarget. | ||||
| 		ModifyResponse func(*http.Response) error | ||||
|  | ||||
| 		rewriteRegex map[*regexp.Regexp]string | ||||
| 	} | ||||
|  | ||||
| @@ -224,7 +227,7 @@ func ProxyWithConfig(config ProxyConfig) echo.MiddlewareFunc { | ||||
|  | ||||
| 			// Rewrite | ||||
| 			for k, v := range config.rewriteRegex { | ||||
| 				replacer := captureTokens(k, req.URL.Path) | ||||
| 				replacer := captureTokens(k, echo.GetPath(req)) | ||||
| 				if replacer != nil { | ||||
| 					req.URL.Path = replacer.Replace(v) | ||||
| 				} | ||||
|   | ||||
							
								
								
									
										1
									
								
								vendor/github.com/labstack/echo/v4/middleware/proxy_1_11.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								vendor/github.com/labstack/echo/v4/middleware/proxy_1_11.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -20,5 +20,6 @@ func proxyHTTP(tgt *ProxyTarget, c echo.Context, config ProxyConfig) http.Handle | ||||
| 		c.Set("_error", echo.NewHTTPError(http.StatusBadGateway, fmt.Sprintf("remote %s unreachable, could not forward: %v", desc, err))) | ||||
| 	} | ||||
| 	proxy.Transport = config.Transport | ||||
| 	proxy.ModifyResponse = config.ModifyResponse | ||||
| 	return proxy | ||||
| } | ||||
|   | ||||
							
								
								
									
										22
									
								
								vendor/github.com/labstack/echo/v4/middleware/recover.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										22
									
								
								vendor/github.com/labstack/echo/v4/middleware/recover.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -5,6 +5,7 @@ import ( | ||||
| 	"runtime" | ||||
|  | ||||
| 	"github.com/labstack/echo/v4" | ||||
| 	"github.com/labstack/gommon/log" | ||||
| ) | ||||
|  | ||||
| type ( | ||||
| @@ -25,6 +26,10 @@ type ( | ||||
| 		// DisablePrintStack disables printing stack trace. | ||||
| 		// Optional. Default value as false. | ||||
| 		DisablePrintStack bool `yaml:"disable_print_stack"` | ||||
|  | ||||
| 		// LogLevel is log level to printing stack trace. | ||||
| 		// Optional. Default value 0 (Print). | ||||
| 		LogLevel log.Lvl | ||||
| 	} | ||||
| ) | ||||
|  | ||||
| @@ -35,6 +40,7 @@ var ( | ||||
| 		StackSize:         4 << 10, // 4 KB | ||||
| 		DisableStackAll:   false, | ||||
| 		DisablePrintStack: false, | ||||
| 		LogLevel:          0, | ||||
| 	} | ||||
| ) | ||||
|  | ||||
| @@ -70,7 +76,21 @@ func RecoverWithConfig(config RecoverConfig) echo.MiddlewareFunc { | ||||
| 					stack := make([]byte, config.StackSize) | ||||
| 					length := runtime.Stack(stack, !config.DisableStackAll) | ||||
| 					if !config.DisablePrintStack { | ||||
| 						c.Logger().Printf("[PANIC RECOVER] %v %s\n", err, stack[:length]) | ||||
| 						msg := fmt.Sprintf("[PANIC RECOVER] %v %s\n", err, stack[:length]) | ||||
| 						switch config.LogLevel { | ||||
| 						case log.DEBUG: | ||||
| 							c.Logger().Debug(msg) | ||||
| 						case log.INFO: | ||||
| 							c.Logger().Info(msg) | ||||
| 						case log.WARN: | ||||
| 							c.Logger().Warn(msg) | ||||
| 						case log.ERROR: | ||||
| 							c.Logger().Error(msg) | ||||
| 						case log.OFF: | ||||
| 							// None. | ||||
| 						default: | ||||
| 							c.Logger().Print(msg) | ||||
| 						} | ||||
| 					} | ||||
| 					c.Error(err) | ||||
| 				} | ||||
|   | ||||
							
								
								
									
										4
									
								
								vendor/github.com/labstack/echo/v4/router.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								vendor/github.com/labstack/echo/v4/router.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -355,6 +355,10 @@ func (r *Router) Find(method, path string, c Context) { | ||||
|  | ||||
| 		// Attempt to go back up the tree on no matching prefix or no remaining search | ||||
| 		if l != pl || search == "" { | ||||
| 			// Handle special case of trailing slash route with existing any route (see #1526) | ||||
| 			if path[len(path)-1] == '/' && cn.findChildByKind(akind) != nil { | ||||
| 				goto Any | ||||
| 			} | ||||
| 			if nn == nil { // Issue #1348 | ||||
| 				return // Not found | ||||
| 			} | ||||
|   | ||||
							
								
								
									
										21
									
								
								vendor/github.com/matrix-org/gomatrix/.golangci.yml
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								vendor/github.com/matrix-org/gomatrix/.golangci.yml
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,21 @@ | ||||
| run: | ||||
|   timeout: 5m | ||||
|   linters: | ||||
|     enable: | ||||
|       - vet | ||||
|       - vetshadow | ||||
|       - typecheck | ||||
|       - deadcode | ||||
|       - gocyclo | ||||
|       - golint | ||||
|       - varcheck | ||||
|       - structcheck | ||||
|       - maligned | ||||
|       - ineffassign | ||||
|       - misspell | ||||
|       - unparam | ||||
|       - goimports | ||||
|       - goconst | ||||
|       - unconvert | ||||
|       - errcheck | ||||
|       - interfacer | ||||
							
								
								
									
										7
									
								
								vendor/github.com/matrix-org/gomatrix/.travis.yml
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								vendor/github.com/matrix-org/gomatrix/.travis.yml
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | ||||
| language: go | ||||
| go: | ||||
|  - 1.13.10 | ||||
| install: | ||||
|  - go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.24.0 | ||||
|  - go build | ||||
| script: ./hooks/pre-commit | ||||
| @@ -55,10 +55,7 @@ func (e HTTPError) Error() string { | ||||
| 
 | ||||
| // BuildURL builds a URL with the Client's homserver/prefix/access_token set already. | ||||
| func (cli *Client) BuildURL(urlPath ...string) string { | ||||
| 	ps := []string{cli.Prefix} | ||||
| 	for _, p := range urlPath { | ||||
| 		ps = append(ps, p) | ||||
| 	} | ||||
| 	ps := append([]string{cli.Prefix}, urlPath...) | ||||
| 	return cli.BuildBaseURL(ps...) | ||||
| } | ||||
| 
 | ||||
| @@ -357,7 +354,7 @@ func (cli *Client) Login(req *ReqLogin) (resp *RespLogin, err error) { | ||||
| 	return | ||||
| } | ||||
| 
 | ||||
| // Logout the current user. See http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-logout | ||||
| // Logout the current user. See http://matrix.org/docs/spec/client_server/r0.6.0.html#post-matrix-client-r0-logout | ||||
| // This does not clear the credentials from the client instance. See ClearCredentials() instead. | ||||
| func (cli *Client) Logout() (resp *RespLogout, err error) { | ||||
| 	urlPath := cli.BuildURL("logout") | ||||
| @@ -365,6 +362,14 @@ func (cli *Client) Logout() (resp *RespLogout, err error) { | ||||
| 	return | ||||
| } | ||||
| 
 | ||||
| // LogoutAll logs the current user out on all devices. See https://matrix.org/docs/spec/client_server/r0.6.0#post-matrix-client-r0-logout-all | ||||
| // This does not clear the credentials from the client instance. See ClearCredentails() instead. | ||||
| func (cli *Client) LogoutAll() (resp *RespLogoutAll, err error) { | ||||
| 	urlPath := cli.BuildURL("logout/all") | ||||
| 	err = cli.MakeRequest("POST", urlPath, nil, &resp) | ||||
| 	return | ||||
| } | ||||
| 
 | ||||
| // Versions returns the list of supported Matrix versions on this homeserver. See http://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-versions | ||||
| func (cli *Client) Versions() (resp *RespVersions, err error) { | ||||
| 	urlPath := cli.BuildBaseURL("_matrix", "client", "versions") | ||||
| @@ -475,21 +480,6 @@ func (cli *Client) GetAvatarURL() (string, error) { | ||||
| 	return s.AvatarURL, nil | ||||
| } | ||||
| 
 | ||||
| // GetAvatarURL gets the user's avatar URL. See http://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-profile-userid-avatar-url | ||||
| func (cli *Client) GetSenderAvatarURL(sender string) (string, error) { | ||||
| 	urlPath := cli.BuildURL("profile", sender, "avatar_url") | ||||
| 	s := struct { | ||||
| 		AvatarURL string `json:"avatar_url"` | ||||
| 	}{} | ||||
| 
 | ||||
| 	err := cli.MakeRequest("GET", urlPath, nil, &s) | ||||
| 	if err != nil { | ||||
| 		return "", err | ||||
| 	} | ||||
| 
 | ||||
| 	return s.AvatarURL, nil | ||||
| } | ||||
| 
 | ||||
| // SetAvatarURL sets the user's avatar URL. See http://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-profile-userid-avatar-url | ||||
| func (cli *Client) SetAvatarURL(url string) error { | ||||
| 	urlPath := cli.BuildURL("profile", cli.UserID, "avatar_url") | ||||
| @@ -504,6 +494,29 @@ func (cli *Client) SetAvatarURL(url string) error { | ||||
| 	return nil | ||||
| } | ||||
| 
 | ||||
| // GetStatus returns the status of the user from the specified MXID. See https://matrix.org/docs/spec/client_server/r0.6.0#get-matrix-client-r0-presence-userid-status | ||||
| func (cli *Client) GetStatus(mxid string) (resp *RespUserStatus, err error) { | ||||
| 	urlPath := cli.BuildURL("presence", mxid, "status") | ||||
| 	err = cli.MakeRequest("GET", urlPath, nil, &resp) | ||||
| 	return | ||||
| } | ||||
| 
 | ||||
| // GetOwnStatus returns the user's status. See https://matrix.org/docs/spec/client_server/r0.6.0#get-matrix-client-r0-presence-userid-status | ||||
| func (cli *Client) GetOwnStatus() (resp *RespUserStatus, err error) { | ||||
| 	return cli.GetStatus(cli.UserID) | ||||
| } | ||||
| 
 | ||||
| // SetStatus sets the user's status. See https://matrix.org/docs/spec/client_server/r0.6.0#put-matrix-client-r0-presence-userid-status | ||||
| func (cli *Client) SetStatus(presence, status string) (err error) { | ||||
| 	urlPath := cli.BuildURL("presence", cli.UserID, "status") | ||||
| 	s := struct { | ||||
| 		Presence  string `json:"presence"` | ||||
| 		StatusMsg string `json:"status_msg"` | ||||
| 	}{presence, status} | ||||
| 	err = cli.MakeRequest("PUT", urlPath, &s, nil) | ||||
| 	return | ||||
| } | ||||
| 
 | ||||
| // SendMessageEvent sends a message event into a room. See http://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-rooms-roomid-send-eventtype-txnid | ||||
| // contentJSON should be a pointer to something that can be encoded as JSON using json.Marshal. | ||||
| func (cli *Client) SendMessageEvent(roomID string, eventType string, contentJSON interface{}) (resp *RespSendEvent, err error) { | ||||
| @@ -525,12 +538,14 @@ func (cli *Client) SendStateEvent(roomID, eventType, stateKey string, contentJSO | ||||
| // See http://matrix.org/docs/spec/client_server/r0.2.0.html#m-text | ||||
| func (cli *Client) SendText(roomID, text string) (*RespSendEvent, error) { | ||||
| 	return cli.SendMessageEvent(roomID, "m.room.message", | ||||
| 		TextMessage{"m.text", text, "", ""}) | ||||
| 		TextMessage{MsgType: "m.text", Body: text}) | ||||
| } | ||||
| 
 | ||||
| func (cli *Client) SendHTML(roomID, textclear, text string) (*RespSendEvent, error) { | ||||
| // SendFormattedText sends an m.room.message event into the given room with a msgtype of m.text, supports a subset of HTML for formatting. | ||||
| // See https://matrix.org/docs/spec/client_server/r0.6.0#m-text | ||||
| func (cli *Client) SendFormattedText(roomID, text, formattedText string) (*RespSendEvent, error) { | ||||
| 	return cli.SendMessageEvent(roomID, "m.room.message", | ||||
| 		TextMessage{"m.text", textclear, "org.matrix.custom.html", text}) | ||||
| 		TextMessage{MsgType: "m.text", Body: text, FormattedBody: formattedText, Format: "org.matrix.custom.html"}) | ||||
| } | ||||
| 
 | ||||
| // SendImage sends an m.room.message event into the given room with a msgtype of m.image | ||||
| @@ -555,46 +570,11 @@ func (cli *Client) SendVideo(roomID, body, url string) (*RespSendEvent, error) { | ||||
| 		}) | ||||
| } | ||||
| 
 | ||||
| // SendAudio sends an m.room.message event into the given room with a msgtype of m.audio | ||||
| // See https://matrix.org/docs/spec/client_server/r0.2.0.html#m-audio | ||||
| func (cli *Client) SendAudio(roomID, body, url, mimetype string, size uint) (*RespSendEvent, error) { | ||||
| 	return cli.SendMessageEvent(roomID, "m.room.message", | ||||
| 		AudioMessage{ | ||||
| 			MsgType: "m.audio", | ||||
| 			Body:    body, | ||||
| 			URL:     url, | ||||
| 			Info: AudioInfo{ | ||||
| 				Size:     size, | ||||
| 				Mimetype: mimetype, | ||||
| 			}, | ||||
| 		}) | ||||
| } | ||||
| 
 | ||||
| // SendFile sends an m.room.message event into the given room with a msgtype of m.file | ||||
| // See https://matrix.org/docs/spec/client_server/r0.2.0.html#m-file | ||||
| func (cli *Client) SendFile(roomID, body, url, mimetype string, size uint) (*RespSendEvent, error) { | ||||
| 	return cli.SendMessageEvent(roomID, "m.room.message", | ||||
| 		FileMessage{ | ||||
| 			MsgType: "m.file", | ||||
| 			Body:    body, | ||||
| 			URL:     url, | ||||
| 			Info: FileInfo{ | ||||
| 				Size:     size, | ||||
| 				Mimetype: mimetype, | ||||
| 			}, | ||||
| 		}) | ||||
| } | ||||
| 
 | ||||
| // SendNotice sends an m.room.message event into the given room with a msgtype of m.notice | ||||
| // See http://matrix.org/docs/spec/client_server/r0.2.0.html#m-notice | ||||
| func (cli *Client) SendNotice(roomID, text string) (*RespSendEvent, error) { | ||||
| 	return cli.SendMessageEvent(roomID, "m.room.message", | ||||
| 		TextMessage{"m.notice", text, "", ""}) | ||||
| } | ||||
| 
 | ||||
| func (cli *Client) SendNoticeHTML(roomID, textclear, text string) (*RespSendEvent, error) { | ||||
| 	return cli.SendMessageEvent(roomID, "m.room.message", | ||||
| 		TextMessage{"m.notice", textclear, "org.matrix.custom.html", text}) | ||||
| 		TextMessage{MsgType: "m.notice", Body: text}) | ||||
| } | ||||
| 
 | ||||
| // RedactEvent redacts the given event. See http://matrix.org/docs/spec/client_server/r0.2.0.html#put-matrix-client-r0-rooms-roomid-redact-eventid-txnid | ||||
| @@ -605,6 +585,12 @@ func (cli *Client) RedactEvent(roomID, eventID string, req *ReqRedact) (resp *Re | ||||
| 	return | ||||
| } | ||||
| 
 | ||||
| // MarkRead marks eventID in roomID as read, signifying the event, and all before it have been read. See https://matrix.org/docs/spec/client_server/r0.6.0#post-matrix-client-r0-rooms-roomid-receipt-receipttype-eventid | ||||
| func (cli *Client) MarkRead(roomID, eventID string) error { | ||||
| 	urlPath := cli.BuildURL("rooms", roomID, "receipt", "m.read", eventID) | ||||
| 	return cli.MakeRequest("POST", urlPath, nil, nil) | ||||
| } | ||||
| 
 | ||||
| // CreateRoom creates a new Matrix room. See https://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-createroom | ||||
| //  resp, err := cli.CreateRoom(&gomatrix.ReqCreateRoom{ | ||||
| //  	Preset: "public_chat", | ||||
| @@ -45,8 +45,8 @@ func (event *Event) MessageType() (msgtype string, ok bool) { | ||||
| type TextMessage struct { | ||||
| 	MsgType       string `json:"msgtype"` | ||||
| 	Body          string `json:"body"` | ||||
| 	Format        string `json:"format,omitempty"` | ||||
| 	FormattedBody string `json:"formatted_body,omitempty"` | ||||
| 	FormattedBody string `json:"formatted_body"` | ||||
| 	Format        string `json:"format"` | ||||
| } | ||||
| 
 | ||||
| // ThumbnailInfo contains info about an thumbnail image - http://matrix.org/docs/spec/client_server/r0.2.0.html#m-image | ||||
| @@ -78,21 +78,6 @@ type VideoInfo struct { | ||||
| 	Size          uint          `json:"size,omitempty"` | ||||
| } | ||||
| 
 | ||||
| // AudioInfo contains info about a file - http://matrix.org/docs/spec/client_server/r0.2.0.html#m-audio | ||||
| type AudioInfo struct { | ||||
| 	Mimetype string `json:"mimetype,omitempty"` | ||||
| 	Size     uint   `json:"size,omitempty"` | ||||
| 	Duration uint   `json:"duration,omitempty"` | ||||
| } | ||||
| 
 | ||||
| // FileInfo contains info about a file - http://matrix.org/docs/spec/client_server/r0.2.0.html#m-file | ||||
| type FileInfo struct { | ||||
| 	Mimetype      string    `json:"mimetype,omitempty"` | ||||
| 	ThumbnailInfo ImageInfo `json:"thumbnail_info"` | ||||
| 	ThumbnailURL  string    `json:"thumbnail_url,omitempty"` | ||||
| 	Size          uint      `json:"size,omitempty"` | ||||
| } | ||||
| 
 | ||||
| // VideoMessage is an m.video  - http://matrix.org/docs/spec/client_server/r0.2.0.html#m-video | ||||
| type VideoMessage struct { | ||||
| 	MsgType string    `json:"msgtype"` | ||||
| @@ -109,22 +94,6 @@ type ImageMessage struct { | ||||
| 	Info    ImageInfo `json:"info"` | ||||
| } | ||||
| 
 | ||||
| // AudioMessage is an m.audio event | ||||
| type AudioMessage struct { | ||||
| 	MsgType string    `json:"msgtype"` | ||||
| 	Body    string    `json:"body"` | ||||
| 	URL     string    `json:"url"` | ||||
| 	Info    AudioInfo `json:"info"` | ||||
| } | ||||
| 
 | ||||
| // FileMessage is a m.file event | ||||
| type FileMessage struct { | ||||
| 	MsgType string   `json:"msgtype"` | ||||
| 	Body    string   `json:"body"` | ||||
| 	URL     string   `json:"url"` | ||||
| 	Info    FileInfo `json:"info"` | ||||
| } | ||||
| 
 | ||||
| // An HTMLMessage is the contents of a Matrix HTML formated message event. | ||||
| type HTMLMessage struct { | ||||
| 	Body          string `json:"body"` | ||||
| @@ -133,6 +102,47 @@ type HTMLMessage struct { | ||||
| 	FormattedBody string `json:"formatted_body"` | ||||
| } | ||||
| 
 | ||||
| // FileInfo contains info about an file - http://matrix.org/docs/spec/client_server/r0.2.0.html#m-file | ||||
| type FileInfo struct { | ||||
| 	Mimetype string `json:"mimetype,omitempty"` | ||||
| 	Size     uint   `json:"size,omitempty"` //filesize in bytes | ||||
| } | ||||
| 
 | ||||
| // FileMessage is an m.file event - http://matrix.org/docs/spec/client_server/r0.2.0.html#m-file | ||||
| type FileMessage struct { | ||||
| 	MsgType       string    `json:"msgtype"` | ||||
| 	Body          string    `json:"body"` | ||||
| 	URL           string    `json:"url"` | ||||
| 	Filename      string    `json:"filename"` | ||||
| 	Info          FileInfo  `json:"info,omitempty"` | ||||
| 	ThumbnailURL  string    `json:"thumbnail_url,omitempty"` | ||||
| 	ThumbnailInfo ImageInfo `json:"thumbnail_info,omitempty"` | ||||
| } | ||||
| 
 | ||||
| // LocationMessage is an m.location event - http://matrix.org/docs/spec/client_server/r0.2.0.html#m-location | ||||
| type LocationMessage struct { | ||||
| 	MsgType       string    `json:"msgtype"` | ||||
| 	Body          string    `json:"body"` | ||||
| 	GeoURI        string    `json:"geo_uri"` | ||||
| 	ThumbnailURL  string    `json:"thumbnail_url,omitempty"` | ||||
| 	ThumbnailInfo ImageInfo `json:"thumbnail_info,omitempty"` | ||||
| } | ||||
| 
 | ||||
| // AudioInfo contains info about an file - http://matrix.org/docs/spec/client_server/r0.2.0.html#m-audio | ||||
| type AudioInfo struct { | ||||
| 	Mimetype string `json:"mimetype,omitempty"` | ||||
| 	Size     uint   `json:"size,omitempty"`     //filesize in bytes | ||||
| 	Duration uint   `json:"duration,omitempty"` //audio duration in ms | ||||
| } | ||||
| 
 | ||||
| // AudioMessage is an m.audio event - http://matrix.org/docs/spec/client_server/r0.2.0.html#m-audio | ||||
| type AudioMessage struct { | ||||
| 	MsgType string    `json:"msgtype"` | ||||
| 	Body    string    `json:"body"` | ||||
| 	URL     string    `json:"url"` | ||||
| 	Info    AudioInfo `json:"info,omitempty"` | ||||
| } | ||||
| 
 | ||||
| var htmlRegex = regexp.MustCompile("<[^<]+?>") | ||||
| 
 | ||||
| // GetHTMLMessage returns an HTMLMessage with the body set to a stripped version of the provided HTML, in addition | ||||
							
								
								
									
										3
									
								
								vendor/github.com/matrix-org/gomatrix/go.mod
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								vendor/github.com/matrix-org/gomatrix/go.mod
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,3 @@ | ||||
| module github.com/matrix-org/gomatrix | ||||
|  | ||||
| go 1.12 | ||||
							
								
								
									
										69
									
								
								vendor/github.com/matrix-org/gomatrix/identifier.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										69
									
								
								vendor/github.com/matrix-org/gomatrix/identifier.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,69 @@ | ||||
| package gomatrix | ||||
|  | ||||
| // Identifier is the interface for https://matrix.org/docs/spec/client_server/r0.6.0#identifier-types | ||||
| type Identifier interface { | ||||
| 	// Returns the identifier type | ||||
| 	// https://matrix.org/docs/spec/client_server/r0.6.0#identifier-types | ||||
| 	Type() string | ||||
| } | ||||
|  | ||||
| // UserIdentifier is the Identifier for https://matrix.org/docs/spec/client_server/r0.6.0#matrix-user-id | ||||
| type UserIdentifier struct { | ||||
| 	IDType string `json:"type"` // Set by NewUserIdentifer | ||||
| 	User   string `json:"user"` | ||||
| } | ||||
|  | ||||
| // Type implements the Identifier interface | ||||
| func (i UserIdentifier) Type() string { | ||||
| 	return "m.id.user" | ||||
| } | ||||
|  | ||||
| // NewUserIdentifier creates a new UserIdentifier with IDType set to "m.id.user" | ||||
| func NewUserIdentifier(user string) UserIdentifier { | ||||
| 	return UserIdentifier{ | ||||
| 		IDType: "m.id.user", | ||||
| 		User:   user, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // ThirdpartyIdentifier is the Identifier for https://matrix.org/docs/spec/client_server/r0.6.0#third-party-id | ||||
| type ThirdpartyIdentifier struct { | ||||
| 	IDType  string `json:"type"` // Set by NewThirdpartyIdentifier | ||||
| 	Medium  string `json:"medium"` | ||||
| 	Address string `json:"address"` | ||||
| } | ||||
|  | ||||
| // Type implements the Identifier interface | ||||
| func (i ThirdpartyIdentifier) Type() string { | ||||
| 	return "m.id.thirdparty" | ||||
| } | ||||
|  | ||||
| // NewThirdpartyIdentifier creates a new UserIdentifier with IDType set to "m.id.user" | ||||
| func NewThirdpartyIdentifier(medium, address string) ThirdpartyIdentifier { | ||||
| 	return ThirdpartyIdentifier{ | ||||
| 		IDType:  "m.id.thirdparty", | ||||
| 		Medium:  medium, | ||||
| 		Address: address, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // PhoneIdentifier is the Identifier for https://matrix.org/docs/spec/client_server/r0.6.0#phone-number | ||||
| type PhoneIdentifier struct { | ||||
| 	IDType  string `json:"type"` // Set by NewPhoneIdentifier | ||||
| 	Country string `json:"country"` | ||||
| 	Phone   string `json:"phone"` | ||||
| } | ||||
|  | ||||
| // Type implements the Identifier interface | ||||
| func (i PhoneIdentifier) Type() string { | ||||
| 	return "m.id.phone" | ||||
| } | ||||
|  | ||||
| // NewPhoneIdentifier creates a new UserIdentifier with IDType set to "m.id.user" | ||||
| func NewPhoneIdentifier(country, phone string) PhoneIdentifier { | ||||
| 	return PhoneIdentifier{ | ||||
| 		IDType:  "m.id.phone", | ||||
| 		Country: country, | ||||
| 		Phone:   phone, | ||||
| 	} | ||||
| } | ||||
| @@ -10,16 +10,17 @@ type ReqRegister struct { | ||||
| 	Auth                     interface{} `json:"auth,omitempty"` | ||||
| } | ||||
| 
 | ||||
| // ReqLogin is the JSON request for http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-login | ||||
| // ReqLogin is the JSON request for http://matrix.org/docs/spec/client_server/r0.6.0.html#post-matrix-client-r0-login | ||||
| type ReqLogin struct { | ||||
| 	Type                     string `json:"type"` | ||||
| 	Password                 string `json:"password,omitempty"` | ||||
| 	Medium                   string `json:"medium,omitempty"` | ||||
| 	User                     string `json:"user,omitempty"` | ||||
| 	Address                  string `json:"address,omitempty"` | ||||
| 	Token                    string `json:"token,omitempty"` | ||||
| 	DeviceID                 string `json:"device_id,omitempty"` | ||||
| 	InitialDeviceDisplayName string `json:"initial_device_display_name,omitempty"` | ||||
| 	Type                     string     `json:"type"` | ||||
| 	Identifier               Identifier `json:"identifier,omitempty"` | ||||
| 	Password                 string     `json:"password,omitempty"` | ||||
| 	Medium                   string     `json:"medium,omitempty"` | ||||
| 	User                     string     `json:"user,omitempty"` | ||||
| 	Address                  string     `json:"address,omitempty"` | ||||
| 	Token                    string     `json:"token,omitempty"` | ||||
| 	DeviceID                 string     `json:"device_id,omitempty"` | ||||
| 	InitialDeviceDisplayName string     `json:"initial_device_display_name,omitempty"` | ||||
| } | ||||
| 
 | ||||
| // ReqCreateRoom is the JSON request for https://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-createroom | ||||
| @@ -113,6 +113,14 @@ type RespUserDisplayName struct { | ||||
| 	DisplayName string `json:"displayname"` | ||||
| } | ||||
| 
 | ||||
| // RespUserStatus is the JSON response for https://matrix.org/docs/spec/client_server/r0.6.0#get-matrix-client-r0-presence-userid-status | ||||
| type RespUserStatus struct { | ||||
| 	Presence        string `json:"presence"` | ||||
| 	StatusMsg       string `json:"status_msg"` | ||||
| 	LastActiveAgo   int    `json:"last_active_ago"` | ||||
| 	CurrentlyActive bool   `json:"currently_active"` | ||||
| } | ||||
| 
 | ||||
| // RespRegister is the JSON response for http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-register | ||||
| type RespRegister struct { | ||||
| 	AccessToken  string `json:"access_token"` | ||||
| @@ -122,17 +130,31 @@ type RespRegister struct { | ||||
| 	UserID       string `json:"user_id"` | ||||
| } | ||||
| 
 | ||||
| // RespLogin is the JSON response for http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-login | ||||
| // RespLogin is the JSON response for http://matrix.org/docs/spec/client_server/r0.6.0.html#post-matrix-client-r0-login | ||||
| type RespLogin struct { | ||||
| 	AccessToken string `json:"access_token"` | ||||
| 	DeviceID    string `json:"device_id"` | ||||
| 	HomeServer  string `json:"home_server"` | ||||
| 	UserID      string `json:"user_id"` | ||||
| 	AccessToken string               `json:"access_token"` | ||||
| 	DeviceID    string               `json:"device_id"` | ||||
| 	HomeServer  string               `json:"home_server"` | ||||
| 	UserID      string               `json:"user_id"` | ||||
| 	WellKnown   DiscoveryInformation `json:"well_known"` | ||||
| } | ||||
| 
 | ||||
| // RespLogout is the JSON response for http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-logout | ||||
| // DiscoveryInformation is the JSON Response for https://matrix.org/docs/spec/client_server/r0.6.0#get-well-known-matrix-client and a part of the JSON Response for https://matrix.org/docs/spec/client_server/r0.6.0#post-matrix-client-r0-login | ||||
| type DiscoveryInformation struct { | ||||
| 	Homeserver struct { | ||||
| 		BaseURL string `json:"base_url"` | ||||
| 	} `json:"m.homeserver"` | ||||
| 	IdentityServer struct { | ||||
| 		BaseURL string `json:"base_url"` | ||||
| 	} `json:"m.identitiy_server"` | ||||
| } | ||||
| 
 | ||||
| // RespLogout is the JSON response for http://matrix.org/docs/spec/client_server/r0.6.0.html#post-matrix-client-r0-logout | ||||
| type RespLogout struct{} | ||||
| 
 | ||||
| // RespLogoutAll is the JSON response for https://matrix.org/docs/spec/client_server/r0.6.0#post-matrix-client-r0-logout-all | ||||
| type RespLogoutAll struct{} | ||||
| 
 | ||||
| // RespCreateRoom is the JSON response for https://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-createroom | ||||
| type RespCreateRoom struct { | ||||
| 	RoomID string `json:"room_id"` | ||||
| @@ -167,6 +189,9 @@ type RespSync struct { | ||||
| 				Limited   bool    `json:"limited"` | ||||
| 				PrevBatch string  `json:"prev_batch"` | ||||
| 			} `json:"timeline"` | ||||
| 			Ephemeral struct { | ||||
| 				Events []Event `json:"events"` | ||||
| 			} `json:"ephemeral"` | ||||
| 		} `json:"join"` | ||||
| 		Invite map[string]struct { | ||||
| 			State struct { | ||||
| @@ -31,8 +31,8 @@ func (room Room) UpdateState(event *Event) { | ||||
| 
 | ||||
| // GetStateEvent returns the state event for the given type/state_key combo, or nil. | ||||
| func (room Room) GetStateEvent(eventType string, stateKey string) *Event { | ||||
| 	stateEventMap, _ := room.State[eventType] | ||||
| 	event, _ := stateEventMap[stateKey] | ||||
| 	stateEventMap := room.State[eventType] | ||||
| 	event := stateEventMap[stateKey] | ||||
| 	return event | ||||
| } | ||||
| 
 | ||||
| @@ -64,6 +64,10 @@ func (s *DefaultSyncer) ProcessResponse(res *RespSync, since string) (err error) | ||||
| 			event.RoomID = roomID | ||||
| 			s.notifyListeners(&event) | ||||
| 		} | ||||
| 		for _, event := range roomData.Ephemeral.Events { | ||||
| 			event.RoomID = roomID | ||||
| 			s.notifyListeners(&event) | ||||
| 		} | ||||
| 	} | ||||
| 	for roomID, roomData := range res.Rooms.Invite { | ||||
| 		room := s.getOrCreateRoom(roomID) | ||||
							
								
								
									
										4
									
								
								vendor/github.com/matterbridge/discordgo/.travis.yml
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								vendor/github.com/matterbridge/discordgo/.travis.yml
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -1,9 +1,11 @@ | ||||
| language: go | ||||
| go: | ||||
|     - 1.10.x | ||||
|     - 1.11.x | ||||
|     - 1.12.x | ||||
|     - 1.13.x | ||||
|     - 1.14.x | ||||
| env: | ||||
|     - GO111MODULE=on | ||||
| install: | ||||
|     - go get github.com/bwmarrin/discordgo | ||||
|     - go get -v . | ||||
|   | ||||
							
								
								
									
										31
									
								
								vendor/github.com/matterbridge/discordgo/README.md
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										31
									
								
								vendor/github.com/matterbridge/discordgo/README.md
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -26,41 +26,17 @@ Gophers](https://discord.gg/0f1SbxBZjYq9jLBk) chat server.** | ||||
|  | ||||
| ## Getting Started | ||||
|  | ||||
| ### master vs develop Branch | ||||
| * The master branch represents the latest released version of DiscordGo.  This | ||||
| branch will always have a stable and tested version of the library. Each release | ||||
| is tagged and you can easily download a specific release and view release notes | ||||
| on the github [releases](https://github.com/bwmarrin/discordgo/releases) page. | ||||
|  | ||||
| * The develop branch is where all development happens and almost always has | ||||
| new features over the master branch.  However breaking changes are frequently | ||||
| added to develop and even sometimes bugs are introduced.  Bugs get fixed and  | ||||
| the breaking changes get documented before pushing to master.   | ||||
|  | ||||
| *So, what should you use?* | ||||
|  | ||||
| If you can accept the constant changing nature of *develop*, it is the  | ||||
| recommended branch to use.  Otherwise, if you want to tail behind development | ||||
| slightly and have a more stable package with documented releases, use *master*. | ||||
|  | ||||
| ### Installing | ||||
|  | ||||
| This assumes you already have a working Go environment, if not please see | ||||
| [this page](https://golang.org/doc/install) first. | ||||
|  | ||||
| `go get` *will always pull the latest released version from the master branch.* | ||||
| `go get` *will always pull the latest tagged release from the master branch.* | ||||
|  | ||||
| ```sh | ||||
| go get github.com/bwmarrin/discordgo | ||||
| ``` | ||||
|  | ||||
| If you want to use the develop branch, follow these steps next. | ||||
|  | ||||
| ```sh | ||||
| cd $GOPATH/src/github.com/bwmarrin/discordgo | ||||
| git checkout develop | ||||
| ``` | ||||
|  | ||||
| ### Usage | ||||
|  | ||||
| Import the package into your project. | ||||
| @@ -81,7 +57,7 @@ See Documentation and Examples below for more detailed information. | ||||
|  | ||||
| ## Documentation | ||||
|  | ||||
| **NOTICE** : This library and the Discord API are unfinished. | ||||
| **NOTICE**: This library and the Discord API are unfinished. | ||||
| Because of that there may be major changes to library in the future. | ||||
|  | ||||
| The DiscordGo code is fairly well documented at this point and is currently | ||||
| @@ -112,12 +88,11 @@ Contributions are very welcomed, however please follow the below guidelines. | ||||
|  | ||||
| - First open an issue describing the bug or enhancement so it can be | ||||
| discussed.   | ||||
| - Fork the develop branch and make your changes.   | ||||
| - Try to match current naming conventions as closely as possible.   | ||||
| - This package is intended to be a low level direct mapping of the Discord API,  | ||||
| so please avoid adding enhancements outside of that scope without first  | ||||
| discussing it. | ||||
| - Create a Pull Request with your changes against the develop branch. | ||||
| - Create a Pull Request with your changes against the master branch. | ||||
|  | ||||
|  | ||||
| ## List of Discord APIs | ||||
|   | ||||
							
								
								
									
										2
									
								
								vendor/github.com/matterbridge/discordgo/discord.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/matterbridge/discordgo/discord.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -22,7 +22,7 @@ import ( | ||||
| ) | ||||
|  | ||||
| // VERSION of DiscordGo, follows Semantic Versioning. (http://semver.org/) | ||||
| const VERSION = "0.21.1" | ||||
| const VERSION = "0.22.0" | ||||
|  | ||||
| // ErrMFA will be risen by New when the user has 2FA. | ||||
| var ErrMFA = errors.New("account has 2FA enabled") | ||||
|   | ||||
							
								
								
									
										45
									
								
								vendor/github.com/matterbridge/discordgo/message.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										45
									
								
								vendor/github.com/matterbridge/discordgo/message.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -16,6 +16,7 @@ import ( | ||||
| ) | ||||
|  | ||||
| // MessageType is the type of Message | ||||
| // https://discord.com/developers/docs/resources/channel#message-object-message-types | ||||
| type MessageType int | ||||
|  | ||||
| // Block contains the valid known MessageType values | ||||
| @@ -33,6 +34,8 @@ const ( | ||||
| 	MessageTypeUserPremiumGuildSubscriptionTierTwo | ||||
| 	MessageTypeUserPremiumGuildSubscriptionTierThree | ||||
| 	MessageTypeChannelFollowAdd | ||||
| 	MessageTypeGuildDiscoveryDisqualified | ||||
| 	MessageTypeGuildDiscoveryRequalified | ||||
| ) | ||||
|  | ||||
| // A Message stores all data related to a specific Discord message. | ||||
| @@ -117,9 +120,22 @@ type Message struct { | ||||
| 	// The flags of the message, which describe extra features of a message. | ||||
| 	// This is a combination of bit masks; the presence of a certain permission can | ||||
| 	// be checked by performing a bitwise AND between this int and the flag. | ||||
| 	Flags int `json:"flags"` | ||||
| 	Flags MessageFlags `json:"flags"` | ||||
| } | ||||
|  | ||||
| // MessageFlags is the flags of "message" (see MessageFlags* consts) | ||||
| // https://discord.com/developers/docs/resources/channel#message-object-message-flags | ||||
| type MessageFlags int | ||||
|  | ||||
| // Valid MessageFlags values | ||||
| const ( | ||||
| 	MessageFlagsCrossPosted MessageFlags = 1 << iota | ||||
| 	MessageFlagsIsCrossPosted | ||||
| 	MessageFlagsSupressEmbeds | ||||
| 	MessageFlagsSourceMessageDeleted | ||||
| 	MessageFlagsUrgent | ||||
| ) | ||||
|  | ||||
| // File stores info about files you e.g. send in messages. | ||||
| type File struct { | ||||
| 	Name        string | ||||
| @@ -245,10 +261,9 @@ type MessageEmbedThumbnail struct { | ||||
|  | ||||
| // MessageEmbedVideo is a part of a MessageEmbed struct. | ||||
| type MessageEmbedVideo struct { | ||||
| 	URL      string `json:"url,omitempty"` | ||||
| 	ProxyURL string `json:"proxy_url,omitempty"` | ||||
| 	Width    int    `json:"width,omitempty"` | ||||
| 	Height   int    `json:"height,omitempty"` | ||||
| 	URL    string `json:"url,omitempty"` | ||||
| 	Width  int    `json:"width,omitempty"` | ||||
| 	Height int    `json:"height,omitempty"` | ||||
| } | ||||
|  | ||||
| // MessageEmbedProvider is a part of a MessageEmbed struct. | ||||
| @@ -275,7 +290,7 @@ type MessageEmbedField struct { | ||||
| // An MessageEmbed stores data for message embeds. | ||||
| type MessageEmbed struct { | ||||
| 	URL         string                 `json:"url,omitempty"` | ||||
| 	Type        string                 `json:"type,omitempty"` | ||||
| 	Type        EmbedType              `json:"type,omitempty"` | ||||
| 	Title       string                 `json:"title,omitempty"` | ||||
| 	Description string                 `json:"description,omitempty"` | ||||
| 	Timestamp   string                 `json:"timestamp,omitempty"` | ||||
| @@ -289,6 +304,20 @@ type MessageEmbed struct { | ||||
| 	Fields      []*MessageEmbedField   `json:"fields,omitempty"` | ||||
| } | ||||
|  | ||||
| // EmbedType is the type of embed | ||||
| // https://discord.com/developers/docs/resources/channel#embed-object-embed-types | ||||
| type EmbedType string | ||||
|  | ||||
| // Block of valid EmbedTypes | ||||
| const ( | ||||
| 	EmbedTypeRich    EmbedType = "rich" | ||||
| 	EmbedTypeImage   EmbedType = "image" | ||||
| 	EmbedTypeVideo   EmbedType = "video" | ||||
| 	EmbedTypeGifv    EmbedType = "gifv" | ||||
| 	EmbedTypeArticle EmbedType = "article" | ||||
| 	EmbedTypeLink    EmbedType = "link" | ||||
| ) | ||||
|  | ||||
| // MessageReactions holds a reactions object for a message. | ||||
| type MessageReactions struct { | ||||
| 	Count int    `json:"count"` | ||||
| @@ -307,7 +336,7 @@ type MessageActivityType int | ||||
|  | ||||
| // Constants for the different types of Message Activity | ||||
| const ( | ||||
| 	MessageActivityTypeJoin = iota + 1 | ||||
| 	MessageActivityTypeJoin MessageActivityType = iota + 1 | ||||
| 	MessageActivityTypeSpectate | ||||
| 	MessageActivityTypeListen | ||||
| 	MessageActivityTypeJoinRequest | ||||
| @@ -319,7 +348,7 @@ type MessageFlag int | ||||
| // Constants for the different bit offsets of Message Flags | ||||
| const ( | ||||
| 	// This message has been published to subscribed channels (via Channel Following) | ||||
| 	MessageFlagCrossposted = 1 << iota | ||||
| 	MessageFlagCrossposted MessageFlag = 1 << iota | ||||
| 	// This message originated from a message in another channel (via Channel Following) | ||||
| 	MessageFlagIsCrosspost | ||||
| 	// Do not include any embeds when serializing this message | ||||
|   | ||||
							
								
								
									
										28
									
								
								vendor/github.com/matterbridge/discordgo/oauth2.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										28
									
								
								vendor/github.com/matterbridge/discordgo/oauth2.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -13,6 +13,33 @@ package discordgo | ||||
| // Code specific to Discord OAuth2 Applications | ||||
| // ------------------------------------------------------------------------------------------------ | ||||
|  | ||||
| // The MembershipState represents whether the user is in the team or has been invited into it | ||||
| type MembershipState int | ||||
|  | ||||
| // Constants for the different stages of the MembershipState | ||||
| const ( | ||||
| 	MembershipStateInvited MembershipState = iota + 1 | ||||
| 	MembershipStateAccepted | ||||
| ) | ||||
|  | ||||
| // A TeamMember struct stores values for a single Team Member, extending the normal User data - note that the user field is partial | ||||
| type TeamMember struct { | ||||
| 	User            *User           `json:"user"` | ||||
| 	TeamID          string          `json:"team_id"` | ||||
| 	MembershipState MembershipState `json:"membership_state"` | ||||
| 	Permissions     []string        `json:"permissions"` | ||||
| } | ||||
|  | ||||
| // A Team struct stores the members of a Discord Developer Team as well as some metadata about it | ||||
| type Team struct { | ||||
| 	ID          string        `json:"id"` | ||||
| 	Name        string        `json:"name"` | ||||
| 	Description string        `json:"description"` | ||||
| 	Icon        string        `json:"icon"` | ||||
| 	OwnerID     string        `json:"owner_user_id"` | ||||
| 	Members     []*TeamMember `json:"members"` | ||||
| } | ||||
|  | ||||
| // An Application struct stores values for a Discord OAuth2 Application | ||||
| type Application struct { | ||||
| 	ID                  string    `json:"id,omitempty"` | ||||
| @@ -27,6 +54,7 @@ type Application struct { | ||||
| 	Flags               int       `json:"flags,omitempty"` | ||||
| 	Owner               *User     `json:"owner"` | ||||
| 	Bot                 *User     `json:"bot"` | ||||
| 	Team                *Team     `json:"team"` | ||||
| } | ||||
|  | ||||
| // Application returns an Application structure of a specific Application | ||||
|   | ||||
							
								
								
									
										19
									
								
								vendor/github.com/matterbridge/discordgo/restapi.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										19
									
								
								vendor/github.com/matterbridge/discordgo/restapi.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -844,13 +844,13 @@ func (s *Session) GuildMemberEdit(guildID, userID string, roles []string) (err e | ||||
| // GuildMemberMove moves a guild member from one voice channel to another/none | ||||
| //  guildID   : The ID of a Guild. | ||||
| //  userID    : The ID of a User. | ||||
| //  channelID : The ID of a channel to move user to, or null? | ||||
| //  channelID : The ID of a channel to move user to or nil to remove from voice channel | ||||
| // NOTE : I am not entirely set on the name of this function and it may change | ||||
| // prior to the final 1.0.0 release of Discordgo | ||||
| func (s *Session) GuildMemberMove(guildID, userID, channelID string) (err error) { | ||||
| func (s *Session) GuildMemberMove(guildID string, userID string, channelID *string) (err error) { | ||||
|  | ||||
| 	data := struct { | ||||
| 		ChannelID string `json:"channel_id"` | ||||
| 		ChannelID *string `json:"channel_id"` | ||||
| 	}{channelID} | ||||
|  | ||||
| 	_, err = s.RequestWithBucketID("PATCH", EndpointGuildMember(guildID, userID), data, EndpointGuildMember(guildID, "")) | ||||
| @@ -1309,6 +1309,19 @@ func (s *Session) GuildAuditLog(guildID, userID, beforeID string, actionType, li | ||||
| 	return | ||||
| } | ||||
|  | ||||
| // GuildEmojis returns all emoji | ||||
| // guildID : The ID of a Guild. | ||||
| func (s *Session) GuildEmojis(guildID string) (emoji []*Emoji, err error) { | ||||
|  | ||||
| 	body, err := s.RequestWithBucketID("GET", EndpointGuildEmojis(guildID), nil, EndpointGuildEmojis(guildID)) | ||||
| 	if err != nil { | ||||
| 		return | ||||
| 	} | ||||
|  | ||||
| 	err = unmarshal(body, &emoji) | ||||
| 	return | ||||
| } | ||||
|  | ||||
| // GuildEmojiCreate creates a new emoji | ||||
| // guildID : The ID of a Guild. | ||||
| // name    : The Name of the Emoji. | ||||
|   | ||||
							
								
								
									
										356
									
								
								vendor/github.com/matterbridge/discordgo/structs.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										356
									
								
								vendor/github.com/matterbridge/discordgo/structs.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -143,13 +143,24 @@ type Integration struct { | ||||
| 	Enabled           bool               `json:"enabled"` | ||||
| 	Syncing           bool               `json:"syncing"` | ||||
| 	RoleID            string             `json:"role_id"` | ||||
| 	ExpireBehavior    int                `json:"expire_behavior"` | ||||
| 	EnableEmoticons   bool               `json:"enable_emoticons"` | ||||
| 	ExpireBehavior    ExpireBehavior     `json:"expire_behavior"` | ||||
| 	ExpireGracePeriod int                `json:"expire_grace_period"` | ||||
| 	User              *User              `json:"user"` | ||||
| 	Account           IntegrationAccount `json:"account"` | ||||
| 	SyncedAt          Timestamp          `json:"synced_at"` | ||||
| } | ||||
|  | ||||
| //ExpireBehavior of Integration | ||||
| // https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors | ||||
| type ExpireBehavior int | ||||
|  | ||||
| // Block of valid ExpireBehaviors | ||||
| const ( | ||||
| 	ExpireBehaviorRemoveRole ExpireBehavior = iota | ||||
| 	ExpireBehaviorKick | ||||
| ) | ||||
|  | ||||
| // IntegrationAccount is integration account information | ||||
| // sent by the UserConnections endpoint | ||||
| type IntegrationAccount struct { | ||||
| @@ -180,23 +191,34 @@ type ICEServer struct { | ||||
|  | ||||
| // A Invite stores all data related to a specific Discord Guild or Channel invite. | ||||
| type Invite struct { | ||||
| 	Guild     *Guild    `json:"guild"` | ||||
| 	Channel   *Channel  `json:"channel"` | ||||
| 	Inviter   *User     `json:"inviter"` | ||||
| 	Code      string    `json:"code"` | ||||
| 	CreatedAt Timestamp `json:"created_at"` | ||||
| 	MaxAge    int       `json:"max_age"` | ||||
| 	Uses      int       `json:"uses"` | ||||
| 	MaxUses   int       `json:"max_uses"` | ||||
| 	Revoked   bool      `json:"revoked"` | ||||
| 	Temporary bool      `json:"temporary"` | ||||
| 	Unique    bool      `json:"unique"` | ||||
| 	Guild          *Guild         `json:"guild"` | ||||
| 	Channel        *Channel       `json:"channel"` | ||||
| 	Inviter        *User          `json:"inviter"` | ||||
| 	Code           string         `json:"code"` | ||||
| 	CreatedAt      Timestamp      `json:"created_at"` | ||||
| 	MaxAge         int            `json:"max_age"` | ||||
| 	Uses           int            `json:"uses"` | ||||
| 	MaxUses        int            `json:"max_uses"` | ||||
| 	Revoked        bool           `json:"revoked"` | ||||
| 	Temporary      bool           `json:"temporary"` | ||||
| 	Unique         bool           `json:"unique"` | ||||
| 	TargetUser     *User          `json:"target_user"` | ||||
| 	TargetUserType TargetUserType `json:"target_user_type"` | ||||
|  | ||||
| 	// will only be filled when using InviteWithCounts | ||||
| 	ApproximatePresenceCount int `json:"approximate_presence_count"` | ||||
| 	ApproximateMemberCount   int `json:"approximate_member_count"` | ||||
| } | ||||
|  | ||||
| // TargetUserType is the type of the target user | ||||
| // https://discord.com/developers/docs/resources/invite#invite-object-target-user-types | ||||
| type TargetUserType int | ||||
|  | ||||
| // Block contains known TargetUserType values | ||||
| const ( | ||||
| 	TargetUserTypeStream TargetUserType = iota | ||||
| ) | ||||
|  | ||||
| // ChannelType is the type of a Channel | ||||
| type ChannelType int | ||||
|  | ||||
| @@ -268,6 +290,12 @@ type Channel struct { | ||||
| 	// Amount of seconds a user has to wait before sending another message (0-21600) | ||||
| 	// bots, as well as users with the permission manage_messages or manage_channel, are unaffected | ||||
| 	RateLimitPerUser int `json:"rate_limit_per_user"` | ||||
|  | ||||
| 	// ID of the DM creator Zeroed if guild channel | ||||
| 	OwnerID string `json:"owner_id"` | ||||
|  | ||||
| 	// ApplicationID of the DM creator Zeroed if guild channel or not a bot user | ||||
| 	ApplicationID string `json:"application_id"` | ||||
| } | ||||
|  | ||||
| // Mention returns a string which mentions the channel | ||||
| @@ -301,8 +329,9 @@ type Emoji struct { | ||||
| 	ID            string   `json:"id"` | ||||
| 	Name          string   `json:"name"` | ||||
| 	Roles         []string `json:"roles"` | ||||
| 	Managed       bool     `json:"managed"` | ||||
| 	User          *User    `json:"user"` | ||||
| 	RequireColons bool     `json:"require_colons"` | ||||
| 	Managed       bool     `json:"managed"` | ||||
| 	Animated      bool     `json:"animated"` | ||||
| 	Available     bool     `json:"available"` | ||||
| } | ||||
| @@ -398,11 +427,17 @@ type Guild struct { | ||||
| 	// The user ID of the owner of the guild. | ||||
| 	OwnerID string `json:"owner_id"` | ||||
|  | ||||
| 	// If we are the owner of the guild | ||||
| 	Owner bool `json:"owner"` | ||||
|  | ||||
| 	// The time at which the current user joined the guild. | ||||
| 	// This field is only present in GUILD_CREATE events and websocket | ||||
| 	// update events, and thus is only present in state-cached guilds. | ||||
| 	JoinedAt Timestamp `json:"joined_at"` | ||||
|  | ||||
| 	// The hash of the guild's discovery splash. | ||||
| 	DiscoverySplash string `json:"discovery_splash"` | ||||
|  | ||||
| 	// The hash of the guild's splash. | ||||
| 	Splash string `json:"splash"` | ||||
|  | ||||
| @@ -426,8 +461,7 @@ type Guild struct { | ||||
| 	Large bool `json:"large"` | ||||
|  | ||||
| 	// The default message notification setting for the guild. | ||||
| 	// 0 == all messages, 1 == mentions only. | ||||
| 	DefaultMessageNotifications int `json:"default_message_notifications"` | ||||
| 	DefaultMessageNotifications MessageNotifications `json:"default_message_notifications"` | ||||
|  | ||||
| 	// A list of roles in the guild. | ||||
| 	Roles []*Role `json:"roles"` | ||||
| @@ -445,6 +479,12 @@ type Guild struct { | ||||
| 	// update events, and thus is only present in state-cached guilds. | ||||
| 	Presences []*Presence `json:"presences"` | ||||
|  | ||||
| 	// The maximum number of presences for the guild (the default value, currently 25000, is in effect when null is returned) | ||||
| 	MaxPresences int `json:"max_presences"` | ||||
|  | ||||
| 	// The maximum number of members for the guild | ||||
| 	MaxMembers int `json:"max_members"` | ||||
|  | ||||
| 	// A list of channels in the guild. | ||||
| 	// This field is only present in GUILD_CREATE events and websocket | ||||
| 	// update events, and thus is only present in state-cached guilds. | ||||
| @@ -469,6 +509,9 @@ type Guild struct { | ||||
| 	// Required MFA level for the guild | ||||
| 	MfaLevel MfaLevel `json:"mfa_level"` | ||||
|  | ||||
| 	// The application id of the guild if bot created. | ||||
| 	ApplicationID string `json:"application_id"` | ||||
|  | ||||
| 	// Whether or not the Server Widget is enabled | ||||
| 	WidgetEnabled bool `json:"widget_enabled"` | ||||
|  | ||||
| @@ -478,6 +521,12 @@ type Guild struct { | ||||
| 	// The Channel ID to which system messages are sent (eg join and leave messages) | ||||
| 	SystemChannelID string `json:"system_channel_id"` | ||||
|  | ||||
| 	// The System channel flags | ||||
| 	SystemChannelFlags SystemChannelFlag `json:"system_channel_flags"` | ||||
|  | ||||
| 	// The ID of the rules channel ID, used for rules. | ||||
| 	RulesChannelID string `json:"rules_channel_id"` | ||||
|  | ||||
| 	// the vanity url code for the guild | ||||
| 	VanityURLCode string `json:"vanity_url_code"` | ||||
|  | ||||
| @@ -492,8 +541,46 @@ type Guild struct { | ||||
|  | ||||
| 	// The total number of users currently boosting this server | ||||
| 	PremiumSubscriptionCount int `json:"premium_subscription_count"` | ||||
|  | ||||
| 	// The preferred locale of a guild with the "PUBLIC" feature; used in server discovery and notices from Discord; defaults to "en-US" | ||||
| 	PreferredLocale string `json:"preferred_locale"` | ||||
|  | ||||
| 	// The id of the channel where admins and moderators of guilds with the "PUBLIC" feature receive notices from Discord | ||||
| 	PublicUpdatesChannelID string `json:"public_updates_channel_id"` | ||||
|  | ||||
| 	// The maximum amount of users in a video channel | ||||
| 	MaxVideoChannelUsers int `json:"max_video_channel_users"` | ||||
|  | ||||
| 	// Approximate number of members in this guild, returned from the GET /guild/<id> endpoint when with_counts is true | ||||
| 	ApproximateMemberCount int `json:"approximate_member_count"` | ||||
|  | ||||
| 	// Approximate number of non-offline members in this guild, returned from the GET /guild/<id> endpoint when with_counts is true | ||||
| 	ApproximatePresenceCount int `json:"approximate_presence_count"` | ||||
|  | ||||
| 	// Permissions of our user | ||||
| 	Permissions int `json:"permissions"` | ||||
| } | ||||
|  | ||||
| // MessageNotifications is the notification level for a guild | ||||
| // https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level | ||||
| type MessageNotifications int | ||||
|  | ||||
| // Block containing known MessageNotifications values | ||||
| const ( | ||||
| 	MessageNotificationsAllMessages MessageNotifications = iota | ||||
| 	MessageNotificationsOnlyMentions | ||||
| ) | ||||
|  | ||||
| // SystemChannelFlag is the type of flags in the system channel (see SystemChannelFlag* consts) | ||||
| // https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags | ||||
| type SystemChannelFlag int | ||||
|  | ||||
| // Block containing known SystemChannelFlag values | ||||
| const ( | ||||
| 	SystemChannelFlagsSuppressJoin SystemChannelFlag = 1 << iota | ||||
| 	SystemChannelFlagsSuppressPremium | ||||
| ) | ||||
|  | ||||
| // IconURL returns a URL to the guild's icon. | ||||
| func (g *Guild) IconURL() string { | ||||
| 	if g.Icon == "" { | ||||
| @@ -775,79 +862,157 @@ type GuildEmbed struct { | ||||
| } | ||||
|  | ||||
| // A GuildAuditLog stores data for a guild audit log. | ||||
| // https://discord.com/developers/docs/resources/audit-log#audit-log-object-audit-log-structure | ||||
| type GuildAuditLog struct { | ||||
| 	Webhooks []struct { | ||||
| 		ChannelID string `json:"channel_id"` | ||||
| 		GuildID   string `json:"guild_id"` | ||||
| 		ID        string `json:"id"` | ||||
| 		Avatar    string `json:"avatar"` | ||||
| 		Name      string `json:"name"` | ||||
| 	} `json:"webhooks,omitempty"` | ||||
| 	Users []struct { | ||||
| 		Username      string `json:"username"` | ||||
| 		Discriminator string `json:"discriminator"` | ||||
| 		Bot           bool   `json:"bot"` | ||||
| 		ID            string `json:"id"` | ||||
| 		Avatar        string `json:"avatar"` | ||||
| 	} `json:"users,omitempty"` | ||||
| 	AuditLogEntries []struct { | ||||
| 		TargetID string `json:"target_id"` | ||||
| 		Changes  []struct { | ||||
| 			NewValue interface{} `json:"new_value"` | ||||
| 			OldValue interface{} `json:"old_value"` | ||||
| 			Key      string      `json:"key"` | ||||
| 		} `json:"changes,omitempty"` | ||||
| 		UserID     string `json:"user_id"` | ||||
| 		ID         string `json:"id"` | ||||
| 		ActionType int    `json:"action_type"` | ||||
| 		Options    struct { | ||||
| 			DeleteMembersDay string `json:"delete_member_days"` | ||||
| 			MembersRemoved   string `json:"members_removed"` | ||||
| 			ChannelID        string `json:"channel_id"` | ||||
| 			Count            string `json:"count"` | ||||
| 			ID               string `json:"id"` | ||||
| 			Type             string `json:"type"` | ||||
| 			RoleName         string `json:"role_name"` | ||||
| 		} `json:"options,omitempty"` | ||||
| 		Reason string `json:"reason"` | ||||
| 	} `json:"audit_log_entries"` | ||||
| 	Webhooks        []*Webhook       `json:"webhooks,omitempty"` | ||||
| 	Users           []*User          `json:"users,omitempty"` | ||||
| 	AuditLogEntries []*AuditLogEntry `json:"audit_log_entries"` | ||||
| 	Integrations    []*Integration   `json:"integrations"` | ||||
| } | ||||
|  | ||||
| // AuditLogEntry for a GuildAuditLog | ||||
| // https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-entry-structure | ||||
| type AuditLogEntry struct { | ||||
| 	TargetID   string            `json:"target_id"` | ||||
| 	Changes    []*AuditLogChange `json:"changes"` | ||||
| 	UserID     string            `json:"user_id"` | ||||
| 	ID         string            `json:"id"` | ||||
| 	ActionType *AuditLogAction   `json:"action_type"` | ||||
| 	Options    *AuditLogOptions  `json:"options"` | ||||
| 	Reason     string            `json:"reason"` | ||||
| } | ||||
|  | ||||
| // AuditLogChange for an AuditLogEntry | ||||
| type AuditLogChange struct { | ||||
| 	NewValue interface{}        `json:"new_value"` | ||||
| 	OldValue interface{}        `json:"old_value"` | ||||
| 	Key      *AuditLogChangeKey `json:"key"` | ||||
| } | ||||
|  | ||||
| // AuditLogChangeKey value for AuditLogChange | ||||
| // https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-key | ||||
| type AuditLogChangeKey string | ||||
|  | ||||
| // Block of valid AuditLogChangeKey | ||||
| const ( | ||||
| 	AuditLogChangeKeyName                       AuditLogChangeKey = "name" | ||||
| 	AuditLogChangeKeyIconHash                   AuditLogChangeKey = "icon_hash" | ||||
| 	AuditLogChangeKeySplashHash                 AuditLogChangeKey = "splash_hash" | ||||
| 	AuditLogChangeKeyOwnerID                    AuditLogChangeKey = "owner_id" | ||||
| 	AuditLogChangeKeyRegion                     AuditLogChangeKey = "region" | ||||
| 	AuditLogChangeKeyAfkChannelID               AuditLogChangeKey = "afk_channel_id" | ||||
| 	AuditLogChangeKeyAfkTimeout                 AuditLogChangeKey = "afk_timeout" | ||||
| 	AuditLogChangeKeyMfaLevel                   AuditLogChangeKey = "mfa_level" | ||||
| 	AuditLogChangeKeyVerificationLevel          AuditLogChangeKey = "verification_level" | ||||
| 	AuditLogChangeKeyExplicitContentFilter      AuditLogChangeKey = "explicit_content_filter" | ||||
| 	AuditLogChangeKeyDefaultMessageNotification AuditLogChangeKey = "default_message_notifications" | ||||
| 	AuditLogChangeKeyVanityURLCode              AuditLogChangeKey = "vanity_url_code" | ||||
| 	AuditLogChangeKeyRoleAdd                    AuditLogChangeKey = "$add" | ||||
| 	AuditLogChangeKeyRoleRemove                 AuditLogChangeKey = "$remove" | ||||
| 	AuditLogChangeKeyPruneDeleteDays            AuditLogChangeKey = "prune_delete_days" | ||||
| 	AuditLogChangeKeyWidgetEnabled              AuditLogChangeKey = "widget_enabled" | ||||
| 	AuditLogChangeKeyWidgetChannelID            AuditLogChangeKey = "widget_channel_id" | ||||
| 	AuditLogChangeKeySystemChannelID            AuditLogChangeKey = "system_channel_id" | ||||
| 	AuditLogChangeKeyPosition                   AuditLogChangeKey = "position" | ||||
| 	AuditLogChangeKeyTopic                      AuditLogChangeKey = "topic" | ||||
| 	AuditLogChangeKeyBitrate                    AuditLogChangeKey = "bitrate" | ||||
| 	AuditLogChangeKeyPermissionOverwrite        AuditLogChangeKey = "permission_overwrites" | ||||
| 	AuditLogChangeKeyNSFW                       AuditLogChangeKey = "nsfw" | ||||
| 	AuditLogChangeKeyApplicationID              AuditLogChangeKey = "application_id" | ||||
| 	AuditLogChangeKeyRateLimitPerUser           AuditLogChangeKey = "rate_limit_per_user" | ||||
| 	AuditLogChangeKeyPermissions                AuditLogChangeKey = "permissions" | ||||
| 	AuditLogChangeKeyColor                      AuditLogChangeKey = "color" | ||||
| 	AuditLogChangeKeyHoist                      AuditLogChangeKey = "hoist" | ||||
| 	AuditLogChangeKeyMentionable                AuditLogChangeKey = "mentionable" | ||||
| 	AuditLogChangeKeyAllow                      AuditLogChangeKey = "allow" | ||||
| 	AuditLogChangeKeyDeny                       AuditLogChangeKey = "deny" | ||||
| 	AuditLogChangeKeyCode                       AuditLogChangeKey = "code" | ||||
| 	AuditLogChangeKeyChannelID                  AuditLogChangeKey = "channel_id" | ||||
| 	AuditLogChangeKeyInviterID                  AuditLogChangeKey = "inviter_id" | ||||
| 	AuditLogChangeKeyMaxUses                    AuditLogChangeKey = "max_uses" | ||||
| 	AuditLogChangeKeyUses                       AuditLogChangeKey = "uses" | ||||
| 	AuditLogChangeKeyMaxAge                     AuditLogChangeKey = "max_age" | ||||
| 	AuditLogChangeKeyTempoary                   AuditLogChangeKey = "temporary" | ||||
| 	AuditLogChangeKeyDeaf                       AuditLogChangeKey = "deaf" | ||||
| 	AuditLogChangeKeyMute                       AuditLogChangeKey = "mute" | ||||
| 	AuditLogChangeKeyNick                       AuditLogChangeKey = "nick" | ||||
| 	AuditLogChangeKeyAvatarHash                 AuditLogChangeKey = "avatar_hash" | ||||
| 	AuditLogChangeKeyID                         AuditLogChangeKey = "id" | ||||
| 	AuditLogChangeKeyType                       AuditLogChangeKey = "type" | ||||
| 	AuditLogChangeKeyEnableEmoticons            AuditLogChangeKey = "enable_emoticons" | ||||
| 	AuditLogChangeKeyExpireBehavior             AuditLogChangeKey = "expire_behavior" | ||||
| 	AuditLogChangeKeyExpireGracePeriod          AuditLogChangeKey = "expire_grace_period" | ||||
| ) | ||||
|  | ||||
| // AuditLogOptions optional data for the AuditLog | ||||
| // https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info | ||||
| type AuditLogOptions struct { | ||||
| 	DeleteMemberDays string               `json:"delete_member_days"` | ||||
| 	MembersRemoved   string               `json:"members_removed"` | ||||
| 	ChannelID        string               `json:"channel_id"` | ||||
| 	MessageID        string               `json:"message_id"` | ||||
| 	Count            string               `json:"count"` | ||||
| 	ID               string               `json:"id"` | ||||
| 	Type             *AuditLogOptionsType `json:"type"` | ||||
| 	RoleName         string               `json:"role_name"` | ||||
| } | ||||
|  | ||||
| // AuditLogOptionsType of the AuditLogOption | ||||
| // https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info | ||||
| type AuditLogOptionsType string | ||||
|  | ||||
| // Valid Types for AuditLogOptionsType | ||||
| const ( | ||||
| 	AuditLogOptionsTypeMember AuditLogOptionsType = "member" | ||||
| 	AuditLogOptionsTypeRole   AuditLogOptionsType = "role" | ||||
| ) | ||||
|  | ||||
| // AuditLogAction is the Action of the AuditLog (see AuditLogAction* consts) | ||||
| // https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-events | ||||
| type AuditLogAction int | ||||
|  | ||||
| // Block contains Discord Audit Log Action Types | ||||
| const ( | ||||
| 	AuditLogActionGuildUpdate = 1 | ||||
| 	AuditLogActionGuildUpdate AuditLogAction = 1 | ||||
|  | ||||
| 	AuditLogActionChannelCreate          = 10 | ||||
| 	AuditLogActionChannelUpdate          = 11 | ||||
| 	AuditLogActionChannelDelete          = 12 | ||||
| 	AuditLogActionChannelOverwriteCreate = 13 | ||||
| 	AuditLogActionChannelOverwriteUpdate = 14 | ||||
| 	AuditLogActionChannelOverwriteDelete = 15 | ||||
| 	AuditLogActionChannelCreate          AuditLogAction = 10 | ||||
| 	AuditLogActionChannelUpdate          AuditLogAction = 11 | ||||
| 	AuditLogActionChannelDelete          AuditLogAction = 12 | ||||
| 	AuditLogActionChannelOverwriteCreate AuditLogAction = 13 | ||||
| 	AuditLogActionChannelOverwriteUpdate AuditLogAction = 14 | ||||
| 	AuditLogActionChannelOverwriteDelete AuditLogAction = 15 | ||||
|  | ||||
| 	AuditLogActionMemberKick       = 20 | ||||
| 	AuditLogActionMemberPrune      = 21 | ||||
| 	AuditLogActionMemberBanAdd     = 22 | ||||
| 	AuditLogActionMemberBanRemove  = 23 | ||||
| 	AuditLogActionMemberUpdate     = 24 | ||||
| 	AuditLogActionMemberRoleUpdate = 25 | ||||
| 	AuditLogActionMemberKick       AuditLogAction = 20 | ||||
| 	AuditLogActionMemberPrune      AuditLogAction = 21 | ||||
| 	AuditLogActionMemberBanAdd     AuditLogAction = 22 | ||||
| 	AuditLogActionMemberBanRemove  AuditLogAction = 23 | ||||
| 	AuditLogActionMemberUpdate     AuditLogAction = 24 | ||||
| 	AuditLogActionMemberRoleUpdate AuditLogAction = 25 | ||||
|  | ||||
| 	AuditLogActionRoleCreate = 30 | ||||
| 	AuditLogActionRoleUpdate = 31 | ||||
| 	AuditLogActionRoleDelete = 32 | ||||
| 	AuditLogActionRoleCreate AuditLogAction = 30 | ||||
| 	AuditLogActionRoleUpdate AuditLogAction = 31 | ||||
| 	AuditLogActionRoleDelete AuditLogAction = 32 | ||||
|  | ||||
| 	AuditLogActionInviteCreate = 40 | ||||
| 	AuditLogActionInviteUpdate = 41 | ||||
| 	AuditLogActionInviteDelete = 42 | ||||
| 	AuditLogActionInviteCreate AuditLogAction = 40 | ||||
| 	AuditLogActionInviteUpdate AuditLogAction = 41 | ||||
| 	AuditLogActionInviteDelete AuditLogAction = 42 | ||||
|  | ||||
| 	AuditLogActionWebhookCreate = 50 | ||||
| 	AuditLogActionWebhookUpdate = 51 | ||||
| 	AuditLogActionWebhookDelete = 52 | ||||
| 	AuditLogActionWebhookCreate AuditLogAction = 50 | ||||
| 	AuditLogActionWebhookUpdate AuditLogAction = 51 | ||||
| 	AuditLogActionWebhookDelete AuditLogAction = 52 | ||||
|  | ||||
| 	AuditLogActionEmojiCreate = 60 | ||||
| 	AuditLogActionEmojiUpdate = 61 | ||||
| 	AuditLogActionEmojiDelete = 62 | ||||
| 	AuditLogActionEmojiCreate AuditLogAction = 60 | ||||
| 	AuditLogActionEmojiUpdate AuditLogAction = 61 | ||||
| 	AuditLogActionEmojiDelete AuditLogAction = 62 | ||||
|  | ||||
| 	AuditLogActionMessageDelete = 72 | ||||
| 	AuditLogActionMessageDelete     AuditLogAction = 72 | ||||
| 	AuditLogActionMessageBulkDelete AuditLogAction = 73 | ||||
| 	AuditLogActionMessagePin        AuditLogAction = 74 | ||||
| 	AuditLogActionMessageUnpin      AuditLogAction = 75 | ||||
|  | ||||
| 	AuditLogActionIntegrationCreate AuditLogAction = 80 | ||||
| 	AuditLogActionIntegrationUpdate AuditLogAction = 81 | ||||
| 	AuditLogActionIntegrationDelete AuditLogAction = 82 | ||||
| ) | ||||
|  | ||||
| // A UserGuildSettingsChannelOverride stores data for a channel override for a users guild settings. | ||||
| @@ -884,23 +1049,35 @@ type APIErrorMessage struct { | ||||
|  | ||||
| // Webhook stores the data for a webhook. | ||||
| type Webhook struct { | ||||
| 	ID        string `json:"id"` | ||||
| 	GuildID   string `json:"guild_id"` | ||||
| 	ChannelID string `json:"channel_id"` | ||||
| 	User      *User  `json:"user"` | ||||
| 	Name      string `json:"name"` | ||||
| 	Avatar    string `json:"avatar"` | ||||
| 	Token     string `json:"token"` | ||||
| 	ID        string      `json:"id"` | ||||
| 	Type      WebhookType `json:"type"` | ||||
| 	GuildID   string      `json:"guild_id"` | ||||
| 	ChannelID string      `json:"channel_id"` | ||||
| 	User      *User       `json:"user"` | ||||
| 	Name      string      `json:"name"` | ||||
| 	Avatar    string      `json:"avatar"` | ||||
| 	Token     string      `json:"token"` | ||||
| } | ||||
|  | ||||
| // WebhookType is the type of Webhook (see WebhookType* consts) in the Webhook struct | ||||
| // https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-types | ||||
| type WebhookType int | ||||
|  | ||||
| // Valid WebhookType values | ||||
| const ( | ||||
| 	WebhookTypeIncoming WebhookType = iota | ||||
| 	WebhookTypeChannelFollower | ||||
| ) | ||||
|  | ||||
| // WebhookParams is a struct for webhook params, used in the WebhookExecute command. | ||||
| type WebhookParams struct { | ||||
| 	Content   string          `json:"content,omitempty"` | ||||
| 	Username  string          `json:"username,omitempty"` | ||||
| 	AvatarURL string          `json:"avatar_url,omitempty"` | ||||
| 	TTS       bool            `json:"tts,omitempty"` | ||||
| 	File      *File           `json:"-"` | ||||
| 	Embeds    []*MessageEmbed `json:"embeds,omitempty"` | ||||
| 	Content         string                  `json:"content,omitempty"` | ||||
| 	Username        string                  `json:"username,omitempty"` | ||||
| 	AvatarURL       string                  `json:"avatar_url,omitempty"` | ||||
| 	TTS             bool                    `json:"tts,omitempty"` | ||||
| 	File            *File                   `json:"-"` | ||||
| 	Embeds          []*MessageEmbed         `json:"embeds,omitempty"` | ||||
| 	AllowedMentions *MessageAllowedMentions `json:"allowed_mentions,omitempty"` | ||||
| } | ||||
|  | ||||
| // MessageReaction stores the data for a message reaction. | ||||
| @@ -940,7 +1117,6 @@ type Activity struct { | ||||
| type ActivityType int | ||||
|  | ||||
| // Valid ActivityType values | ||||
| // https://discord.com/developers/docs/topics/gateway#activity-object-activity-types | ||||
| const ( | ||||
| 	ActivityTypeGame GameType = iota | ||||
| 	ActivityTypeStreaming | ||||
|   | ||||
							
								
								
									
										9
									
								
								vendor/github.com/matterbridge/gomatrix/.travis.yml
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										9
									
								
								vendor/github.com/matterbridge/gomatrix/.travis.yml
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -1,9 +0,0 @@ | ||||
| language: go | ||||
| go: | ||||
|  - 1.10.x | ||||
| install: | ||||
|  - go get github.com/golang/lint/golint | ||||
|  - go get github.com/fzipp/gocyclo | ||||
|  - go get github.com/client9/misspell/... | ||||
|  - go get github.com/gordonklaus/ineffassign | ||||
| script: ./hooks/pre-commit | ||||
							
								
								
									
										24
									
								
								vendor/github.com/mattn/go-colorable/colorable_windows.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										24
									
								
								vendor/github.com/mattn/go-colorable/colorable_windows.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -10,6 +10,7 @@ import ( | ||||
| 	"os" | ||||
| 	"strconv" | ||||
| 	"strings" | ||||
| 	"sync" | ||||
| 	"syscall" | ||||
| 	"unsafe" | ||||
|  | ||||
| @@ -27,6 +28,7 @@ const ( | ||||
| 	backgroundRed       = 0x40 | ||||
| 	backgroundIntensity = 0x80 | ||||
| 	backgroundMask      = (backgroundRed | backgroundBlue | backgroundGreen | backgroundIntensity) | ||||
| 	commonLvbUnderscore = 0x8000 | ||||
|  | ||||
| 	cENABLE_VIRTUAL_TERMINAL_PROCESSING = 0x4 | ||||
| ) | ||||
| @@ -93,6 +95,7 @@ type Writer struct { | ||||
| 	oldattr   word | ||||
| 	oldpos    coord | ||||
| 	rest      bytes.Buffer | ||||
| 	mutex     sync.Mutex | ||||
| } | ||||
|  | ||||
| // NewColorable returns new instance of Writer which handles escape sequence from File. | ||||
| @@ -432,6 +435,8 @@ func atoiWithDefault(s string, def int) (int, error) { | ||||
|  | ||||
| // Write writes data on console | ||||
| func (w *Writer) Write(data []byte) (n int, err error) { | ||||
| 	w.mutex.Lock() | ||||
| 	defer w.mutex.Unlock() | ||||
| 	var csbi consoleScreenBufferInfo | ||||
| 	procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi))) | ||||
|  | ||||
| @@ -683,14 +688,19 @@ loop: | ||||
| 					switch { | ||||
| 					case n == 0 || n == 100: | ||||
| 						attr = w.oldattr | ||||
| 					case 1 <= n && n <= 5: | ||||
| 					case n == 4: | ||||
| 						attr |= commonLvbUnderscore | ||||
| 					case (1 <= n && n <= 3) || n == 5: | ||||
| 						attr |= foregroundIntensity | ||||
| 					case n == 7: | ||||
| 						attr = ((attr & foregroundMask) << 4) | ((attr & backgroundMask) >> 4) | ||||
| 					case n == 22 || n == 25: | ||||
| 						attr |= foregroundIntensity | ||||
| 					case n == 27: | ||||
| 						attr = ((attr & foregroundMask) << 4) | ((attr & backgroundMask) >> 4) | ||||
| 					case n == 7 || n == 27: | ||||
| 						attr = | ||||
| 							(attr &^ (foregroundMask | backgroundMask)) | | ||||
| 								((attr & foregroundMask) << 4) | | ||||
| 								((attr & backgroundMask) >> 4) | ||||
| 					case n == 22: | ||||
| 						attr &^= foregroundIntensity | ||||
| 					case n == 24: | ||||
| 						attr &^= commonLvbUnderscore | ||||
| 					case 30 <= n && n <= 37: | ||||
| 						attr &= backgroundMask | ||||
| 						if (n-30)&1 != 0 { | ||||
|   | ||||
							
								
								
									
										16
									
								
								vendor/github.com/monaco-io/request/.travis.yml
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										16
									
								
								vendor/github.com/monaco-io/request/.travis.yml
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -1,16 +0,0 @@ | ||||
| language: go | ||||
|  | ||||
| go: | ||||
|   - 1.14.x | ||||
|   - tip | ||||
|  | ||||
| sudo: false | ||||
|  | ||||
| before_install: | ||||
|   - go get -t -v ./... | ||||
|  | ||||
| script: | ||||
|   - go test -race -coverprofile=coverage.txt -covermode=atomic | ||||
|  | ||||
| after_success: | ||||
|   - bash <(curl -s https://codecov.io/bash) -t 6cf6f7ab-26e6-429c-ac44-f0ad85c1e586 | ||||
							
								
								
									
										26
									
								
								vendor/github.com/monaco-io/request/README.md
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										26
									
								
								vendor/github.com/monaco-io/request/README.md
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -2,7 +2,6 @@ | ||||
|  | ||||
| <img align="right" width="159px" src="https://raw.githubusercontent.com/gin-gonic/logo/master/color.png"> | ||||
|  | ||||
| [](https://travis-ci.org/monaco-io/request) | ||||
| [](https://pkg.go.dev/github.com/monaco-io/request?tab=doc) | ||||
| [](https://codecov.io/gh/monaco-io/request) | ||||
| [](https://github.com/monaco-io/request/releases) | ||||
| @@ -192,6 +191,31 @@ func main() { | ||||
| } | ||||
| ``` | ||||
|  | ||||
|  | ||||
| ### TLS | ||||
|  | ||||
| ```go | ||||
| package main | ||||
|  | ||||
| import ( | ||||
|     "log" | ||||
|     "crypto/tls" | ||||
|  | ||||
|     "github.com/monaco-io/request" | ||||
| ) | ||||
|  | ||||
| func main() { | ||||
|     client := request.Client{ | ||||
|         URL:       "https://google.com", | ||||
|         TLSConfig: &tls.Config{InsecureSkipVerify: true}, | ||||
|     } | ||||
|  | ||||
|     resp, err := client.Do() | ||||
|  | ||||
|     log.Println(resp.Code, string(resp.Data), err) | ||||
| } | ||||
| ``` | ||||
|  | ||||
| ## License | ||||
|  | ||||
| [MIT](LICENSE) | ||||
|   | ||||
							
								
								
									
										98
									
								
								vendor/github.com/monaco-io/request/build.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										98
									
								
								vendor/github.com/monaco-io/request/build.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,98 @@ | ||||
| package request | ||||
|  | ||||
| import ( | ||||
| 	"bytes" | ||||
| 	"net/http" | ||||
| 	"net/http/cookiejar" | ||||
| 	"net/url" | ||||
| 	"time" | ||||
| ) | ||||
|  | ||||
| // TODO: func unit test coverage | ||||
| func (c *Client) buildRequest() (err error) { | ||||
| 	if err = c.applyRequest(); err != nil { | ||||
| 		return | ||||
| 	} | ||||
|  | ||||
| 	c.transport = &http.Transport{} | ||||
|  | ||||
| 	c.applyHTTPHeader() | ||||
| 	c.applyBasicAuth() | ||||
| 	c.applyClient() | ||||
| 	c.applyTimeout() | ||||
| 	c.applyCookies() | ||||
| 	c.applyTLSConfig() | ||||
| 	err = c.applyProxy() | ||||
|  | ||||
| 	c.client.Transport = c.transport | ||||
| 	return | ||||
| } | ||||
|  | ||||
| func (c *Client) applyRequest() (err error) { | ||||
| 	// encode requestURL.httpURL like https://google.com?hello=world&package=request | ||||
| 	c.requestURL = requestURL{ | ||||
| 		urlString:  c.URL, | ||||
| 		parameters: c.Params, | ||||
| 	} | ||||
| 	if err = c.requestURL.EncodeURL(); err != nil { | ||||
| 		return | ||||
| 	} | ||||
| 	c.req, err = http.NewRequest(c.Method, c.requestURL.string(), bytes.NewReader(c.Body)) | ||||
| 	return | ||||
| } | ||||
|  | ||||
| func (c *Client) applyHTTPHeader() { | ||||
| 	if c.Method == POST { | ||||
| 		if c.ContentType == emptyString { | ||||
| 			c.ContentType = ApplicationJSON | ||||
| 		} | ||||
| 		c.req.Header.Set(contentType, string(c.ContentType)) | ||||
| 	} | ||||
| 	for k, v := range c.Header { | ||||
| 		c.req.Header.Add(k, v) | ||||
| 	} | ||||
| } | ||||
|  | ||||
| func (c *Client) applyBasicAuth() { | ||||
| 	if c.BasicAuth.Username != emptyString && c.BasicAuth.Password != emptyString { | ||||
| 		c.req.SetBasicAuth(c.BasicAuth.Username, c.BasicAuth.Password) | ||||
| 	} | ||||
| } | ||||
|  | ||||
| func (c *Client) applyClient() { | ||||
| 	c.client = &http.Client{} | ||||
| } | ||||
|  | ||||
| func (c *Client) applyTimeout() { | ||||
| 	if c.Timeout > 0 { | ||||
| 		c.client.Timeout = c.Timeout * time.Second | ||||
| 	} | ||||
| } | ||||
|  | ||||
| func (c *Client) applyCookies() { | ||||
| 	if c.Cookies != nil { | ||||
| 		jar, _ := cookiejar.New(nil) | ||||
| 		jar.SetCookies(&url.URL{Scheme: c.requestURL.scheme(), Host: c.requestURL.host()}, c.Cookies) | ||||
| 		c.client.Jar = jar | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // TODO: test case | ||||
| func (c *Client) applyProxy() (err error) { | ||||
| 	if c.ProxyURL != emptyString { | ||||
| 		var proxy *url.URL | ||||
| 		if proxy, err = url.Parse(c.ProxyURL); err != nil { | ||||
| 			return | ||||
| 		} else if proxy != nil { | ||||
| 			c.transport.Proxy = http.ProxyURL(proxy) | ||||
| 		} | ||||
| 	} | ||||
| 	return | ||||
| } | ||||
|  | ||||
| func (c *Client) applyTLSConfig() { | ||||
| 	// &tls.Config{InsecureSkipVerify: true} | ||||
| 	if c.TLSConfig != nil { | ||||
| 		c.transport.TLSClientConfig = c.TLSConfig | ||||
| 	} | ||||
| } | ||||
							
								
								
									
										46
									
								
								vendor/github.com/monaco-io/request/const.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								vendor/github.com/monaco-io/request/const.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,46 @@ | ||||
| package request | ||||
|  | ||||
| const ( | ||||
| 	// ApplicationJSON application/json | ||||
| 	ApplicationJSON ContentType = "application/json" | ||||
|  | ||||
| 	// ApplicationXWwwFormURLEncoded application/x-www-form-urlencoded | ||||
| 	ApplicationXWwwFormURLEncoded ContentType = "application/x-www-form-urlencoded" | ||||
|  | ||||
| 	// MultipartFormData multipart/form-data | ||||
| 	MultipartFormData ContentType = "multipart/form-data" | ||||
| ) | ||||
|  | ||||
| const ( | ||||
| 	// OPTIONS http options | ||||
| 	OPTIONS = "OPTIONS" | ||||
|  | ||||
| 	// GET http get | ||||
| 	GET = "GET" | ||||
|  | ||||
| 	// HEAD http head | ||||
| 	HEAD = "HEAD" | ||||
|  | ||||
| 	// POST http post | ||||
| 	POST = "POST" | ||||
|  | ||||
| 	// PUT http put | ||||
| 	PUT = "PUT" | ||||
|  | ||||
| 	// DELETE http delete | ||||
| 	DELETE = "DELETE" | ||||
|  | ||||
| 	// TRACE http trace | ||||
| 	TRACE = "TRACE" | ||||
|  | ||||
| 	// CONNECT http connect | ||||
| 	CONNECT = "CONNECT" | ||||
|  | ||||
| 	// PATCH http patch | ||||
| 	PATCH = "PATCH" | ||||
| ) | ||||
|  | ||||
| const ( | ||||
| 	emptyString = "" | ||||
| 	contentType = "Content-Type" | ||||
| ) | ||||
							
								
								
									
										23
									
								
								vendor/github.com/monaco-io/request/model.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										23
									
								
								vendor/github.com/monaco-io/request/model.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -1,24 +1,18 @@ | ||||
| package request | ||||
|  | ||||
| import ( | ||||
| 	"crypto/tls" | ||||
| 	"net/http" | ||||
| 	"time" | ||||
| ) | ||||
|  | ||||
| const ( | ||||
| 	// ApplicationJSON application/json | ||||
| 	ApplicationJSON ContentType = "application/json" | ||||
|  | ||||
| 	// ApplicationXWwwFormURLEncoded application/x-www-form-urlencoded | ||||
| 	ApplicationXWwwFormURLEncoded ContentType = "application/x-www-form-urlencoded" | ||||
|  | ||||
| 	// MultipartFormData multipart/form-data | ||||
| 	MultipartFormData ContentType = "multipart/form-data" | ||||
| ) | ||||
|  | ||||
| // ContentType Content-Type | ||||
| type ContentType string | ||||
|  | ||||
| // Method http method | ||||
| // TODO: | ||||
| type Method string | ||||
|  | ||||
| // Client Method | ||||
| /* | ||||
|      Method         = "OPTIONS"                ; Section 9.2 | ||||
| @@ -44,10 +38,13 @@ type Client struct { | ||||
| 	ProxyURL    string | ||||
| 	ContentType ContentType | ||||
| 	Cookies     []*http.Cookie | ||||
| 	TLSConfig   *tls.Config | ||||
|  | ||||
| 	// private | ||||
| 	client *http.Client | ||||
| 	req    *http.Request | ||||
| 	client     *http.Client | ||||
| 	requestURL requestURL | ||||
| 	req        *http.Request | ||||
| 	transport  *http.Transport | ||||
| } | ||||
|  | ||||
| // BasicAuth Add Username:Password as Basic Auth | ||||
|   | ||||
							
								
								
									
										75
									
								
								vendor/github.com/monaco-io/request/request.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										75
									
								
								vendor/github.com/monaco-io/request/request.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -1,98 +1,33 @@ | ||||
| package request | ||||
|  | ||||
| import ( | ||||
| 	"bytes" | ||||
| 	"crypto/tls" | ||||
| 	"io/ioutil" | ||||
| 	"net/http" | ||||
| 	"net/http/cookiejar" | ||||
| 	"net/url" | ||||
| 	"time" | ||||
| ) | ||||
|  | ||||
| // Do send http request | ||||
| func (c *Client) Do() (resp SugaredResp, err error) { | ||||
| 	defer resp.Close() | ||||
|  | ||||
| 	if err := c.buildRequest(); err != nil { | ||||
| 		return resp, err | ||||
| 	if err = c.buildRequest(); err != nil { | ||||
| 		return | ||||
| 	} | ||||
|  | ||||
| 	// send request and close on func call end | ||||
| 	if resp.resp, err = c.client.Do(c.req); err != nil { | ||||
| 		return resp, err | ||||
| 		return | ||||
| 	} | ||||
|  | ||||
| 	// read response data form resp | ||||
| 	resp.Data, err = ioutil.ReadAll(resp.resp.Body) | ||||
| 	resp.Code = resp.resp.StatusCode | ||||
| 	return resp, err | ||||
| } | ||||
|  | ||||
| func (c *Client) buildRequest() (err error) { | ||||
|  | ||||
| 	// encode requestURL.httpURL like https://google.com?hello=world&package=request | ||||
| 	ru := requestURL{ | ||||
| 		urlString:  c.URL, | ||||
| 		parameters: c.Params, | ||||
| 	} | ||||
| 	if err := ru.EncodeURL(); err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	// build request | ||||
| 	c.req, err = http.NewRequest(c.Method, ru.string(), bytes.NewReader(c.Body)) | ||||
| 	if err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	// apply Header to request | ||||
| 	if c.Method == "POST" { | ||||
| 		if c.ContentType == "" { | ||||
| 			c.ContentType = ApplicationJSON | ||||
| 		} | ||||
| 		c.req.Header.Set("Content-Type", string(c.ContentType)) | ||||
| 	} | ||||
| 	for k, v := range c.Header { | ||||
| 		c.req.Header.Add(k, v) | ||||
| 	} | ||||
|  | ||||
| 	// apply basic Auth of request header | ||||
| 	if c.BasicAuth.Username != "" && c.BasicAuth.Password != "" { | ||||
| 		c.req.SetBasicAuth(c.BasicAuth.Username, c.BasicAuth.Password) | ||||
| 	} | ||||
|  | ||||
| 	c.client = &http.Client{} | ||||
|  | ||||
| 	// apply timeout | ||||
| 	if c.Timeout > 0 { | ||||
| 		c.client.Timeout = c.Timeout * time.Second | ||||
| 	} | ||||
|  | ||||
| 	// apply cookies | ||||
| 	if c.Cookies != nil { | ||||
| 		jar, _ := cookiejar.New(nil) | ||||
| 		jar.SetCookies(&url.URL{Scheme: ru.scheme(), Host: ru.host()}, c.Cookies) | ||||
| 		c.client.Jar = jar | ||||
| 	} | ||||
|  | ||||
| 	// apply proxy | ||||
| 	if c.ProxyURL != "" { | ||||
| 		if proxy, err := url.Parse(c.ProxyURL); err == nil && proxy != nil { | ||||
| 			c.client.Transport = &http.Transport{ | ||||
| 				Proxy:           http.ProxyURL(proxy), | ||||
| 				TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return err | ||||
| 	return | ||||
| } | ||||
|  | ||||
| // Resp do request and get original http response struct | ||||
| func (c *Client) Resp() (resp *http.Response, err error) { | ||||
| 	if err = c.buildRequest(); err != nil { | ||||
| 		return resp, err | ||||
| 		return | ||||
| 	} | ||||
| 	return c.client.Do(c.req) | ||||
| } | ||||
|   | ||||
							
								
								
									
										4
									
								
								vendor/github.com/monaco-io/request/url.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								vendor/github.com/monaco-io/request/url.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -12,14 +12,14 @@ type requestURL struct { | ||||
| func (ru *requestURL) EncodeURL() (err error) { | ||||
| 	ru.httpURL, err = url.Parse(ru.urlString) | ||||
| 	if err != nil { | ||||
| 		return err | ||||
| 		return | ||||
| 	} | ||||
| 	query := ru.httpURL.Query() | ||||
| 	for k := range ru.parameters { | ||||
| 		query.Set(k, ru.parameters[k]) | ||||
| 	} | ||||
| 	ru.httpURL.RawQuery = query.Encode() | ||||
| 	return err | ||||
| 	return | ||||
| } | ||||
|  | ||||
| // String return example: https://www.google.com/search?a=1&b=2 | ||||
|   | ||||
							
								
								
									
										2
									
								
								vendor/github.com/slack-go/slack/attachments.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/slack-go/slack/attachments.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -75,7 +75,7 @@ type Attachment struct { | ||||
| 	Title     string `json:"title,omitempty"` | ||||
| 	TitleLink string `json:"title_link,omitempty"` | ||||
| 	Pretext   string `json:"pretext,omitempty"` | ||||
| 	Text      string `json:"text,omitempty"` | ||||
| 	Text      string `json:"text"` // Required | ||||
|  | ||||
| 	ImageURL string `json:"image_url,omitempty"` | ||||
| 	ThumbURL string `json:"thumb_url,omitempty"` | ||||
|   | ||||
							
								
								
									
										1
									
								
								vendor/github.com/slack-go/slack/block.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								vendor/github.com/slack-go/slack/block.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -16,6 +16,7 @@ const ( | ||||
| 	MBTContext MessageBlockType = "context" | ||||
| 	MBTFile    MessageBlockType = "file" | ||||
| 	MBTInput   MessageBlockType = "input" | ||||
| 	MBTHeader  MessageBlockType = "header" | ||||
| ) | ||||
|  | ||||
| // Block defines an interface all block types should implement | ||||
|   | ||||
							
								
								
									
										8
									
								
								vendor/github.com/slack-go/slack/block_conv.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								vendor/github.com/slack-go/slack/block_conv.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -111,6 +111,12 @@ func (b *InputBlock) UnmarshalJSON(data []byte) error { | ||||
| 		e = &SelectBlockElement{} | ||||
| 	case "multi_static_select", "multi_external_select", "multi_users_select", "multi_conversations_select", "multi_channels_select": | ||||
| 		e = &MultiSelectBlockElement{} | ||||
| 	case "checkboxes": | ||||
| 		e = &CheckboxGroupsBlockElement{} | ||||
| 	case "overflow": | ||||
| 		e = &OverflowBlockElement{} | ||||
| 	case "radio_buttons": | ||||
| 		e = &RadioButtonsBlockElement{} | ||||
| 	default: | ||||
| 		return errors.New("unsupported block element type") | ||||
| 	} | ||||
| @@ -175,6 +181,8 @@ func (b *BlockElements) UnmarshalJSON(data []byte) error { | ||||
| 			blockElement = &PlainTextInputBlockElement{} | ||||
| 		case "checkboxes": | ||||
| 			blockElement = &CheckboxGroupsBlockElement{} | ||||
| 		case "radio_buttons": | ||||
| 			blockElement = &RadioButtonsBlockElement{} | ||||
| 		case "static_select", "external_select", "users_select", "conversations_select", "channels_select": | ||||
| 			blockElement = &SelectBlockElement{} | ||||
| 		default: | ||||
|   | ||||
							
								
								
									
										38
									
								
								vendor/github.com/slack-go/slack/block_header.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								vendor/github.com/slack-go/slack/block_header.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,38 @@ | ||||
| package slack | ||||
|  | ||||
| // HeaderBlock defines a new block of type header | ||||
| // | ||||
| // More Information: https://api.slack.com/reference/messaging/blocks#header | ||||
| type HeaderBlock struct { | ||||
| 	Type    MessageBlockType `json:"type"` | ||||
| 	Text    *TextBlockObject `json:"text,omitempty"` | ||||
| 	BlockID string           `json:"block_id,omitempty"` | ||||
| } | ||||
|  | ||||
| // BlockType returns the type of the block | ||||
| func (s HeaderBlock) BlockType() MessageBlockType { | ||||
| 	return s.Type | ||||
| } | ||||
|  | ||||
| // HeaderBlockOption allows configuration of options for a new header block | ||||
| type HeaderBlockOption func(*HeaderBlock) | ||||
|  | ||||
| func HeaderBlockOptionBlockID(blockID string) HeaderBlockOption { | ||||
| 	return func(block *HeaderBlock) { | ||||
| 		block.BlockID = blockID | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // NewHeaderBlock returns a new instance of a header block to be rendered | ||||
| func NewHeaderBlock(textObj *TextBlockObject, options ...HeaderBlockOption) *HeaderBlock { | ||||
| 	block := HeaderBlock{ | ||||
| 		Type: MBTHeader, | ||||
| 		Text: textObj, | ||||
| 	} | ||||
|  | ||||
| 	for _, option := range options { | ||||
| 		option(&block) | ||||
| 	} | ||||
|  | ||||
| 	return &block | ||||
| } | ||||
							
								
								
									
										1
									
								
								vendor/github.com/slack-go/slack/errors.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								vendor/github.com/slack-go/slack/errors.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -9,6 +9,7 @@ const ( | ||||
| 	ErrRTMGoodbye           = errorsx.String("goodbye detected") | ||||
| 	ErrRTMDeadman           = errorsx.String("deadman switch triggered") | ||||
| 	ErrParametersMissing    = errorsx.String("received empty parameters") | ||||
| 	ErrBlockIDNotUnique     = errorsx.String("Block ID needs to be unique") | ||||
| 	ErrInvalidConfiguration = errorsx.String("invalid configuration") | ||||
| 	ErrMissingHeaders       = errorsx.String("missing headers") | ||||
| 	ErrExpiredTimestamp     = errorsx.String("timestamp is too old") | ||||
|   | ||||
							
								
								
									
										17
									
								
								vendor/github.com/slack-go/slack/oauth.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										17
									
								
								vendor/github.com/slack-go/slack/oauth.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -33,14 +33,15 @@ type OAuthResponse struct { | ||||
|  | ||||
| // OAuthV2Response ... | ||||
| type OAuthV2Response struct { | ||||
| 	AccessToken string                    `json:"access_token"` | ||||
| 	TokenType   string                    `json:"token_type"` | ||||
| 	Scope       string                    `json:"scope"` | ||||
| 	BotUserID   string                    `json:"bot_user_id"` | ||||
| 	AppID       string                    `json:"app_id"` | ||||
| 	Team        OAuthV2ResponseTeam       `json:"team"` | ||||
| 	Enterprise  OAuthV2ResponseEnterprise `json:"enterprise"` | ||||
| 	AuthedUser  OAuthV2ResponseAuthedUser `json:"authed_user"` | ||||
| 	AccessToken     string                       `json:"access_token"` | ||||
| 	TokenType       string                       `json:"token_type"` | ||||
| 	Scope           string                       `json:"scope"` | ||||
| 	BotUserID       string                       `json:"bot_user_id"` | ||||
| 	AppID           string                       `json:"app_id"` | ||||
| 	Team            OAuthV2ResponseTeam          `json:"team"` | ||||
| 	IncomingWebhook OAuthResponseIncomingWebhook `json:"incoming_webhook"` | ||||
| 	Enterprise      OAuthV2ResponseEnterprise    `json:"enterprise"` | ||||
| 	AuthedUser      OAuthV2ResponseAuthedUser    `json:"authed_user"` | ||||
| 	SlackResponse | ||||
| } | ||||
|  | ||||
|   | ||||
							
								
								
									
										22
									
								
								vendor/github.com/slack-go/slack/views.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										22
									
								
								vendor/github.com/slack-go/slack/views.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -150,6 +150,23 @@ func (api *Client) OpenView(triggerID string, view ModalViewRequest) (*ViewRespo | ||||
| 	return api.OpenViewContext(context.Background(), triggerID, view) | ||||
| } | ||||
|  | ||||
| // ValidateUniqueBlockID will verify if each input block has a unique block ID if set | ||||
| func ValidateUniqueBlockID(view ModalViewRequest) bool { | ||||
|  | ||||
| 	uniqueBlockID := map[string]bool{} | ||||
|  | ||||
| 	for _, b := range view.Blocks.BlockSet { | ||||
| 		if inputBlock, ok := b.(*InputBlock); ok { | ||||
| 			if _, ok := uniqueBlockID[inputBlock.BlockID]; ok { | ||||
| 				return false | ||||
| 			} | ||||
| 			uniqueBlockID[inputBlock.BlockID] = true | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // OpenViewContext opens a view for a user with a custom context. | ||||
| func (api *Client) OpenViewContext( | ||||
| 	ctx context.Context, | ||||
| @@ -159,6 +176,11 @@ func (api *Client) OpenViewContext( | ||||
| 	if triggerID == "" { | ||||
| 		return nil, ErrParametersMissing | ||||
| 	} | ||||
|  | ||||
| 	if !ValidateUniqueBlockID(view) { | ||||
| 		return nil, ErrBlockIDNotUnique | ||||
| 	} | ||||
|  | ||||
| 	req := openViewRequest{ | ||||
| 		TriggerID: triggerID, | ||||
| 		View:      view, | ||||
|   | ||||
							
								
								
									
										13
									
								
								vendor/github.com/spf13/viper/util.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										13
									
								
								vendor/github.com/spf13/viper/util.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -91,13 +91,22 @@ func insensitiviseMap(m map[string]interface{}) { | ||||
| func absPathify(inPath string) string { | ||||
| 	jww.INFO.Println("Trying to resolve absolute path to", inPath) | ||||
|  | ||||
| 	if strings.HasPrefix(inPath, "$HOME") { | ||||
| 	if inPath == "$HOME" || strings.HasPrefix(inPath, "$HOME"+string(os.PathSeparator)) { | ||||
| 		inPath = userHomeDir() + inPath[5:] | ||||
| 	} | ||||
|  | ||||
| 	if strings.HasPrefix(inPath, "$") { | ||||
| 		end := strings.Index(inPath, string(os.PathSeparator)) | ||||
| 		inPath = os.Getenv(inPath[1:end]) + inPath[end:] | ||||
|  | ||||
| 		var value, suffix string | ||||
| 		if end == -1 { | ||||
| 			value = os.Getenv(inPath[1:]) | ||||
| 		} else { | ||||
| 			value = os.Getenv(inPath[1:end]) | ||||
| 			suffix = inPath[end:] | ||||
| 		} | ||||
|  | ||||
| 		inPath = value + suffix | ||||
| 	} | ||||
|  | ||||
| 	if filepath.IsAbs(inPath) { | ||||
|   | ||||
							
								
								
									
										24
									
								
								vendor/github.com/spf13/viper/viper.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										24
									
								
								vendor/github.com/spf13/viper/viper.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -896,13 +896,7 @@ func UnmarshalKey(key string, rawVal interface{}, opts ...DecoderConfigOption) e | ||||
| 	return v.UnmarshalKey(key, rawVal, opts...) | ||||
| } | ||||
| func (v *Viper) UnmarshalKey(key string, rawVal interface{}, opts ...DecoderConfigOption) error { | ||||
| 	err := decode(v.Get(key), defaultDecoderConfig(rawVal, opts...)) | ||||
|  | ||||
| 	if err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| 	return decode(v.Get(key), defaultDecoderConfig(rawVal, opts...)) | ||||
| } | ||||
|  | ||||
| // Unmarshal unmarshals the config into a Struct. Make sure that the tags | ||||
| @@ -911,13 +905,7 @@ func Unmarshal(rawVal interface{}, opts ...DecoderConfigOption) error { | ||||
| 	return v.Unmarshal(rawVal, opts...) | ||||
| } | ||||
| func (v *Viper) Unmarshal(rawVal interface{}, opts ...DecoderConfigOption) error { | ||||
| 	err := decode(v.AllSettings(), defaultDecoderConfig(rawVal, opts...)) | ||||
|  | ||||
| 	if err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| 	return decode(v.AllSettings(), defaultDecoderConfig(rawVal, opts...)) | ||||
| } | ||||
|  | ||||
| // defaultDecoderConfig returns default mapsstructure.DecoderConfig with suppot | ||||
| @@ -956,13 +944,7 @@ func (v *Viper) UnmarshalExact(rawVal interface{}, opts ...DecoderConfigOption) | ||||
| 	config := defaultDecoderConfig(rawVal, opts...) | ||||
| 	config.ErrorUnused = true | ||||
|  | ||||
| 	err := decode(v.AllSettings(), config) | ||||
|  | ||||
| 	if err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| 	return decode(v.AllSettings(), config) | ||||
| } | ||||
|  | ||||
| // BindPFlags binds a full flag set to the configuration, using each flag's long | ||||
|   | ||||
							
								
								
									
										2
									
								
								vendor/github.com/stretchr/testify/LICENSE
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/stretchr/testify/LICENSE
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -1,6 +1,6 @@ | ||||
| MIT License | ||||
|  | ||||
| Copyright (c) 2012-2018 Mat Ryer and Tyler Bunnell | ||||
| Copyright (c) 2012-2020 Mat Ryer, Tyler Bunnell and contributors. | ||||
|  | ||||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||||
| of this software and associated documentation files (the "Software"), to deal | ||||
|   | ||||
| @@ -5,20 +5,28 @@ import ( | ||||
| 	"reflect" | ||||
| ) | ||||
| 
 | ||||
| func compare(obj1, obj2 interface{}, kind reflect.Kind) (int, bool) { | ||||
| type CompareType int | ||||
| 
 | ||||
| const ( | ||||
| 	compareLess CompareType = iota - 1 | ||||
| 	compareEqual | ||||
| 	compareGreater | ||||
| ) | ||||
| 
 | ||||
| func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { | ||||
| 	switch kind { | ||||
| 	case reflect.Int: | ||||
| 		{ | ||||
| 			intobj1 := obj1.(int) | ||||
| 			intobj2 := obj2.(int) | ||||
| 			if intobj1 > intobj2 { | ||||
| 				return -1, true | ||||
| 				return compareGreater, true | ||||
| 			} | ||||
| 			if intobj1 == intobj2 { | ||||
| 				return 0, true | ||||
| 				return compareEqual, true | ||||
| 			} | ||||
| 			if intobj1 < intobj2 { | ||||
| 				return 1, true | ||||
| 				return compareLess, true | ||||
| 			} | ||||
| 		} | ||||
| 	case reflect.Int8: | ||||
| @@ -26,13 +34,13 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (int, bool) { | ||||
| 			int8obj1 := obj1.(int8) | ||||
| 			int8obj2 := obj2.(int8) | ||||
| 			if int8obj1 > int8obj2 { | ||||
| 				return -1, true | ||||
| 				return compareGreater, true | ||||
| 			} | ||||
| 			if int8obj1 == int8obj2 { | ||||
| 				return 0, true | ||||
| 				return compareEqual, true | ||||
| 			} | ||||
| 			if int8obj1 < int8obj2 { | ||||
| 				return 1, true | ||||
| 				return compareLess, true | ||||
| 			} | ||||
| 		} | ||||
| 	case reflect.Int16: | ||||
| @@ -40,13 +48,13 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (int, bool) { | ||||
| 			int16obj1 := obj1.(int16) | ||||
| 			int16obj2 := obj2.(int16) | ||||
| 			if int16obj1 > int16obj2 { | ||||
| 				return -1, true | ||||
| 				return compareGreater, true | ||||
| 			} | ||||
| 			if int16obj1 == int16obj2 { | ||||
| 				return 0, true | ||||
| 				return compareEqual, true | ||||
| 			} | ||||
| 			if int16obj1 < int16obj2 { | ||||
| 				return 1, true | ||||
| 				return compareLess, true | ||||
| 			} | ||||
| 		} | ||||
| 	case reflect.Int32: | ||||
| @@ -54,13 +62,13 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (int, bool) { | ||||
| 			int32obj1 := obj1.(int32) | ||||
| 			int32obj2 := obj2.(int32) | ||||
| 			if int32obj1 > int32obj2 { | ||||
| 				return -1, true | ||||
| 				return compareGreater, true | ||||
| 			} | ||||
| 			if int32obj1 == int32obj2 { | ||||
| 				return 0, true | ||||
| 				return compareEqual, true | ||||
| 			} | ||||
| 			if int32obj1 < int32obj2 { | ||||
| 				return 1, true | ||||
| 				return compareLess, true | ||||
| 			} | ||||
| 		} | ||||
| 	case reflect.Int64: | ||||
| @@ -68,13 +76,13 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (int, bool) { | ||||
| 			int64obj1 := obj1.(int64) | ||||
| 			int64obj2 := obj2.(int64) | ||||
| 			if int64obj1 > int64obj2 { | ||||
| 				return -1, true | ||||
| 				return compareGreater, true | ||||
| 			} | ||||
| 			if int64obj1 == int64obj2 { | ||||
| 				return 0, true | ||||
| 				return compareEqual, true | ||||
| 			} | ||||
| 			if int64obj1 < int64obj2 { | ||||
| 				return 1, true | ||||
| 				return compareLess, true | ||||
| 			} | ||||
| 		} | ||||
| 	case reflect.Uint: | ||||
| @@ -82,13 +90,13 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (int, bool) { | ||||
| 			uintobj1 := obj1.(uint) | ||||
| 			uintobj2 := obj2.(uint) | ||||
| 			if uintobj1 > uintobj2 { | ||||
| 				return -1, true | ||||
| 				return compareGreater, true | ||||
| 			} | ||||
| 			if uintobj1 == uintobj2 { | ||||
| 				return 0, true | ||||
| 				return compareEqual, true | ||||
| 			} | ||||
| 			if uintobj1 < uintobj2 { | ||||
| 				return 1, true | ||||
| 				return compareLess, true | ||||
| 			} | ||||
| 		} | ||||
| 	case reflect.Uint8: | ||||
| @@ -96,13 +104,13 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (int, bool) { | ||||
| 			uint8obj1 := obj1.(uint8) | ||||
| 			uint8obj2 := obj2.(uint8) | ||||
| 			if uint8obj1 > uint8obj2 { | ||||
| 				return -1, true | ||||
| 				return compareGreater, true | ||||
| 			} | ||||
| 			if uint8obj1 == uint8obj2 { | ||||
| 				return 0, true | ||||
| 				return compareEqual, true | ||||
| 			} | ||||
| 			if uint8obj1 < uint8obj2 { | ||||
| 				return 1, true | ||||
| 				return compareLess, true | ||||
| 			} | ||||
| 		} | ||||
| 	case reflect.Uint16: | ||||
| @@ -110,13 +118,13 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (int, bool) { | ||||
| 			uint16obj1 := obj1.(uint16) | ||||
| 			uint16obj2 := obj2.(uint16) | ||||
| 			if uint16obj1 > uint16obj2 { | ||||
| 				return -1, true | ||||
| 				return compareGreater, true | ||||
| 			} | ||||
| 			if uint16obj1 == uint16obj2 { | ||||
| 				return 0, true | ||||
| 				return compareEqual, true | ||||
| 			} | ||||
| 			if uint16obj1 < uint16obj2 { | ||||
| 				return 1, true | ||||
| 				return compareLess, true | ||||
| 			} | ||||
| 		} | ||||
| 	case reflect.Uint32: | ||||
| @@ -124,13 +132,13 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (int, bool) { | ||||
| 			uint32obj1 := obj1.(uint32) | ||||
| 			uint32obj2 := obj2.(uint32) | ||||
| 			if uint32obj1 > uint32obj2 { | ||||
| 				return -1, true | ||||
| 				return compareGreater, true | ||||
| 			} | ||||
| 			if uint32obj1 == uint32obj2 { | ||||
| 				return 0, true | ||||
| 				return compareEqual, true | ||||
| 			} | ||||
| 			if uint32obj1 < uint32obj2 { | ||||
| 				return 1, true | ||||
| 				return compareLess, true | ||||
| 			} | ||||
| 		} | ||||
| 	case reflect.Uint64: | ||||
| @@ -138,13 +146,13 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (int, bool) { | ||||
| 			uint64obj1 := obj1.(uint64) | ||||
| 			uint64obj2 := obj2.(uint64) | ||||
| 			if uint64obj1 > uint64obj2 { | ||||
| 				return -1, true | ||||
| 				return compareGreater, true | ||||
| 			} | ||||
| 			if uint64obj1 == uint64obj2 { | ||||
| 				return 0, true | ||||
| 				return compareEqual, true | ||||
| 			} | ||||
| 			if uint64obj1 < uint64obj2 { | ||||
| 				return 1, true | ||||
| 				return compareLess, true | ||||
| 			} | ||||
| 		} | ||||
| 	case reflect.Float32: | ||||
| @@ -152,13 +160,13 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (int, bool) { | ||||
| 			float32obj1 := obj1.(float32) | ||||
| 			float32obj2 := obj2.(float32) | ||||
| 			if float32obj1 > float32obj2 { | ||||
| 				return -1, true | ||||
| 				return compareGreater, true | ||||
| 			} | ||||
| 			if float32obj1 == float32obj2 { | ||||
| 				return 0, true | ||||
| 				return compareEqual, true | ||||
| 			} | ||||
| 			if float32obj1 < float32obj2 { | ||||
| 				return 1, true | ||||
| 				return compareLess, true | ||||
| 			} | ||||
| 		} | ||||
| 	case reflect.Float64: | ||||
| @@ -166,13 +174,13 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (int, bool) { | ||||
| 			float64obj1 := obj1.(float64) | ||||
| 			float64obj2 := obj2.(float64) | ||||
| 			if float64obj1 > float64obj2 { | ||||
| 				return -1, true | ||||
| 				return compareGreater, true | ||||
| 			} | ||||
| 			if float64obj1 == float64obj2 { | ||||
| 				return 0, true | ||||
| 				return compareEqual, true | ||||
| 			} | ||||
| 			if float64obj1 < float64obj2 { | ||||
| 				return 1, true | ||||
| 				return compareLess, true | ||||
| 			} | ||||
| 		} | ||||
| 	case reflect.String: | ||||
| @@ -180,18 +188,18 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (int, bool) { | ||||
| 			stringobj1 := obj1.(string) | ||||
| 			stringobj2 := obj2.(string) | ||||
| 			if stringobj1 > stringobj2 { | ||||
| 				return -1, true | ||||
| 				return compareGreater, true | ||||
| 			} | ||||
| 			if stringobj1 == stringobj2 { | ||||
| 				return 0, true | ||||
| 				return compareEqual, true | ||||
| 			} | ||||
| 			if stringobj1 < stringobj2 { | ||||
| 				return 1, true | ||||
| 				return compareLess, true | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	return 0, false | ||||
| 	return compareEqual, false | ||||
| } | ||||
| 
 | ||||
| // Greater asserts that the first element is greater than the second | ||||
| @@ -200,26 +208,7 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (int, bool) { | ||||
| //    assert.Greater(t, float64(2), float64(1)) | ||||
| //    assert.Greater(t, "b", "a") | ||||
| func Greater(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool { | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| 	} | ||||
| 
 | ||||
| 	e1Kind := reflect.ValueOf(e1).Kind() | ||||
| 	e2Kind := reflect.ValueOf(e2).Kind() | ||||
| 	if e1Kind != e2Kind { | ||||
| 		return Fail(t, "Elements should be the same type", msgAndArgs...) | ||||
| 	} | ||||
| 
 | ||||
| 	res, isComparable := compare(e1, e2, e1Kind) | ||||
| 	if !isComparable { | ||||
| 		return Fail(t, fmt.Sprintf("Can not compare type \"%s\"", reflect.TypeOf(e1)), msgAndArgs...) | ||||
| 	} | ||||
| 
 | ||||
| 	if res != -1 { | ||||
| 		return Fail(t, fmt.Sprintf("\"%v\" is not greater than \"%v\"", e1, e2), msgAndArgs...) | ||||
| 	} | ||||
| 
 | ||||
| 	return true | ||||
| 	return compareTwoValues(t, e1, e2, []CompareType{compareGreater}, "\"%v\" is not greater than \"%v\"", msgAndArgs) | ||||
| } | ||||
| 
 | ||||
| // GreaterOrEqual asserts that the first element is greater than or equal to the second | ||||
| @@ -229,26 +218,7 @@ func Greater(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface | ||||
| //    assert.GreaterOrEqual(t, "b", "a") | ||||
| //    assert.GreaterOrEqual(t, "b", "b") | ||||
| func GreaterOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool { | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| 	} | ||||
| 
 | ||||
| 	e1Kind := reflect.ValueOf(e1).Kind() | ||||
| 	e2Kind := reflect.ValueOf(e2).Kind() | ||||
| 	if e1Kind != e2Kind { | ||||
| 		return Fail(t, "Elements should be the same type", msgAndArgs...) | ||||
| 	} | ||||
| 
 | ||||
| 	res, isComparable := compare(e1, e2, e1Kind) | ||||
| 	if !isComparable { | ||||
| 		return Fail(t, fmt.Sprintf("Can not compare type \"%s\"", reflect.TypeOf(e1)), msgAndArgs...) | ||||
| 	} | ||||
| 
 | ||||
| 	if res != -1 && res != 0 { | ||||
| 		return Fail(t, fmt.Sprintf("\"%v\" is not greater than or equal to \"%v\"", e1, e2), msgAndArgs...) | ||||
| 	} | ||||
| 
 | ||||
| 	return true | ||||
| 	return compareTwoValues(t, e1, e2, []CompareType{compareGreater, compareEqual}, "\"%v\" is not greater than or equal to \"%v\"", msgAndArgs) | ||||
| } | ||||
| 
 | ||||
| // Less asserts that the first element is less than the second | ||||
| @@ -257,26 +227,7 @@ func GreaterOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...in | ||||
| //    assert.Less(t, float64(1), float64(2)) | ||||
| //    assert.Less(t, "a", "b") | ||||
| func Less(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool { | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| 	} | ||||
| 
 | ||||
| 	e1Kind := reflect.ValueOf(e1).Kind() | ||||
| 	e2Kind := reflect.ValueOf(e2).Kind() | ||||
| 	if e1Kind != e2Kind { | ||||
| 		return Fail(t, "Elements should be the same type", msgAndArgs...) | ||||
| 	} | ||||
| 
 | ||||
| 	res, isComparable := compare(e1, e2, e1Kind) | ||||
| 	if !isComparable { | ||||
| 		return Fail(t, fmt.Sprintf("Can not compare type \"%s\"", reflect.TypeOf(e1)), msgAndArgs...) | ||||
| 	} | ||||
| 
 | ||||
| 	if res != 1 { | ||||
| 		return Fail(t, fmt.Sprintf("\"%v\" is not less than \"%v\"", e1, e2), msgAndArgs...) | ||||
| 	} | ||||
| 
 | ||||
| 	return true | ||||
| 	return compareTwoValues(t, e1, e2, []CompareType{compareLess}, "\"%v\" is not less than \"%v\"", msgAndArgs) | ||||
| } | ||||
| 
 | ||||
| // LessOrEqual asserts that the first element is less than or equal to the second | ||||
| @@ -286,6 +237,10 @@ func Less(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) | ||||
| //    assert.LessOrEqual(t, "a", "b") | ||||
| //    assert.LessOrEqual(t, "b", "b") | ||||
| func LessOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool { | ||||
| 	return compareTwoValues(t, e1, e2, []CompareType{compareLess, compareEqual}, "\"%v\" is not less than or equal to \"%v\"", msgAndArgs) | ||||
| } | ||||
| 
 | ||||
| func compareTwoValues(t TestingT, e1 interface{}, e2 interface{}, allowedComparesResults []CompareType, failMessage string, msgAndArgs ...interface{}) bool { | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| 	} | ||||
| @@ -296,14 +251,24 @@ func LessOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...inter | ||||
| 		return Fail(t, "Elements should be the same type", msgAndArgs...) | ||||
| 	} | ||||
| 
 | ||||
| 	res, isComparable := compare(e1, e2, e1Kind) | ||||
| 	compareResult, isComparable := compare(e1, e2, e1Kind) | ||||
| 	if !isComparable { | ||||
| 		return Fail(t, fmt.Sprintf("Can not compare type \"%s\"", reflect.TypeOf(e1)), msgAndArgs...) | ||||
| 	} | ||||
| 
 | ||||
| 	if res != 1 && res != 0 { | ||||
| 		return Fail(t, fmt.Sprintf("\"%v\" is not less than or equal to \"%v\"", e1, e2), msgAndArgs...) | ||||
| 	if !containsValue(allowedComparesResults, compareResult) { | ||||
| 		return Fail(t, fmt.Sprintf(failMessage, e1, e2), msgAndArgs...) | ||||
| 	} | ||||
| 
 | ||||
| 	return true | ||||
| } | ||||
| 
 | ||||
| func containsValue(values []CompareType, value CompareType) bool { | ||||
| 	for _, v := range values { | ||||
| 		if v == value { | ||||
| 			return true | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	return false | ||||
| } | ||||
							
								
								
									
										40
									
								
								vendor/github.com/stretchr/testify/assert/assertion_format.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										40
									
								
								vendor/github.com/stretchr/testify/assert/assertion_format.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -93,7 +93,7 @@ func EqualErrorf(t TestingT, theError error, errString string, msg string, args | ||||
| // EqualValuesf asserts that two objects are equal or convertable to the same types | ||||
| // and equal. | ||||
| // | ||||
| //    assert.EqualValuesf(t, uint32(123, "error message %s", "formatted"), int32(123)) | ||||
| //    assert.EqualValuesf(t, uint32(123), int32(123), "error message %s", "formatted") | ||||
| func EqualValuesf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) bool { | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| @@ -127,7 +127,7 @@ func Eventuallyf(t TestingT, condition func() bool, waitFor time.Duration, tick | ||||
|  | ||||
| // Exactlyf asserts that two objects are equal in value and type. | ||||
| // | ||||
| //    assert.Exactlyf(t, int32(123, "error message %s", "formatted"), int64(123)) | ||||
| //    assert.Exactlyf(t, int32(123), int64(123), "error message %s", "formatted") | ||||
| func Exactlyf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) bool { | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| @@ -173,7 +173,7 @@ func FileExistsf(t TestingT, path string, msg string, args ...interface{}) bool | ||||
| // Greaterf asserts that the first element is greater than the second | ||||
| // | ||||
| //    assert.Greaterf(t, 2, 1, "error message %s", "formatted") | ||||
| //    assert.Greaterf(t, float64(2, "error message %s", "formatted"), float64(1)) | ||||
| //    assert.Greaterf(t, float64(2), float64(1), "error message %s", "formatted") | ||||
| //    assert.Greaterf(t, "b", "a", "error message %s", "formatted") | ||||
| func Greaterf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool { | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| @@ -225,7 +225,7 @@ func HTTPBodyNotContainsf(t TestingT, handler http.HandlerFunc, method string, u | ||||
| // | ||||
| //  assert.HTTPErrorf(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} | ||||
| // | ||||
| // Returns whether the assertion was successful (true, "error message %s", "formatted") or not (false). | ||||
| // Returns whether the assertion was successful (true) or not (false). | ||||
| func HTTPErrorf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) bool { | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| @@ -237,7 +237,7 @@ func HTTPErrorf(t TestingT, handler http.HandlerFunc, method string, url string, | ||||
| // | ||||
| //  assert.HTTPRedirectf(t, myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} | ||||
| // | ||||
| // Returns whether the assertion was successful (true, "error message %s", "formatted") or not (false). | ||||
| // Returns whether the assertion was successful (true) or not (false). | ||||
| func HTTPRedirectf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) bool { | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| @@ -245,6 +245,18 @@ func HTTPRedirectf(t TestingT, handler http.HandlerFunc, method string, url stri | ||||
| 	return HTTPRedirect(t, handler, method, url, values, append([]interface{}{msg}, args...)...) | ||||
| } | ||||
|  | ||||
| // HTTPStatusCodef asserts that a specified handler returns a specified status code. | ||||
| // | ||||
| //  assert.HTTPStatusCodef(t, myHandler, "GET", "/notImplemented", nil, 501, "error message %s", "formatted") | ||||
| // | ||||
| // Returns whether the assertion was successful (true) or not (false). | ||||
| func HTTPStatusCodef(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msg string, args ...interface{}) bool { | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| 	} | ||||
| 	return HTTPStatusCode(t, handler, method, url, values, statuscode, append([]interface{}{msg}, args...)...) | ||||
| } | ||||
|  | ||||
| // HTTPSuccessf asserts that a specified handler returns a success status code. | ||||
| // | ||||
| //  assert.HTTPSuccessf(t, myHandler, "POST", "http://www.google.com", nil, "error message %s", "formatted") | ||||
| @@ -259,7 +271,7 @@ func HTTPSuccessf(t TestingT, handler http.HandlerFunc, method string, url strin | ||||
|  | ||||
| // Implementsf asserts that an object is implemented by the specified interface. | ||||
| // | ||||
| //    assert.Implementsf(t, (*MyInterface, "error message %s", "formatted")(nil), new(MyObject)) | ||||
| //    assert.Implementsf(t, (*MyInterface)(nil), new(MyObject), "error message %s", "formatted") | ||||
| func Implementsf(t TestingT, interfaceObject interface{}, object interface{}, msg string, args ...interface{}) bool { | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| @@ -341,7 +353,7 @@ func Lenf(t TestingT, object interface{}, length int, msg string, args ...interf | ||||
| // Lessf asserts that the first element is less than the second | ||||
| // | ||||
| //    assert.Lessf(t, 1, 2, "error message %s", "formatted") | ||||
| //    assert.Lessf(t, float64(1, "error message %s", "formatted"), float64(2)) | ||||
| //    assert.Lessf(t, float64(1), float64(2), "error message %s", "formatted") | ||||
| //    assert.Lessf(t, "a", "b", "error message %s", "formatted") | ||||
| func Lessf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool { | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| @@ -454,6 +466,16 @@ func NotEqualf(t TestingT, expected interface{}, actual interface{}, msg string, | ||||
| 	return NotEqual(t, expected, actual, append([]interface{}{msg}, args...)...) | ||||
| } | ||||
|  | ||||
| // NotEqualValuesf asserts that two objects are not equal even when converted to the same type | ||||
| // | ||||
| //    assert.NotEqualValuesf(t, obj1, obj2, "error message %s", "formatted") | ||||
| func NotEqualValuesf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) bool { | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| 	} | ||||
| 	return NotEqualValues(t, expected, actual, append([]interface{}{msg}, args...)...) | ||||
| } | ||||
|  | ||||
| // NotNilf asserts that the specified object is not nil. | ||||
| // | ||||
| //    assert.NotNilf(t, err, "error message %s", "formatted") | ||||
| @@ -476,7 +498,7 @@ func NotPanicsf(t TestingT, f PanicTestFunc, msg string, args ...interface{}) bo | ||||
|  | ||||
| // NotRegexpf asserts that a specified regexp does not match a string. | ||||
| // | ||||
| //  assert.NotRegexpf(t, regexp.MustCompile("starts", "error message %s", "formatted"), "it's starting") | ||||
| //  assert.NotRegexpf(t, regexp.MustCompile("starts"), "it's starting", "error message %s", "formatted") | ||||
| //  assert.NotRegexpf(t, "^start", "it's not starting", "error message %s", "formatted") | ||||
| func NotRegexpf(t TestingT, rx interface{}, str interface{}, msg string, args ...interface{}) bool { | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| @@ -552,7 +574,7 @@ func PanicsWithValuef(t TestingT, expected interface{}, f PanicTestFunc, msg str | ||||
|  | ||||
| // Regexpf asserts that a specified regexp matches a string. | ||||
| // | ||||
| //  assert.Regexpf(t, regexp.MustCompile("start", "error message %s", "formatted"), "it's starting") | ||||
| //  assert.Regexpf(t, regexp.MustCompile("start"), "it's starting", "error message %s", "formatted") | ||||
| //  assert.Regexpf(t, "start...$", "it's not starting", "error message %s", "formatted") | ||||
| func Regexpf(t TestingT, rx interface{}, str interface{}, msg string, args ...interface{}) bool { | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
|   | ||||
							
								
								
									
										62
									
								
								vendor/github.com/stretchr/testify/assert/assertion_forward.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										62
									
								
								vendor/github.com/stretchr/testify/assert/assertion_forward.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -169,7 +169,7 @@ func (a *Assertions) EqualValues(expected interface{}, actual interface{}, msgAn | ||||
| // EqualValuesf asserts that two objects are equal or convertable to the same types | ||||
| // and equal. | ||||
| // | ||||
| //    a.EqualValuesf(uint32(123, "error message %s", "formatted"), int32(123)) | ||||
| //    a.EqualValuesf(uint32(123), int32(123), "error message %s", "formatted") | ||||
| func (a *Assertions) EqualValuesf(expected interface{}, actual interface{}, msg string, args ...interface{}) bool { | ||||
| 	if h, ok := a.t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| @@ -251,7 +251,7 @@ func (a *Assertions) Exactly(expected interface{}, actual interface{}, msgAndArg | ||||
|  | ||||
| // Exactlyf asserts that two objects are equal in value and type. | ||||
| // | ||||
| //    a.Exactlyf(int32(123, "error message %s", "formatted"), int64(123)) | ||||
| //    a.Exactlyf(int32(123), int64(123), "error message %s", "formatted") | ||||
| func (a *Assertions) Exactlyf(expected interface{}, actual interface{}, msg string, args ...interface{}) bool { | ||||
| 	if h, ok := a.t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| @@ -370,7 +370,7 @@ func (a *Assertions) GreaterOrEqualf(e1 interface{}, e2 interface{}, msg string, | ||||
| // Greaterf asserts that the first element is greater than the second | ||||
| // | ||||
| //    a.Greaterf(2, 1, "error message %s", "formatted") | ||||
| //    a.Greaterf(float64(2, "error message %s", "formatted"), float64(1)) | ||||
| //    a.Greaterf(float64(2), float64(1), "error message %s", "formatted") | ||||
| //    a.Greaterf("b", "a", "error message %s", "formatted") | ||||
| func (a *Assertions) Greaterf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool { | ||||
| 	if h, ok := a.t.(tHelper); ok { | ||||
| @@ -447,7 +447,7 @@ func (a *Assertions) HTTPError(handler http.HandlerFunc, method string, url stri | ||||
| // | ||||
| //  a.HTTPErrorf(myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} | ||||
| // | ||||
| // Returns whether the assertion was successful (true, "error message %s", "formatted") or not (false). | ||||
| // Returns whether the assertion was successful (true) or not (false). | ||||
| func (a *Assertions) HTTPErrorf(handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) bool { | ||||
| 	if h, ok := a.t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| @@ -471,7 +471,7 @@ func (a *Assertions) HTTPRedirect(handler http.HandlerFunc, method string, url s | ||||
| // | ||||
| //  a.HTTPRedirectf(myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} | ||||
| // | ||||
| // Returns whether the assertion was successful (true, "error message %s", "formatted") or not (false). | ||||
| // Returns whether the assertion was successful (true) or not (false). | ||||
| func (a *Assertions) HTTPRedirectf(handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) bool { | ||||
| 	if h, ok := a.t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| @@ -479,6 +479,30 @@ func (a *Assertions) HTTPRedirectf(handler http.HandlerFunc, method string, url | ||||
| 	return HTTPRedirectf(a.t, handler, method, url, values, msg, args...) | ||||
| } | ||||
|  | ||||
| // HTTPStatusCode asserts that a specified handler returns a specified status code. | ||||
| // | ||||
| //  a.HTTPStatusCode(myHandler, "GET", "/notImplemented", nil, 501) | ||||
| // | ||||
| // Returns whether the assertion was successful (true) or not (false). | ||||
| func (a *Assertions) HTTPStatusCode(handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msgAndArgs ...interface{}) bool { | ||||
| 	if h, ok := a.t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| 	} | ||||
| 	return HTTPStatusCode(a.t, handler, method, url, values, statuscode, msgAndArgs...) | ||||
| } | ||||
|  | ||||
| // HTTPStatusCodef asserts that a specified handler returns a specified status code. | ||||
| // | ||||
| //  a.HTTPStatusCodef(myHandler, "GET", "/notImplemented", nil, 501, "error message %s", "formatted") | ||||
| // | ||||
| // Returns whether the assertion was successful (true) or not (false). | ||||
| func (a *Assertions) HTTPStatusCodef(handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msg string, args ...interface{}) bool { | ||||
| 	if h, ok := a.t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| 	} | ||||
| 	return HTTPStatusCodef(a.t, handler, method, url, values, statuscode, msg, args...) | ||||
| } | ||||
|  | ||||
| // HTTPSuccess asserts that a specified handler returns a success status code. | ||||
| // | ||||
| //  a.HTTPSuccess(myHandler, "POST", "http://www.google.com", nil) | ||||
| @@ -515,7 +539,7 @@ func (a *Assertions) Implements(interfaceObject interface{}, object interface{}, | ||||
|  | ||||
| // Implementsf asserts that an object is implemented by the specified interface. | ||||
| // | ||||
| //    a.Implementsf((*MyInterface, "error message %s", "formatted")(nil), new(MyObject)) | ||||
| //    a.Implementsf((*MyInterface)(nil), new(MyObject), "error message %s", "formatted") | ||||
| func (a *Assertions) Implementsf(interfaceObject interface{}, object interface{}, msg string, args ...interface{}) bool { | ||||
| 	if h, ok := a.t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| @@ -706,7 +730,7 @@ func (a *Assertions) LessOrEqualf(e1 interface{}, e2 interface{}, msg string, ar | ||||
| // Lessf asserts that the first element is less than the second | ||||
| // | ||||
| //    a.Lessf(1, 2, "error message %s", "formatted") | ||||
| //    a.Lessf(float64(1, "error message %s", "formatted"), float64(2)) | ||||
| //    a.Lessf(float64(1), float64(2), "error message %s", "formatted") | ||||
| //    a.Lessf("a", "b", "error message %s", "formatted") | ||||
| func (a *Assertions) Lessf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool { | ||||
| 	if h, ok := a.t.(tHelper); ok { | ||||
| @@ -884,6 +908,26 @@ func (a *Assertions) NotEqual(expected interface{}, actual interface{}, msgAndAr | ||||
| 	return NotEqual(a.t, expected, actual, msgAndArgs...) | ||||
| } | ||||
|  | ||||
| // NotEqualValues asserts that two objects are not equal even when converted to the same type | ||||
| // | ||||
| //    a.NotEqualValues(obj1, obj2) | ||||
| func (a *Assertions) NotEqualValues(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool { | ||||
| 	if h, ok := a.t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| 	} | ||||
| 	return NotEqualValues(a.t, expected, actual, msgAndArgs...) | ||||
| } | ||||
|  | ||||
| // NotEqualValuesf asserts that two objects are not equal even when converted to the same type | ||||
| // | ||||
| //    a.NotEqualValuesf(obj1, obj2, "error message %s", "formatted") | ||||
| func (a *Assertions) NotEqualValuesf(expected interface{}, actual interface{}, msg string, args ...interface{}) bool { | ||||
| 	if h, ok := a.t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| 	} | ||||
| 	return NotEqualValuesf(a.t, expected, actual, msg, args...) | ||||
| } | ||||
|  | ||||
| // NotEqualf asserts that the specified values are NOT equal. | ||||
| // | ||||
| //    a.NotEqualf(obj1, obj2, "error message %s", "formatted") | ||||
| @@ -950,7 +994,7 @@ func (a *Assertions) NotRegexp(rx interface{}, str interface{}, msgAndArgs ...in | ||||
|  | ||||
| // NotRegexpf asserts that a specified regexp does not match a string. | ||||
| // | ||||
| //  a.NotRegexpf(regexp.MustCompile("starts", "error message %s", "formatted"), "it's starting") | ||||
| //  a.NotRegexpf(regexp.MustCompile("starts"), "it's starting", "error message %s", "formatted") | ||||
| //  a.NotRegexpf("^start", "it's not starting", "error message %s", "formatted") | ||||
| func (a *Assertions) NotRegexpf(rx interface{}, str interface{}, msg string, args ...interface{}) bool { | ||||
| 	if h, ok := a.t.(tHelper); ok { | ||||
| @@ -1102,7 +1146,7 @@ func (a *Assertions) Regexp(rx interface{}, str interface{}, msgAndArgs ...inter | ||||
|  | ||||
| // Regexpf asserts that a specified regexp matches a string. | ||||
| // | ||||
| //  a.Regexpf(regexp.MustCompile("start", "error message %s", "formatted"), "it's starting") | ||||
| //  a.Regexpf(regexp.MustCompile("start"), "it's starting", "error message %s", "formatted") | ||||
| //  a.Regexpf("start...$", "it's not starting", "error message %s", "formatted") | ||||
| func (a *Assertions) Regexpf(rx interface{}, str interface{}, msg string, args ...interface{}) bool { | ||||
| 	if h, ok := a.t.(tHelper); ok { | ||||
|   | ||||
							
								
								
									
										193
									
								
								vendor/github.com/stretchr/testify/assert/assertions.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										193
									
								
								vendor/github.com/stretchr/testify/assert/assertions.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -19,7 +19,7 @@ import ( | ||||
|  | ||||
| 	"github.com/davecgh/go-spew/spew" | ||||
| 	"github.com/pmezard/go-difflib/difflib" | ||||
| 	yaml "gopkg.in/yaml.v2" | ||||
| 	yaml "gopkg.in/yaml.v3" | ||||
| ) | ||||
|  | ||||
| //go:generate sh -c "cd ../_codegen && go build && cd - && ../_codegen/_codegen -output-package=assert -template=assertion_format.go.tmpl" | ||||
| @@ -45,7 +45,7 @@ type BoolAssertionFunc func(TestingT, bool, ...interface{}) bool | ||||
| // for table driven tests. | ||||
| type ErrorAssertionFunc func(TestingT, error, ...interface{}) bool | ||||
|  | ||||
| // Comparison a custom function that returns true on success and false on failure | ||||
| // Comparison is a custom function that returns true on success and false on failure | ||||
| type Comparison func() (success bool) | ||||
|  | ||||
| /* | ||||
| @@ -104,11 +104,11 @@ the problem actually occurred in calling code.*/ | ||||
| // failed. | ||||
| func CallerInfo() []string { | ||||
|  | ||||
| 	pc := uintptr(0) | ||||
| 	file := "" | ||||
| 	line := 0 | ||||
| 	ok := false | ||||
| 	name := "" | ||||
| 	var pc uintptr | ||||
| 	var ok bool | ||||
| 	var file string | ||||
| 	var line int | ||||
| 	var name string | ||||
|  | ||||
| 	callers := []string{} | ||||
| 	for i := 0; ; i++ { | ||||
| @@ -429,14 +429,27 @@ func samePointers(first, second interface{}) bool { | ||||
| // to a type conversion in the Go grammar. | ||||
| func formatUnequalValues(expected, actual interface{}) (e string, a string) { | ||||
| 	if reflect.TypeOf(expected) != reflect.TypeOf(actual) { | ||||
| 		return fmt.Sprintf("%T(%#v)", expected, expected), | ||||
| 			fmt.Sprintf("%T(%#v)", actual, actual) | ||||
| 		return fmt.Sprintf("%T(%s)", expected, truncatingFormat(expected)), | ||||
| 			fmt.Sprintf("%T(%s)", actual, truncatingFormat(actual)) | ||||
| 	} | ||||
| 	switch expected.(type) { | ||||
| 	case time.Duration: | ||||
| 		return fmt.Sprintf("%v", expected), fmt.Sprintf("%v", actual) | ||||
| 	} | ||||
| 	return fmt.Sprintf("%#v", expected), fmt.Sprintf("%#v", actual) | ||||
| 	return truncatingFormat(expected), truncatingFormat(actual) | ||||
| } | ||||
|  | ||||
| // truncatingFormat formats the data and truncates it if it's too long. | ||||
| // | ||||
| // This helps keep formatted error messages lines from exceeding the | ||||
| // bufio.MaxScanTokenSize max line length that the go testing framework imposes. | ||||
| func truncatingFormat(data interface{}) string { | ||||
| 	value := fmt.Sprintf("%#v", data) | ||||
| 	max := bufio.MaxScanTokenSize - 100 // Give us some space the type info too if needed. | ||||
| 	if len(value) > max { | ||||
| 		value = value[0:max] + "<... truncated>" | ||||
| 	} | ||||
| 	return value | ||||
| } | ||||
|  | ||||
| // EqualValues asserts that two objects are equal or convertable to the same types | ||||
| @@ -483,12 +496,12 @@ func Exactly(t TestingT, expected, actual interface{}, msgAndArgs ...interface{} | ||||
| // | ||||
| //    assert.NotNil(t, err) | ||||
| func NotNil(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| 	} | ||||
| 	if !isNil(object) { | ||||
| 		return true | ||||
| 	} | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| 	} | ||||
| 	return Fail(t, "Expected value not to be nil.", msgAndArgs...) | ||||
| } | ||||
|  | ||||
| @@ -529,12 +542,12 @@ func isNil(object interface{}) bool { | ||||
| // | ||||
| //    assert.Nil(t, err) | ||||
| func Nil(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| 	} | ||||
| 	if isNil(object) { | ||||
| 		return true | ||||
| 	} | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| 	} | ||||
| 	return Fail(t, fmt.Sprintf("Expected nil, but got: %#v", object), msgAndArgs...) | ||||
| } | ||||
|  | ||||
| @@ -571,12 +584,11 @@ func isEmpty(object interface{}) bool { | ||||
| // | ||||
| //  assert.Empty(t, obj) | ||||
| func Empty(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| 	} | ||||
|  | ||||
| 	pass := isEmpty(object) | ||||
| 	if !pass { | ||||
| 		if h, ok := t.(tHelper); ok { | ||||
| 			h.Helper() | ||||
| 		} | ||||
| 		Fail(t, fmt.Sprintf("Should be empty, but was %v", object), msgAndArgs...) | ||||
| 	} | ||||
|  | ||||
| @@ -591,12 +603,11 @@ func Empty(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { | ||||
| //    assert.Equal(t, "two", obj[1]) | ||||
| //  } | ||||
| func NotEmpty(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| 	} | ||||
|  | ||||
| 	pass := !isEmpty(object) | ||||
| 	if !pass { | ||||
| 		if h, ok := t.(tHelper); ok { | ||||
| 			h.Helper() | ||||
| 		} | ||||
| 		Fail(t, fmt.Sprintf("Should NOT be empty, but was %v", object), msgAndArgs...) | ||||
| 	} | ||||
|  | ||||
| @@ -639,16 +650,10 @@ func Len(t TestingT, object interface{}, length int, msgAndArgs ...interface{}) | ||||
| // | ||||
| //    assert.True(t, myBool) | ||||
| func True(t TestingT, value bool, msgAndArgs ...interface{}) bool { | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| 	} | ||||
| 	if h, ok := t.(interface { | ||||
| 		Helper() | ||||
| 	}); ok { | ||||
| 		h.Helper() | ||||
| 	} | ||||
|  | ||||
| 	if value != true { | ||||
| 	if !value { | ||||
| 		if h, ok := t.(tHelper); ok { | ||||
| 			h.Helper() | ||||
| 		} | ||||
| 		return Fail(t, "Should be true", msgAndArgs...) | ||||
| 	} | ||||
|  | ||||
| @@ -660,11 +665,10 @@ func True(t TestingT, value bool, msgAndArgs ...interface{}) bool { | ||||
| // | ||||
| //    assert.False(t, myBool) | ||||
| func False(t TestingT, value bool, msgAndArgs ...interface{}) bool { | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| 	} | ||||
|  | ||||
| 	if value != false { | ||||
| 	if value { | ||||
| 		if h, ok := t.(tHelper); ok { | ||||
| 			h.Helper() | ||||
| 		} | ||||
| 		return Fail(t, "Should be false", msgAndArgs...) | ||||
| 	} | ||||
|  | ||||
| @@ -695,6 +699,21 @@ func NotEqual(t TestingT, expected, actual interface{}, msgAndArgs ...interface{ | ||||
|  | ||||
| } | ||||
|  | ||||
| // NotEqualValues asserts that two objects are not equal even when converted to the same type | ||||
| // | ||||
| //    assert.NotEqualValues(t, obj1, obj2) | ||||
| func NotEqualValues(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool { | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| 	} | ||||
|  | ||||
| 	if ObjectsAreEqualValues(expected, actual) { | ||||
| 		return Fail(t, fmt.Sprintf("Should not be: %#v\n", actual), msgAndArgs...) | ||||
| 	} | ||||
|  | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // containsElement try loop over the list check if the list includes the element. | ||||
| // return (false, false) if impossible. | ||||
| // return (true, false) if element was not found. | ||||
| @@ -747,10 +766,10 @@ func Contains(t TestingT, s, contains interface{}, msgAndArgs ...interface{}) bo | ||||
|  | ||||
| 	ok, found := includeElement(s, contains) | ||||
| 	if !ok { | ||||
| 		return Fail(t, fmt.Sprintf("\"%s\" could not be applied builtin len()", s), msgAndArgs...) | ||||
| 		return Fail(t, fmt.Sprintf("%#v could not be applied builtin len()", s), msgAndArgs...) | ||||
| 	} | ||||
| 	if !found { | ||||
| 		return Fail(t, fmt.Sprintf("\"%s\" does not contain \"%s\"", s, contains), msgAndArgs...) | ||||
| 		return Fail(t, fmt.Sprintf("%#v does not contain %#v", s, contains), msgAndArgs...) | ||||
| 	} | ||||
|  | ||||
| 	return true | ||||
| @@ -881,27 +900,39 @@ func ElementsMatch(t TestingT, listA, listB interface{}, msgAndArgs ...interface | ||||
| 		return true | ||||
| 	} | ||||
|  | ||||
| 	aKind := reflect.TypeOf(listA).Kind() | ||||
| 	bKind := reflect.TypeOf(listB).Kind() | ||||
|  | ||||
| 	if aKind != reflect.Array && aKind != reflect.Slice { | ||||
| 		return Fail(t, fmt.Sprintf("%q has an unsupported type %s", listA, aKind), msgAndArgs...) | ||||
| 	if !isList(t, listA, msgAndArgs...) || !isList(t, listB, msgAndArgs...) { | ||||
| 		return false | ||||
| 	} | ||||
|  | ||||
| 	if bKind != reflect.Array && bKind != reflect.Slice { | ||||
| 		return Fail(t, fmt.Sprintf("%q has an unsupported type %s", listB, bKind), msgAndArgs...) | ||||
| 	extraA, extraB := diffLists(listA, listB) | ||||
|  | ||||
| 	if len(extraA) == 0 && len(extraB) == 0 { | ||||
| 		return true | ||||
| 	} | ||||
|  | ||||
| 	return Fail(t, formatListDiff(listA, listB, extraA, extraB), msgAndArgs...) | ||||
| } | ||||
|  | ||||
| // isList checks that the provided value is array or slice. | ||||
| func isList(t TestingT, list interface{}, msgAndArgs ...interface{}) (ok bool) { | ||||
| 	kind := reflect.TypeOf(list).Kind() | ||||
| 	if kind != reflect.Array && kind != reflect.Slice { | ||||
| 		return Fail(t, fmt.Sprintf("%q has an unsupported type %s, expecting array or slice", list, kind), | ||||
| 			msgAndArgs...) | ||||
| 	} | ||||
| 	return true | ||||
| } | ||||
|  | ||||
| // diffLists diffs two arrays/slices and returns slices of elements that are only in A and only in B. | ||||
| // If some element is present multiple times, each instance is counted separately (e.g. if something is 2x in A and | ||||
| // 5x in B, it will be 0x in extraA and 3x in extraB). The order of items in both lists is ignored. | ||||
| func diffLists(listA, listB interface{}) (extraA, extraB []interface{}) { | ||||
| 	aValue := reflect.ValueOf(listA) | ||||
| 	bValue := reflect.ValueOf(listB) | ||||
|  | ||||
| 	aLen := aValue.Len() | ||||
| 	bLen := bValue.Len() | ||||
|  | ||||
| 	if aLen != bLen { | ||||
| 		return Fail(t, fmt.Sprintf("lengths don't match: %d != %d", aLen, bLen), msgAndArgs...) | ||||
| 	} | ||||
|  | ||||
| 	// Mark indexes in bValue that we already used | ||||
| 	visited := make([]bool, bLen) | ||||
| 	for i := 0; i < aLen; i++ { | ||||
| @@ -918,11 +949,38 @@ func ElementsMatch(t TestingT, listA, listB interface{}, msgAndArgs ...interface | ||||
| 			} | ||||
| 		} | ||||
| 		if !found { | ||||
| 			return Fail(t, fmt.Sprintf("element %s appears more times in %s than in %s", element, aValue, bValue), msgAndArgs...) | ||||
| 			extraA = append(extraA, element) | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return true | ||||
| 	for j := 0; j < bLen; j++ { | ||||
| 		if visited[j] { | ||||
| 			continue | ||||
| 		} | ||||
| 		extraB = append(extraB, bValue.Index(j).Interface()) | ||||
| 	} | ||||
|  | ||||
| 	return | ||||
| } | ||||
|  | ||||
| func formatListDiff(listA, listB interface{}, extraA, extraB []interface{}) string { | ||||
| 	var msg bytes.Buffer | ||||
|  | ||||
| 	msg.WriteString("elements differ") | ||||
| 	if len(extraA) > 0 { | ||||
| 		msg.WriteString("\n\nextra elements in list A:\n") | ||||
| 		msg.WriteString(spewConfig.Sdump(extraA)) | ||||
| 	} | ||||
| 	if len(extraB) > 0 { | ||||
| 		msg.WriteString("\n\nextra elements in list B:\n") | ||||
| 		msg.WriteString(spewConfig.Sdump(extraB)) | ||||
| 	} | ||||
| 	msg.WriteString("\n\nlistA:\n") | ||||
| 	msg.WriteString(spewConfig.Sdump(listA)) | ||||
| 	msg.WriteString("\n\nlistB:\n") | ||||
| 	msg.WriteString(spewConfig.Sdump(listB)) | ||||
|  | ||||
| 	return msg.String() | ||||
| } | ||||
|  | ||||
| // Condition uses a Comparison to assert a complex condition. | ||||
| @@ -1058,6 +1116,8 @@ func toFloat(x interface{}) (float64, bool) { | ||||
| 	xok := true | ||||
|  | ||||
| 	switch xn := x.(type) { | ||||
| 	case uint: | ||||
| 		xf = float64(xn) | ||||
| 	case uint8: | ||||
| 		xf = float64(xn) | ||||
| 	case uint16: | ||||
| @@ -1079,7 +1139,7 @@ func toFloat(x interface{}) (float64, bool) { | ||||
| 	case float32: | ||||
| 		xf = float64(xn) | ||||
| 	case float64: | ||||
| 		xf = float64(xn) | ||||
| 		xf = xn | ||||
| 	case time.Duration: | ||||
| 		xf = float64(xn) | ||||
| 	default: | ||||
| @@ -1193,6 +1253,9 @@ func calcRelativeError(expected, actual interface{}) (float64, error) { | ||||
| 	if !aok { | ||||
| 		return 0, fmt.Errorf("expected value %q cannot be converted to float", expected) | ||||
| 	} | ||||
| 	if math.IsNaN(af) { | ||||
| 		return 0, errors.New("expected value must not be NaN") | ||||
| 	} | ||||
| 	if af == 0 { | ||||
| 		return 0, fmt.Errorf("expected value must have a value other than zero to calculate the relative error") | ||||
| 	} | ||||
| @@ -1200,6 +1263,9 @@ func calcRelativeError(expected, actual interface{}) (float64, error) { | ||||
| 	if !bok { | ||||
| 		return 0, fmt.Errorf("actual value %q cannot be converted to float", actual) | ||||
| 	} | ||||
| 	if math.IsNaN(bf) { | ||||
| 		return 0, errors.New("actual value must not be NaN") | ||||
| 	} | ||||
|  | ||||
| 	return math.Abs(af-bf) / math.Abs(af), nil | ||||
| } | ||||
| @@ -1209,6 +1275,9 @@ func InEpsilon(t TestingT, expected, actual interface{}, epsilon float64, msgAnd | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| 	} | ||||
| 	if math.IsNaN(epsilon) { | ||||
| 		return Fail(t, "epsilon must not be NaN") | ||||
| 	} | ||||
| 	actualEpsilon, err := calcRelativeError(expected, actual) | ||||
| 	if err != nil { | ||||
| 		return Fail(t, err.Error(), msgAndArgs...) | ||||
| @@ -1256,10 +1325,10 @@ func InEpsilonSlice(t TestingT, expected, actual interface{}, epsilon float64, m | ||||
| //	   assert.Equal(t, expectedObj, actualObj) | ||||
| //   } | ||||
| func NoError(t TestingT, err error, msgAndArgs ...interface{}) bool { | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| 	} | ||||
| 	if err != nil { | ||||
| 		if h, ok := t.(tHelper); ok { | ||||
| 			h.Helper() | ||||
| 		} | ||||
| 		return Fail(t, fmt.Sprintf("Received unexpected error:\n%+v", err), msgAndArgs...) | ||||
| 	} | ||||
|  | ||||
| @@ -1273,11 +1342,10 @@ func NoError(t TestingT, err error, msgAndArgs ...interface{}) bool { | ||||
| //	   assert.Equal(t, expectedError, err) | ||||
| //   } | ||||
| func Error(t TestingT, err error, msgAndArgs ...interface{}) bool { | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| 	} | ||||
|  | ||||
| 	if err == nil { | ||||
| 		if h, ok := t.(tHelper); ok { | ||||
| 			h.Helper() | ||||
| 		} | ||||
| 		return Fail(t, "An error is expected but got nil.", msgAndArgs...) | ||||
| 	} | ||||
|  | ||||
| @@ -1553,6 +1621,7 @@ var spewConfig = spew.ConfigState{ | ||||
| 	DisablePointerAddresses: true, | ||||
| 	DisableCapacities:       true, | ||||
| 	SortKeys:                true, | ||||
| 	DisableMethods:          true, | ||||
| } | ||||
|  | ||||
| type tHelper interface { | ||||
|   | ||||
							
								
								
									
										25
									
								
								vendor/github.com/stretchr/testify/assert/http_assertions.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										25
									
								
								vendor/github.com/stretchr/testify/assert/http_assertions.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -33,7 +33,6 @@ func HTTPSuccess(t TestingT, handler http.HandlerFunc, method, url string, value | ||||
| 	code, err := httpCode(handler, method, url, values) | ||||
| 	if err != nil { | ||||
| 		Fail(t, fmt.Sprintf("Failed to build test request, got error: %s", err)) | ||||
| 		return false | ||||
| 	} | ||||
|  | ||||
| 	isSuccessCode := code >= http.StatusOK && code <= http.StatusPartialContent | ||||
| @@ -56,7 +55,6 @@ func HTTPRedirect(t TestingT, handler http.HandlerFunc, method, url string, valu | ||||
| 	code, err := httpCode(handler, method, url, values) | ||||
| 	if err != nil { | ||||
| 		Fail(t, fmt.Sprintf("Failed to build test request, got error: %s", err)) | ||||
| 		return false | ||||
| 	} | ||||
|  | ||||
| 	isRedirectCode := code >= http.StatusMultipleChoices && code <= http.StatusTemporaryRedirect | ||||
| @@ -79,7 +77,6 @@ func HTTPError(t TestingT, handler http.HandlerFunc, method, url string, values | ||||
| 	code, err := httpCode(handler, method, url, values) | ||||
| 	if err != nil { | ||||
| 		Fail(t, fmt.Sprintf("Failed to build test request, got error: %s", err)) | ||||
| 		return false | ||||
| 	} | ||||
|  | ||||
| 	isErrorCode := code >= http.StatusBadRequest | ||||
| @@ -90,6 +87,28 @@ func HTTPError(t TestingT, handler http.HandlerFunc, method, url string, values | ||||
| 	return isErrorCode | ||||
| } | ||||
|  | ||||
| // HTTPStatusCode asserts that a specified handler returns a specified status code. | ||||
| // | ||||
| //  assert.HTTPStatusCode(t, myHandler, "GET", "/notImplemented", nil, 501) | ||||
| // | ||||
| // Returns whether the assertion was successful (true) or not (false). | ||||
| func HTTPStatusCode(t TestingT, handler http.HandlerFunc, method, url string, values url.Values, statuscode int, msgAndArgs ...interface{}) bool { | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| 	} | ||||
| 	code, err := httpCode(handler, method, url, values) | ||||
| 	if err != nil { | ||||
| 		Fail(t, fmt.Sprintf("Failed to build test request, got error: %s", err)) | ||||
| 	} | ||||
|  | ||||
| 	successful := code == statuscode | ||||
| 	if !successful { | ||||
| 		Fail(t, fmt.Sprintf("Expected HTTP status code %d for %q but received %d", statuscode, url+"?"+values.Encode(), code)) | ||||
| 	} | ||||
|  | ||||
| 	return successful | ||||
| } | ||||
|  | ||||
| // HTTPBody is a helper that returns HTTP body of the response. It returns | ||||
| // empty string if building a new request fails. | ||||
| func HTTPBody(handler http.HandlerFunc, method, url string, values url.Values) string { | ||||
|   | ||||
							
								
								
									
										74
									
								
								vendor/github.com/stretchr/testify/require/require.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										74
									
								
								vendor/github.com/stretchr/testify/require/require.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -212,7 +212,7 @@ func EqualValues(t TestingT, expected interface{}, actual interface{}, msgAndArg | ||||
| // EqualValuesf asserts that two objects are equal or convertable to the same types | ||||
| // and equal. | ||||
| // | ||||
| //    assert.EqualValuesf(t, uint32(123, "error message %s", "formatted"), int32(123)) | ||||
| //    assert.EqualValuesf(t, uint32(123), int32(123), "error message %s", "formatted") | ||||
| func EqualValuesf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) { | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| @@ -315,7 +315,7 @@ func Exactly(t TestingT, expected interface{}, actual interface{}, msgAndArgs .. | ||||
|  | ||||
| // Exactlyf asserts that two objects are equal in value and type. | ||||
| // | ||||
| //    assert.Exactlyf(t, int32(123, "error message %s", "formatted"), int64(123)) | ||||
| //    assert.Exactlyf(t, int32(123), int64(123), "error message %s", "formatted") | ||||
| func Exactlyf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) { | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| @@ -470,7 +470,7 @@ func GreaterOrEqualf(t TestingT, e1 interface{}, e2 interface{}, msg string, arg | ||||
| // Greaterf asserts that the first element is greater than the second | ||||
| // | ||||
| //    assert.Greaterf(t, 2, 1, "error message %s", "formatted") | ||||
| //    assert.Greaterf(t, float64(2, "error message %s", "formatted"), float64(1)) | ||||
| //    assert.Greaterf(t, float64(2), float64(1), "error message %s", "formatted") | ||||
| //    assert.Greaterf(t, "b", "a", "error message %s", "formatted") | ||||
| func Greaterf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) { | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| @@ -565,7 +565,7 @@ func HTTPError(t TestingT, handler http.HandlerFunc, method string, url string, | ||||
| // | ||||
| //  assert.HTTPErrorf(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} | ||||
| // | ||||
| // Returns whether the assertion was successful (true, "error message %s", "formatted") or not (false). | ||||
| // Returns whether the assertion was successful (true) or not (false). | ||||
| func HTTPErrorf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) { | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| @@ -595,7 +595,7 @@ func HTTPRedirect(t TestingT, handler http.HandlerFunc, method string, url strin | ||||
| // | ||||
| //  assert.HTTPRedirectf(t, myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} | ||||
| // | ||||
| // Returns whether the assertion was successful (true, "error message %s", "formatted") or not (false). | ||||
| // Returns whether the assertion was successful (true) or not (false). | ||||
| func HTTPRedirectf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) { | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| @@ -606,6 +606,36 @@ func HTTPRedirectf(t TestingT, handler http.HandlerFunc, method string, url stri | ||||
| 	t.FailNow() | ||||
| } | ||||
|  | ||||
| // HTTPStatusCode asserts that a specified handler returns a specified status code. | ||||
| // | ||||
| //  assert.HTTPStatusCode(t, myHandler, "GET", "/notImplemented", nil, 501) | ||||
| // | ||||
| // Returns whether the assertion was successful (true) or not (false). | ||||
| func HTTPStatusCode(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msgAndArgs ...interface{}) { | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| 	} | ||||
| 	if assert.HTTPStatusCode(t, handler, method, url, values, statuscode, msgAndArgs...) { | ||||
| 		return | ||||
| 	} | ||||
| 	t.FailNow() | ||||
| } | ||||
|  | ||||
| // HTTPStatusCodef asserts that a specified handler returns a specified status code. | ||||
| // | ||||
| //  assert.HTTPStatusCodef(t, myHandler, "GET", "/notImplemented", nil, 501, "error message %s", "formatted") | ||||
| // | ||||
| // Returns whether the assertion was successful (true) or not (false). | ||||
| func HTTPStatusCodef(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msg string, args ...interface{}) { | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| 	} | ||||
| 	if assert.HTTPStatusCodef(t, handler, method, url, values, statuscode, msg, args...) { | ||||
| 		return | ||||
| 	} | ||||
| 	t.FailNow() | ||||
| } | ||||
|  | ||||
| // HTTPSuccess asserts that a specified handler returns a success status code. | ||||
| // | ||||
| //  assert.HTTPSuccess(t, myHandler, "POST", "http://www.google.com", nil) | ||||
| @@ -651,7 +681,7 @@ func Implements(t TestingT, interfaceObject interface{}, object interface{}, msg | ||||
|  | ||||
| // Implementsf asserts that an object is implemented by the specified interface. | ||||
| // | ||||
| //    assert.Implementsf(t, (*MyInterface, "error message %s", "formatted")(nil), new(MyObject)) | ||||
| //    assert.Implementsf(t, (*MyInterface)(nil), new(MyObject), "error message %s", "formatted") | ||||
| func Implementsf(t TestingT, interfaceObject interface{}, object interface{}, msg string, args ...interface{}) { | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| @@ -902,7 +932,7 @@ func LessOrEqualf(t TestingT, e1 interface{}, e2 interface{}, msg string, args . | ||||
| // Lessf asserts that the first element is less than the second | ||||
| // | ||||
| //    assert.Lessf(t, 1, 2, "error message %s", "formatted") | ||||
| //    assert.Lessf(t, float64(1, "error message %s", "formatted"), float64(2)) | ||||
| //    assert.Lessf(t, float64(1), float64(2), "error message %s", "formatted") | ||||
| //    assert.Lessf(t, "a", "b", "error message %s", "formatted") | ||||
| func Lessf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) { | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| @@ -1128,6 +1158,32 @@ func NotEqual(t TestingT, expected interface{}, actual interface{}, msgAndArgs . | ||||
| 	t.FailNow() | ||||
| } | ||||
|  | ||||
| // NotEqualValues asserts that two objects are not equal even when converted to the same type | ||||
| // | ||||
| //    assert.NotEqualValues(t, obj1, obj2) | ||||
| func NotEqualValues(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) { | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| 	} | ||||
| 	if assert.NotEqualValues(t, expected, actual, msgAndArgs...) { | ||||
| 		return | ||||
| 	} | ||||
| 	t.FailNow() | ||||
| } | ||||
|  | ||||
| // NotEqualValuesf asserts that two objects are not equal even when converted to the same type | ||||
| // | ||||
| //    assert.NotEqualValuesf(t, obj1, obj2, "error message %s", "formatted") | ||||
| func NotEqualValuesf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) { | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| 	} | ||||
| 	if assert.NotEqualValuesf(t, expected, actual, msg, args...) { | ||||
| 		return | ||||
| 	} | ||||
| 	t.FailNow() | ||||
| } | ||||
|  | ||||
| // NotEqualf asserts that the specified values are NOT equal. | ||||
| // | ||||
| //    assert.NotEqualf(t, obj1, obj2, "error message %s", "formatted") | ||||
| @@ -1212,7 +1268,7 @@ func NotRegexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interf | ||||
|  | ||||
| // NotRegexpf asserts that a specified regexp does not match a string. | ||||
| // | ||||
| //  assert.NotRegexpf(t, regexp.MustCompile("starts", "error message %s", "formatted"), "it's starting") | ||||
| //  assert.NotRegexpf(t, regexp.MustCompile("starts"), "it's starting", "error message %s", "formatted") | ||||
| //  assert.NotRegexpf(t, "^start", "it's not starting", "error message %s", "formatted") | ||||
| func NotRegexpf(t TestingT, rx interface{}, str interface{}, msg string, args ...interface{}) { | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
| @@ -1406,7 +1462,7 @@ func Regexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface | ||||
|  | ||||
| // Regexpf asserts that a specified regexp matches a string. | ||||
| // | ||||
| //  assert.Regexpf(t, regexp.MustCompile("start", "error message %s", "formatted"), "it's starting") | ||||
| //  assert.Regexpf(t, regexp.MustCompile("start"), "it's starting", "error message %s", "formatted") | ||||
| //  assert.Regexpf(t, "start...$", "it's not starting", "error message %s", "formatted") | ||||
| func Regexpf(t TestingT, rx interface{}, str interface{}, msg string, args ...interface{}) { | ||||
| 	if h, ok := t.(tHelper); ok { | ||||
|   | ||||
							
								
								
									
										62
									
								
								vendor/github.com/stretchr/testify/require/require_forward.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										62
									
								
								vendor/github.com/stretchr/testify/require/require_forward.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -170,7 +170,7 @@ func (a *Assertions) EqualValues(expected interface{}, actual interface{}, msgAn | ||||
| // EqualValuesf asserts that two objects are equal or convertable to the same types | ||||
| // and equal. | ||||
| // | ||||
| //    a.EqualValuesf(uint32(123, "error message %s", "formatted"), int32(123)) | ||||
| //    a.EqualValuesf(uint32(123), int32(123), "error message %s", "formatted") | ||||
| func (a *Assertions) EqualValuesf(expected interface{}, actual interface{}, msg string, args ...interface{}) { | ||||
| 	if h, ok := a.t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| @@ -252,7 +252,7 @@ func (a *Assertions) Exactly(expected interface{}, actual interface{}, msgAndArg | ||||
|  | ||||
| // Exactlyf asserts that two objects are equal in value and type. | ||||
| // | ||||
| //    a.Exactlyf(int32(123, "error message %s", "formatted"), int64(123)) | ||||
| //    a.Exactlyf(int32(123), int64(123), "error message %s", "formatted") | ||||
| func (a *Assertions) Exactlyf(expected interface{}, actual interface{}, msg string, args ...interface{}) { | ||||
| 	if h, ok := a.t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| @@ -371,7 +371,7 @@ func (a *Assertions) GreaterOrEqualf(e1 interface{}, e2 interface{}, msg string, | ||||
| // Greaterf asserts that the first element is greater than the second | ||||
| // | ||||
| //    a.Greaterf(2, 1, "error message %s", "formatted") | ||||
| //    a.Greaterf(float64(2, "error message %s", "formatted"), float64(1)) | ||||
| //    a.Greaterf(float64(2), float64(1), "error message %s", "formatted") | ||||
| //    a.Greaterf("b", "a", "error message %s", "formatted") | ||||
| func (a *Assertions) Greaterf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) { | ||||
| 	if h, ok := a.t.(tHelper); ok { | ||||
| @@ -448,7 +448,7 @@ func (a *Assertions) HTTPError(handler http.HandlerFunc, method string, url stri | ||||
| // | ||||
| //  a.HTTPErrorf(myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} | ||||
| // | ||||
| // Returns whether the assertion was successful (true, "error message %s", "formatted") or not (false). | ||||
| // Returns whether the assertion was successful (true) or not (false). | ||||
| func (a *Assertions) HTTPErrorf(handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) { | ||||
| 	if h, ok := a.t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| @@ -472,7 +472,7 @@ func (a *Assertions) HTTPRedirect(handler http.HandlerFunc, method string, url s | ||||
| // | ||||
| //  a.HTTPRedirectf(myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} | ||||
| // | ||||
| // Returns whether the assertion was successful (true, "error message %s", "formatted") or not (false). | ||||
| // Returns whether the assertion was successful (true) or not (false). | ||||
| func (a *Assertions) HTTPRedirectf(handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) { | ||||
| 	if h, ok := a.t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| @@ -480,6 +480,30 @@ func (a *Assertions) HTTPRedirectf(handler http.HandlerFunc, method string, url | ||||
| 	HTTPRedirectf(a.t, handler, method, url, values, msg, args...) | ||||
| } | ||||
|  | ||||
| // HTTPStatusCode asserts that a specified handler returns a specified status code. | ||||
| // | ||||
| //  a.HTTPStatusCode(myHandler, "GET", "/notImplemented", nil, 501) | ||||
| // | ||||
| // Returns whether the assertion was successful (true) or not (false). | ||||
| func (a *Assertions) HTTPStatusCode(handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msgAndArgs ...interface{}) { | ||||
| 	if h, ok := a.t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| 	} | ||||
| 	HTTPStatusCode(a.t, handler, method, url, values, statuscode, msgAndArgs...) | ||||
| } | ||||
|  | ||||
| // HTTPStatusCodef asserts that a specified handler returns a specified status code. | ||||
| // | ||||
| //  a.HTTPStatusCodef(myHandler, "GET", "/notImplemented", nil, 501, "error message %s", "formatted") | ||||
| // | ||||
| // Returns whether the assertion was successful (true) or not (false). | ||||
| func (a *Assertions) HTTPStatusCodef(handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msg string, args ...interface{}) { | ||||
| 	if h, ok := a.t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| 	} | ||||
| 	HTTPStatusCodef(a.t, handler, method, url, values, statuscode, msg, args...) | ||||
| } | ||||
|  | ||||
| // HTTPSuccess asserts that a specified handler returns a success status code. | ||||
| // | ||||
| //  a.HTTPSuccess(myHandler, "POST", "http://www.google.com", nil) | ||||
| @@ -516,7 +540,7 @@ func (a *Assertions) Implements(interfaceObject interface{}, object interface{}, | ||||
|  | ||||
| // Implementsf asserts that an object is implemented by the specified interface. | ||||
| // | ||||
| //    a.Implementsf((*MyInterface, "error message %s", "formatted")(nil), new(MyObject)) | ||||
| //    a.Implementsf((*MyInterface)(nil), new(MyObject), "error message %s", "formatted") | ||||
| func (a *Assertions) Implementsf(interfaceObject interface{}, object interface{}, msg string, args ...interface{}) { | ||||
| 	if h, ok := a.t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| @@ -707,7 +731,7 @@ func (a *Assertions) LessOrEqualf(e1 interface{}, e2 interface{}, msg string, ar | ||||
| // Lessf asserts that the first element is less than the second | ||||
| // | ||||
| //    a.Lessf(1, 2, "error message %s", "formatted") | ||||
| //    a.Lessf(float64(1, "error message %s", "formatted"), float64(2)) | ||||
| //    a.Lessf(float64(1), float64(2), "error message %s", "formatted") | ||||
| //    a.Lessf("a", "b", "error message %s", "formatted") | ||||
| func (a *Assertions) Lessf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) { | ||||
| 	if h, ok := a.t.(tHelper); ok { | ||||
| @@ -885,6 +909,26 @@ func (a *Assertions) NotEqual(expected interface{}, actual interface{}, msgAndAr | ||||
| 	NotEqual(a.t, expected, actual, msgAndArgs...) | ||||
| } | ||||
|  | ||||
| // NotEqualValues asserts that two objects are not equal even when converted to the same type | ||||
| // | ||||
| //    a.NotEqualValues(obj1, obj2) | ||||
| func (a *Assertions) NotEqualValues(expected interface{}, actual interface{}, msgAndArgs ...interface{}) { | ||||
| 	if h, ok := a.t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| 	} | ||||
| 	NotEqualValues(a.t, expected, actual, msgAndArgs...) | ||||
| } | ||||
|  | ||||
| // NotEqualValuesf asserts that two objects are not equal even when converted to the same type | ||||
| // | ||||
| //    a.NotEqualValuesf(obj1, obj2, "error message %s", "formatted") | ||||
| func (a *Assertions) NotEqualValuesf(expected interface{}, actual interface{}, msg string, args ...interface{}) { | ||||
| 	if h, ok := a.t.(tHelper); ok { | ||||
| 		h.Helper() | ||||
| 	} | ||||
| 	NotEqualValuesf(a.t, expected, actual, msg, args...) | ||||
| } | ||||
|  | ||||
| // NotEqualf asserts that the specified values are NOT equal. | ||||
| // | ||||
| //    a.NotEqualf(obj1, obj2, "error message %s", "formatted") | ||||
| @@ -951,7 +995,7 @@ func (a *Assertions) NotRegexp(rx interface{}, str interface{}, msgAndArgs ...in | ||||
|  | ||||
| // NotRegexpf asserts that a specified regexp does not match a string. | ||||
| // | ||||
| //  a.NotRegexpf(regexp.MustCompile("starts", "error message %s", "formatted"), "it's starting") | ||||
| //  a.NotRegexpf(regexp.MustCompile("starts"), "it's starting", "error message %s", "formatted") | ||||
| //  a.NotRegexpf("^start", "it's not starting", "error message %s", "formatted") | ||||
| func (a *Assertions) NotRegexpf(rx interface{}, str interface{}, msg string, args ...interface{}) { | ||||
| 	if h, ok := a.t.(tHelper); ok { | ||||
| @@ -1103,7 +1147,7 @@ func (a *Assertions) Regexp(rx interface{}, str interface{}, msgAndArgs ...inter | ||||
|  | ||||
| // Regexpf asserts that a specified regexp matches a string. | ||||
| // | ||||
| //  a.Regexpf(regexp.MustCompile("start", "error message %s", "formatted"), "it's starting") | ||||
| //  a.Regexpf(regexp.MustCompile("start"), "it's starting", "error message %s", "formatted") | ||||
| //  a.Regexpf("start...$", "it's not starting", "error message %s", "formatted") | ||||
| func (a *Assertions) Regexpf(rx interface{}, str interface{}, msg string, args ...interface{}) { | ||||
| 	if h, ok := a.t.(tHelper); ok { | ||||
|   | ||||
							
								
								
									
										7
									
								
								vendor/github.com/stretchr/testify/suite/interfaces.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										7
									
								
								vendor/github.com/stretchr/testify/suite/interfaces.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -44,3 +44,10 @@ type BeforeTest interface { | ||||
| type AfterTest interface { | ||||
| 	AfterTest(suiteName, testName string) | ||||
| } | ||||
|  | ||||
| // WithStats implements HandleStats, a function that will be executed | ||||
| // when a test suite is finished. The stats contain information about | ||||
| // the execution of that suite and its tests. | ||||
| type WithStats interface { | ||||
| 	HandleStats(suiteName string, stats *SuiteInformation) | ||||
| } | ||||
|   | ||||
							
								
								
									
										46
									
								
								vendor/github.com/stretchr/testify/suite/stats.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								vendor/github.com/stretchr/testify/suite/stats.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,46 @@ | ||||
| package suite | ||||
|  | ||||
| import "time" | ||||
|  | ||||
| // SuiteInformation stats stores stats for the whole suite execution. | ||||
| type SuiteInformation struct { | ||||
| 	Start, End time.Time | ||||
| 	TestStats  map[string]*TestInformation | ||||
| } | ||||
|  | ||||
| // TestInformation stores information about the execution of each test. | ||||
| type TestInformation struct { | ||||
| 	TestName   string | ||||
| 	Start, End time.Time | ||||
| 	Passed     bool | ||||
| } | ||||
|  | ||||
| func newSuiteInformation() *SuiteInformation { | ||||
| 	testStats := make(map[string]*TestInformation) | ||||
|  | ||||
| 	return &SuiteInformation{ | ||||
| 		TestStats: testStats, | ||||
| 	} | ||||
| } | ||||
|  | ||||
| func (s SuiteInformation) start(testName string) { | ||||
| 	s.TestStats[testName] = &TestInformation{ | ||||
| 		TestName: testName, | ||||
| 		Start:    time.Now(), | ||||
| 	} | ||||
| } | ||||
|  | ||||
| func (s SuiteInformation) end(testName string, passed bool) { | ||||
| 	s.TestStats[testName].End = time.Now() | ||||
| 	s.TestStats[testName].Passed = passed | ||||
| } | ||||
|  | ||||
| func (s SuiteInformation) Passed() bool { | ||||
| 	for _, stats := range s.TestStats { | ||||
| 		if !stats.Passed { | ||||
| 			return false | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return true | ||||
| } | ||||
							
								
								
									
										104
									
								
								vendor/github.com/stretchr/testify/suite/suite.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										104
									
								
								vendor/github.com/stretchr/testify/suite/suite.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -7,8 +7,8 @@ import ( | ||||
| 	"reflect" | ||||
| 	"regexp" | ||||
| 	"runtime/debug" | ||||
| 	"sync" | ||||
| 	"testing" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/stretchr/testify/assert" | ||||
| 	"github.com/stretchr/testify/require" | ||||
| @@ -81,43 +81,68 @@ func (suite *Suite) Run(name string, subtest func()) bool { | ||||
| // Run takes a testing suite and runs all of the tests attached | ||||
| // to it. | ||||
| func Run(t *testing.T, suite TestingSuite) { | ||||
| 	testsSync := &sync.WaitGroup{} | ||||
| 	suite.SetT(t) | ||||
| 	defer failOnPanic(t) | ||||
|  | ||||
| 	suiteSetupDone := false | ||||
| 	suite.SetT(t) | ||||
|  | ||||
| 	var suiteSetupDone bool | ||||
|  | ||||
| 	var stats *SuiteInformation | ||||
| 	if _, ok := suite.(WithStats); ok { | ||||
| 		stats = newSuiteInformation() | ||||
| 	} | ||||
|  | ||||
| 	methodFinder := reflect.TypeOf(suite) | ||||
| 	tests := []testing.InternalTest{} | ||||
| 	for index := 0; index < methodFinder.NumMethod(); index++ { | ||||
| 		method := methodFinder.Method(index) | ||||
| 	methodFinder := reflect.TypeOf(suite) | ||||
| 	suiteName := methodFinder.Elem().Name() | ||||
|  | ||||
| 	for i := 0; i < methodFinder.NumMethod(); i++ { | ||||
| 		method := methodFinder.Method(i) | ||||
|  | ||||
| 		ok, err := methodFilter(method.Name) | ||||
| 		if err != nil { | ||||
| 			fmt.Fprintf(os.Stderr, "testify: invalid regexp for -m: %s\n", err) | ||||
| 			os.Exit(1) | ||||
| 		} | ||||
|  | ||||
| 		if !ok { | ||||
| 			continue | ||||
| 		} | ||||
|  | ||||
| 		if !suiteSetupDone { | ||||
| 			if stats != nil { | ||||
| 				stats.Start = time.Now() | ||||
| 			} | ||||
|  | ||||
| 			if setupAllSuite, ok := suite.(SetupAllSuite); ok { | ||||
| 				setupAllSuite.SetupSuite() | ||||
| 			} | ||||
| 			defer func() { | ||||
| 				if tearDownAllSuite, ok := suite.(TearDownAllSuite); ok { | ||||
| 					testsSync.Wait() | ||||
| 					tearDownAllSuite.TearDownSuite() | ||||
| 				} | ||||
| 			}() | ||||
|  | ||||
| 			suiteSetupDone = true | ||||
| 		} | ||||
|  | ||||
| 		test := testing.InternalTest{ | ||||
| 			Name: method.Name, | ||||
| 			F: func(t *testing.T) { | ||||
| 				defer testsSync.Done() | ||||
| 				parentT := suite.T() | ||||
| 				suite.SetT(t) | ||||
| 				defer failOnPanic(t) | ||||
| 				defer func() { | ||||
| 					if stats != nil { | ||||
| 						passed := !t.Failed() | ||||
| 						stats.end(method.Name, passed) | ||||
| 					} | ||||
|  | ||||
| 					if afterTestSuite, ok := suite.(AfterTest); ok { | ||||
| 						afterTestSuite.AfterTest(suiteName, method.Name) | ||||
| 					} | ||||
|  | ||||
| 					if tearDownTestSuite, ok := suite.(TearDownTestSuite); ok { | ||||
| 						tearDownTestSuite.TearDownTest() | ||||
| 					} | ||||
|  | ||||
| 					suite.SetT(parentT) | ||||
| 				}() | ||||
|  | ||||
| 				if setupTestSuite, ok := suite.(SetupTestSuite); ok { | ||||
| 					setupTestSuite.SetupTest() | ||||
| @@ -125,25 +150,47 @@ func Run(t *testing.T, suite TestingSuite) { | ||||
| 				if beforeTestSuite, ok := suite.(BeforeTest); ok { | ||||
| 					beforeTestSuite.BeforeTest(methodFinder.Elem().Name(), method.Name) | ||||
| 				} | ||||
| 				defer func() { | ||||
| 					if afterTestSuite, ok := suite.(AfterTest); ok { | ||||
| 						afterTestSuite.AfterTest(methodFinder.Elem().Name(), method.Name) | ||||
| 					} | ||||
| 					if tearDownTestSuite, ok := suite.(TearDownTestSuite); ok { | ||||
| 						tearDownTestSuite.TearDownTest() | ||||
| 					} | ||||
| 					suite.SetT(parentT) | ||||
| 				}() | ||||
|  | ||||
| 				if stats != nil { | ||||
| 					stats.start(method.Name) | ||||
| 				} | ||||
|  | ||||
| 				method.Func.Call([]reflect.Value{reflect.ValueOf(suite)}) | ||||
| 			}, | ||||
| 		} | ||||
| 		tests = append(tests, test) | ||||
| 		testsSync.Add(1) | ||||
| 	} | ||||
| 	if suiteSetupDone { | ||||
| 		defer func() { | ||||
| 			if tearDownAllSuite, ok := suite.(TearDownAllSuite); ok { | ||||
| 				tearDownAllSuite.TearDownSuite() | ||||
| 			} | ||||
|  | ||||
| 			if suiteWithStats, measureStats := suite.(WithStats); measureStats { | ||||
| 				stats.End = time.Now() | ||||
| 				suiteWithStats.HandleStats(suiteName, stats) | ||||
| 			} | ||||
| 		}() | ||||
| 	} | ||||
|  | ||||
| 	runTests(t, tests) | ||||
| } | ||||
|  | ||||
| // Filtering method according to set regular expression | ||||
| // specified command-line argument -m | ||||
| func methodFilter(name string) (bool, error) { | ||||
| 	if ok, _ := regexp.MatchString("^Test", name); !ok { | ||||
| 		return false, nil | ||||
| 	} | ||||
| 	return regexp.MatchString(*matchMethod, name) | ||||
| } | ||||
|  | ||||
| func runTests(t testing.TB, tests []testing.InternalTest) { | ||||
| 	if len(tests) == 0 { | ||||
| 		t.Log("warning: no tests to run") | ||||
| 		return | ||||
| 	} | ||||
|  | ||||
| 	r, ok := t.(runner) | ||||
| 	if !ok { // backwards compatibility with Go 1.6 and below | ||||
| 		if !testing.RunTests(allTestsFilter, tests) { | ||||
| @@ -157,15 +204,6 @@ func runTests(t testing.TB, tests []testing.InternalTest) { | ||||
| 	} | ||||
| } | ||||
|  | ||||
| // Filtering method according to set regular expression | ||||
| // specified command-line argument -m | ||||
| func methodFilter(name string) (bool, error) { | ||||
| 	if ok, _ := regexp.MatchString("^Test", name); !ok { | ||||
| 		return false, nil | ||||
| 	} | ||||
| 	return regexp.MatchString(*matchMethod, name) | ||||
| } | ||||
|  | ||||
| type runner interface { | ||||
| 	Run(name string, f func(t *testing.T)) bool | ||||
| } | ||||
|   | ||||
							
								
								
									
										2
									
								
								vendor/github.com/valyala/fasttemplate/go.mod
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/valyala/fasttemplate/go.mod
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -1,3 +1,5 @@ | ||||
| module github.com/valyala/fasttemplate | ||||
|  | ||||
| go 1.12 | ||||
|  | ||||
| require github.com/valyala/bytebufferpool v1.0.0 | ||||
|   | ||||
							
								
								
									
										132
									
								
								vendor/github.com/valyala/fasttemplate/template.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										132
									
								
								vendor/github.com/valyala/fasttemplate/template.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -9,8 +9,9 @@ package fasttemplate | ||||
| import ( | ||||
| 	"bytes" | ||||
| 	"fmt" | ||||
| 	"github.com/valyala/bytebufferpool" | ||||
| 	"io" | ||||
|  | ||||
| 	"github.com/valyala/bytebufferpool" | ||||
| ) | ||||
|  | ||||
| // ExecuteFunc calls f on each template tag (placeholder) occurrence. | ||||
| @@ -49,6 +50,9 @@ func ExecuteFunc(template, startTag, endTag string, w io.Writer, f TagFunc) (int | ||||
|  | ||||
| 		ni, err = f(w, unsafeBytes2String(s[:n])) | ||||
| 		nn += int64(ni) | ||||
| 		if err != nil { | ||||
| 			return nn, err | ||||
| 		} | ||||
| 		s = s[n+len(b):] | ||||
| 	} | ||||
| 	ni, err = w.Write(s) | ||||
| @@ -73,6 +77,22 @@ func Execute(template, startTag, endTag string, w io.Writer, m map[string]interf | ||||
| 	return ExecuteFunc(template, startTag, endTag, w, func(w io.Writer, tag string) (int, error) { return stdTagFunc(w, tag, m) }) | ||||
| } | ||||
|  | ||||
| // ExecuteStd works the same way as Execute, but keeps the unknown placeholders. | ||||
| // This can be used as a drop-in replacement for strings.Replacer | ||||
| // | ||||
| // Substitution map m may contain values with the following types: | ||||
| //   * []byte - the fastest value type | ||||
| //   * string - convenient value type | ||||
| //   * TagFunc - flexible value type | ||||
| // | ||||
| // Returns the number of bytes written to w. | ||||
| // | ||||
| // This function is optimized for constantly changing templates. | ||||
| // Use Template.ExecuteStd for frozen templates. | ||||
| func ExecuteStd(template, startTag, endTag string, w io.Writer, m map[string]interface{}) (int64, error) { | ||||
| 	return ExecuteFunc(template, startTag, endTag, w, func(w io.Writer, tag string) (int, error) { return keepUnknownTagFunc(w, startTag, endTag, tag, m) }) | ||||
| } | ||||
|  | ||||
| // ExecuteFuncString calls f on each template tag (placeholder) occurrence | ||||
| // and substitutes it with the data written to TagFunc's w. | ||||
| // | ||||
| @@ -81,19 +101,32 @@ func Execute(template, startTag, endTag string, w io.Writer, m map[string]interf | ||||
| // This function is optimized for constantly changing templates. | ||||
| // Use Template.ExecuteFuncString for frozen templates. | ||||
| func ExecuteFuncString(template, startTag, endTag string, f TagFunc) string { | ||||
| 	s, err := ExecuteFuncStringWithErr(template, startTag, endTag, f) | ||||
| 	if err != nil { | ||||
| 		panic(fmt.Sprintf("unexpected error: %s", err)) | ||||
| 	} | ||||
| 	return s | ||||
| } | ||||
|  | ||||
| // ExecuteFuncStringWithErr is nearly the same as ExecuteFuncString | ||||
| // but when f returns an error, ExecuteFuncStringWithErr won't panic like ExecuteFuncString | ||||
| // it just returns an empty string and the error f returned | ||||
| func ExecuteFuncStringWithErr(template, startTag, endTag string, f TagFunc) (string, error) { | ||||
| 	tagsCount := bytes.Count(unsafeString2Bytes(template), unsafeString2Bytes(startTag)) | ||||
| 	if tagsCount == 0 { | ||||
| 		return template | ||||
| 		return template, nil | ||||
| 	} | ||||
|  | ||||
| 	bb := byteBufferPool.Get() | ||||
| 	if _, err := ExecuteFunc(template, startTag, endTag, bb, f); err != nil { | ||||
| 		panic(fmt.Sprintf("unexpected error: %s", err)) | ||||
| 		bb.Reset() | ||||
| 		byteBufferPool.Put(bb) | ||||
| 		return "", err | ||||
| 	} | ||||
| 	s := string(bb.B) | ||||
| 	bb.Reset() | ||||
| 	byteBufferPool.Put(bb) | ||||
| 	return s | ||||
| 	return s, nil | ||||
| } | ||||
|  | ||||
| var byteBufferPool bytebufferpool.Pool | ||||
| @@ -112,6 +145,20 @@ func ExecuteString(template, startTag, endTag string, m map[string]interface{}) | ||||
| 	return ExecuteFuncString(template, startTag, endTag, func(w io.Writer, tag string) (int, error) { return stdTagFunc(w, tag, m) }) | ||||
| } | ||||
|  | ||||
| // ExecuteStringStd works the same way as ExecuteString, but keeps the unknown placeholders. | ||||
| // This can be used as a drop-in replacement for strings.Replacer | ||||
| // | ||||
| // Substitution map m may contain values with the following types: | ||||
| //   * []byte - the fastest value type | ||||
| //   * string - convenient value type | ||||
| //   * TagFunc - flexible value type | ||||
| // | ||||
| // This function is optimized for constantly changing templates. | ||||
| // Use Template.ExecuteStringStd for frozen templates. | ||||
| func ExecuteStringStd(template, startTag, endTag string, m map[string]interface{}) string { | ||||
| 	return ExecuteFuncString(template, startTag, endTag, func(w io.Writer, tag string) (int, error) { return keepUnknownTagFunc(w, startTag, endTag, tag, m) }) | ||||
| } | ||||
|  | ||||
| // Template implements simple template engine, which can be used for fast | ||||
| // tags' (aka placeholders) substitution. | ||||
| type Template struct { | ||||
| @@ -267,6 +314,19 @@ func (t *Template) Execute(w io.Writer, m map[string]interface{}) (int64, error) | ||||
| 	return t.ExecuteFunc(w, func(w io.Writer, tag string) (int, error) { return stdTagFunc(w, tag, m) }) | ||||
| } | ||||
|  | ||||
| // ExecuteStd works the same way as Execute, but keeps the unknown placeholders. | ||||
| // This can be used as a drop-in replacement for strings.Replacer | ||||
| // | ||||
| // Substitution map m may contain values with the following types: | ||||
| //   * []byte - the fastest value type | ||||
| //   * string - convenient value type | ||||
| //   * TagFunc - flexible value type | ||||
| // | ||||
| // Returns the number of bytes written to w. | ||||
| func (t *Template) ExecuteStd(w io.Writer, m map[string]interface{}) (int64, error) { | ||||
| 	return t.ExecuteFunc(w, func(w io.Writer, tag string) (int, error) { return keepUnknownTagFunc(w, t.startTag, t.endTag, tag, m) }) | ||||
| } | ||||
|  | ||||
| // ExecuteFuncString calls f on each template tag (placeholder) occurrence | ||||
| // and substitutes it with the data written to TagFunc's w. | ||||
| // | ||||
| @@ -275,14 +335,31 @@ func (t *Template) Execute(w io.Writer, m map[string]interface{}) (int64, error) | ||||
| // This function is optimized for frozen templates. | ||||
| // Use ExecuteFuncString for constantly changing templates. | ||||
| func (t *Template) ExecuteFuncString(f TagFunc) string { | ||||
| 	s, err := t.ExecuteFuncStringWithErr(f) | ||||
| 	if err != nil { | ||||
| 		panic(fmt.Sprintf("unexpected error: %s", err)) | ||||
| 	} | ||||
| 	return s | ||||
| } | ||||
|  | ||||
| // ExecuteFuncStringWithErr calls f on each template tag (placeholder) occurrence | ||||
| // and substitutes it with the data written to TagFunc's w. | ||||
| // | ||||
| // Returns the resulting string. | ||||
| // | ||||
| // This function is optimized for frozen templates. | ||||
| // Use ExecuteFuncString for constantly changing templates. | ||||
| func (t *Template) ExecuteFuncStringWithErr(f TagFunc) (string, error) { | ||||
| 	bb := t.byteBufferPool.Get() | ||||
| 	if _, err := t.ExecuteFunc(bb, f); err != nil { | ||||
| 		panic(fmt.Sprintf("unexpected error: %s", err)) | ||||
| 		bb.Reset() | ||||
| 		t.byteBufferPool.Put(bb) | ||||
| 		return "", err | ||||
| 	} | ||||
| 	s := string(bb.Bytes()) | ||||
| 	bb.Reset() | ||||
| 	t.byteBufferPool.Put(bb) | ||||
| 	return s | ||||
| 	return s, nil | ||||
| } | ||||
|  | ||||
| // ExecuteString substitutes template tags (placeholders) with the corresponding | ||||
| @@ -299,6 +376,20 @@ func (t *Template) ExecuteString(m map[string]interface{}) string { | ||||
| 	return t.ExecuteFuncString(func(w io.Writer, tag string) (int, error) { return stdTagFunc(w, tag, m) }) | ||||
| } | ||||
|  | ||||
| // ExecuteStringStd works the same way as ExecuteString, but keeps the unknown placeholders. | ||||
| // This can be used as a drop-in replacement for strings.Replacer | ||||
| // | ||||
| // Substitution map m may contain values with the following types: | ||||
| //   * []byte - the fastest value type | ||||
| //   * string - convenient value type | ||||
| //   * TagFunc - flexible value type | ||||
| // | ||||
| // This function is optimized for frozen templates. | ||||
| // Use ExecuteStringStd for constantly changing templates. | ||||
| func (t *Template) ExecuteStringStd(m map[string]interface{}) string { | ||||
| 	return t.ExecuteFuncString(func(w io.Writer, tag string) (int, error) { return keepUnknownTagFunc(w, t.startTag, t.endTag, tag, m) }) | ||||
| } | ||||
|  | ||||
| func stdTagFunc(w io.Writer, tag string, m map[string]interface{}) (int, error) { | ||||
| 	v := m[tag] | ||||
| 	if v == nil { | ||||
| @@ -315,3 +406,32 @@ func stdTagFunc(w io.Writer, tag string, m map[string]interface{}) (int, error) | ||||
| 		panic(fmt.Sprintf("tag=%q contains unexpected value type=%#v. Expected []byte, string or TagFunc", tag, v)) | ||||
| 	} | ||||
| } | ||||
|  | ||||
| func keepUnknownTagFunc(w io.Writer, startTag, endTag, tag string, m map[string]interface{}) (int, error) { | ||||
| 	v, ok := m[tag] | ||||
| 	if !ok { | ||||
| 		if _, err := w.Write(unsafeString2Bytes(startTag)); err != nil { | ||||
| 			return 0, err | ||||
| 		} | ||||
| 		if _, err := w.Write(unsafeString2Bytes(tag)); err != nil { | ||||
| 			return 0, err | ||||
| 		} | ||||
| 		if _, err := w.Write(unsafeString2Bytes(endTag)); err != nil { | ||||
| 			return 0, err | ||||
| 		} | ||||
| 		return len(startTag) + len(tag) + len(endTag), nil | ||||
| 	} | ||||
| 	if v == nil { | ||||
| 		return 0, nil | ||||
| 	} | ||||
| 	switch value := v.(type) { | ||||
| 	case []byte: | ||||
| 		return w.Write(value) | ||||
| 	case string: | ||||
| 		return w.Write([]byte(value)) | ||||
| 	case TagFunc: | ||||
| 		return value(w, tag) | ||||
| 	default: | ||||
| 		panic(fmt.Sprintf("tag=%q contains unexpected value type=%#v. Expected []byte, string or TagFunc", tag, v)) | ||||
| 	} | ||||
| } | ||||
|   | ||||
							
								
								
									
										13
									
								
								vendor/github.com/valyala/fasttemplate/unsafe.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										13
									
								
								vendor/github.com/valyala/fasttemplate/unsafe.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -11,12 +11,11 @@ func unsafeBytes2String(b []byte) string { | ||||
| 	return *(*string)(unsafe.Pointer(&b)) | ||||
| } | ||||
|  | ||||
| func unsafeString2Bytes(s string) []byte { | ||||
| func unsafeString2Bytes(s string) (b []byte) { | ||||
| 	sh := (*reflect.StringHeader)(unsafe.Pointer(&s)) | ||||
| 	bh := reflect.SliceHeader{ | ||||
| 		Data: sh.Data, | ||||
| 		Len:  sh.Len, | ||||
| 		Cap:  sh.Len, | ||||
| 	} | ||||
| 	return *(*[]byte)(unsafe.Pointer(&bh)) | ||||
| 	bh := (*reflect.SliceHeader)(unsafe.Pointer(&b)) | ||||
| 	bh.Data = sh.Data | ||||
| 	bh.Cap = sh.Len | ||||
| 	bh.Len = sh.Len | ||||
| 	return b | ||||
| } | ||||
|   | ||||
							
								
								
									
										2
									
								
								vendor/github.com/yaegashi/msgraph.go/beta/ActionAad.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/yaegashi/msgraph.go/beta/ActionAad.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -1,4 +1,4 @@ | ||||
| // Code generated by msgraph-generate.go DO NOT EDIT. | ||||
| // Code generated by msgraph.go/gen DO NOT EDIT. | ||||
|  | ||||
| package msgraph | ||||
|  | ||||
|   | ||||
							
								
								
									
										47
									
								
								vendor/github.com/yaegashi/msgraph.go/beta/ActionAccess.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										47
									
								
								vendor/github.com/yaegashi/msgraph.go/beta/ActionAccess.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @@ -1,4 +1,4 @@ | ||||
| // Code generated by msgraph-generate.go DO NOT EDIT. | ||||
| // Code generated by msgraph.go/gen DO NOT EDIT. | ||||
|  | ||||
| package msgraph | ||||
|  | ||||
| @@ -73,9 +73,9 @@ func (r *AccessPackageAccessPackageAssignmentPoliciesCollectionRequest) Paging(c | ||||
| 	} | ||||
| 	var values []AccessPackageAssignmentPolicy | ||||
| 	for { | ||||
| 		defer res.Body.Close() | ||||
| 		if res.StatusCode != http.StatusOK { | ||||
| 			b, _ := ioutil.ReadAll(res.Body) | ||||
| 			res.Body.Close() | ||||
| 			errRes := &ErrorResponse{Response: res} | ||||
| 			err := jsonx.Unmarshal(b, errRes) | ||||
| 			if err != nil { | ||||
| @@ -88,6 +88,7 @@ func (r *AccessPackageAccessPackageAssignmentPoliciesCollectionRequest) Paging(c | ||||
| 			value  []AccessPackageAssignmentPolicy | ||||
| 		) | ||||
| 		err := jsonx.NewDecoder(res.Body).Decode(&paging) | ||||
| 		res.Body.Close() | ||||
| 		if err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| @@ -182,9 +183,9 @@ func (r *AccessPackageAccessPackageResourceRoleScopesCollectionRequest) Paging(c | ||||
| 	} | ||||
| 	var values []AccessPackageResourceRoleScope | ||||
| 	for { | ||||
| 		defer res.Body.Close() | ||||
| 		if res.StatusCode != http.StatusOK { | ||||
| 			b, _ := ioutil.ReadAll(res.Body) | ||||
| 			res.Body.Close() | ||||
| 			errRes := &ErrorResponse{Response: res} | ||||
| 			err := jsonx.Unmarshal(b, errRes) | ||||
| 			if err != nil { | ||||
| @@ -197,6 +198,7 @@ func (r *AccessPackageAccessPackageResourceRoleScopesCollectionRequest) Paging(c | ||||
| 			value  []AccessPackageResourceRoleScope | ||||
| 		) | ||||
| 		err := jsonx.NewDecoder(res.Body).Decode(&paging) | ||||
| 		res.Body.Close() | ||||
| 		if err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| @@ -298,9 +300,9 @@ func (r *AccessPackageAssignmentAccessPackageAssignmentRequestsCollectionRequest | ||||
| 	} | ||||
| 	var values []AccessPackageAssignmentRequestObject | ||||
| 	for { | ||||
| 		defer res.Body.Close() | ||||
| 		if res.StatusCode != http.StatusOK { | ||||
| 			b, _ := ioutil.ReadAll(res.Body) | ||||
| 			res.Body.Close() | ||||
| 			errRes := &ErrorResponse{Response: res} | ||||
| 			err := jsonx.Unmarshal(b, errRes) | ||||
| 			if err != nil { | ||||
| @@ -313,6 +315,7 @@ func (r *AccessPackageAssignmentAccessPackageAssignmentRequestsCollectionRequest | ||||
| 			value  []AccessPackageAssignmentRequestObject | ||||
| 		) | ||||
| 		err := jsonx.NewDecoder(res.Body).Decode(&paging) | ||||
| 		res.Body.Close() | ||||
| 		if err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| @@ -400,9 +403,9 @@ func (r *AccessPackageAssignmentAccessPackageAssignmentResourceRolesCollectionRe | ||||
| 	} | ||||
| 	var values []AccessPackageAssignmentResourceRole | ||||
| 	for { | ||||
| 		defer res.Body.Close() | ||||
| 		if res.StatusCode != http.StatusOK { | ||||
| 			b, _ := ioutil.ReadAll(res.Body) | ||||
| 			res.Body.Close() | ||||
| 			errRes := &ErrorResponse{Response: res} | ||||
| 			err := jsonx.Unmarshal(b, errRes) | ||||
| 			if err != nil { | ||||
| @@ -415,6 +418,7 @@ func (r *AccessPackageAssignmentAccessPackageAssignmentResourceRolesCollectionRe | ||||
| 			value  []AccessPackageAssignmentResourceRole | ||||
| 		) | ||||
| 		err := jsonx.NewDecoder(res.Body).Decode(&paging) | ||||
| 		res.Body.Close() | ||||
| 		if err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| @@ -544,9 +548,9 @@ func (r *AccessPackageAssignmentResourceRoleAccessPackageAssignmentsCollectionRe | ||||
| 	} | ||||
| 	var values []AccessPackageAssignment | ||||
| 	for { | ||||
| 		defer res.Body.Close() | ||||
| 		if res.StatusCode != http.StatusOK { | ||||
| 			b, _ := ioutil.ReadAll(res.Body) | ||||
| 			res.Body.Close() | ||||
| 			errRes := &ErrorResponse{Response: res} | ||||
| 			err := jsonx.Unmarshal(b, errRes) | ||||
| 			if err != nil { | ||||
| @@ -559,6 +563,7 @@ func (r *AccessPackageAssignmentResourceRoleAccessPackageAssignmentsCollectionRe | ||||
| 			value  []AccessPackageAssignment | ||||
| 		) | ||||
| 		err := jsonx.NewDecoder(res.Body).Decode(&paging) | ||||
| 		res.Body.Close() | ||||
| 		if err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| @@ -667,9 +672,9 @@ func (r *AccessPackageCatalogAccessPackageResourceRolesCollectionRequest) Paging | ||||
| 	} | ||||
| 	var values []AccessPackageResourceRole | ||||
| 	for { | ||||
| 		defer res.Body.Close() | ||||
| 		if res.StatusCode != http.StatusOK { | ||||
| 			b, _ := ioutil.ReadAll(res.Body) | ||||
| 			res.Body.Close() | ||||
| 			errRes := &ErrorResponse{Response: res} | ||||
| 			err := jsonx.Unmarshal(b, errRes) | ||||
| 			if err != nil { | ||||
| @@ -682,6 +687,7 @@ func (r *AccessPackageCatalogAccessPackageResourceRolesCollectionRequest) Paging | ||||
| 			value  []AccessPackageResourceRole | ||||
| 		) | ||||
| 		err := jsonx.NewDecoder(res.Body).Decode(&paging) | ||||
| 		res.Body.Close() | ||||
| 		if err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| @@ -769,9 +775,9 @@ func (r *AccessPackageCatalogAccessPackageResourceScopesCollectionRequest) Pagin | ||||
| 	} | ||||
| 	var values []AccessPackageResourceScope | ||||
| 	for { | ||||
| 		defer res.Body.Close() | ||||
| 		if res.StatusCode != http.StatusOK { | ||||
| 			b, _ := ioutil.ReadAll(res.Body) | ||||
| 			res.Body.Close() | ||||
| 			errRes := &ErrorResponse{Response: res} | ||||
| 			err := jsonx.Unmarshal(b, errRes) | ||||
| 			if err != nil { | ||||
| @@ -784,6 +790,7 @@ func (r *AccessPackageCatalogAccessPackageResourceScopesCollectionRequest) Pagin | ||||
| 			value  []AccessPackageResourceScope | ||||
| 		) | ||||
| 		err := jsonx.NewDecoder(res.Body).Decode(&paging) | ||||
| 		res.Body.Close() | ||||
| 		if err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| @@ -871,9 +878,9 @@ func (r *AccessPackageCatalogAccessPackageResourcesCollectionRequest) Paging(ctx | ||||
| 	} | ||||
| 	var values []AccessPackageResource | ||||
| 	for { | ||||
| 		defer res.Body.Close() | ||||
| 		if res.StatusCode != http.StatusOK { | ||||
| 			b, _ := ioutil.ReadAll(res.Body) | ||||
| 			res.Body.Close() | ||||
| 			errRes := &ErrorResponse{Response: res} | ||||
| 			err := jsonx.Unmarshal(b, errRes) | ||||
| 			if err != nil { | ||||
| @@ -886,6 +893,7 @@ func (r *AccessPackageCatalogAccessPackageResourcesCollectionRequest) Paging(ctx | ||||
| 			value  []AccessPackageResource | ||||
| 		) | ||||
| 		err := jsonx.NewDecoder(res.Body).Decode(&paging) | ||||
| 		res.Body.Close() | ||||
| 		if err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| @@ -973,9 +981,9 @@ func (r *AccessPackageCatalogAccessPackagesCollectionRequest) Paging(ctx context | ||||
| 	} | ||||
| 	var values []AccessPackage | ||||
| 	for { | ||||
| 		defer res.Body.Close() | ||||
| 		if res.StatusCode != http.StatusOK { | ||||
| 			b, _ := ioutil.ReadAll(res.Body) | ||||
| 			res.Body.Close() | ||||
| 			errRes := &ErrorResponse{Response: res} | ||||
| 			err := jsonx.Unmarshal(b, errRes) | ||||
| 			if err != nil { | ||||
| @@ -988,6 +996,7 @@ func (r *AccessPackageCatalogAccessPackagesCollectionRequest) Paging(ctx context | ||||
| 			value  []AccessPackage | ||||
| 		) | ||||
| 		err := jsonx.NewDecoder(res.Body).Decode(&paging) | ||||
| 		res.Body.Close() | ||||
| 		if err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| @@ -1075,9 +1084,9 @@ func (r *AccessPackageResourceAccessPackageResourceRolesCollectionRequest) Pagin | ||||
| 	} | ||||
| 	var values []AccessPackageResourceRole | ||||
| 	for { | ||||
| 		defer res.Body.Close() | ||||
| 		if res.StatusCode != http.StatusOK { | ||||
| 			b, _ := ioutil.ReadAll(res.Body) | ||||
| 			res.Body.Close() | ||||
| 			errRes := &ErrorResponse{Response: res} | ||||
| 			err := jsonx.Unmarshal(b, errRes) | ||||
| 			if err != nil { | ||||
| @@ -1090,6 +1099,7 @@ func (r *AccessPackageResourceAccessPackageResourceRolesCollectionRequest) Pagin | ||||
| 			value  []AccessPackageResourceRole | ||||
| 		) | ||||
| 		err := jsonx.NewDecoder(res.Body).Decode(&paging) | ||||
| 		res.Body.Close() | ||||
| 		if err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| @@ -1177,9 +1187,9 @@ func (r *AccessPackageResourceAccessPackageResourceScopesCollectionRequest) Pagi | ||||
| 	} | ||||
| 	var values []AccessPackageResourceScope | ||||
| 	for { | ||||
| 		defer res.Body.Close() | ||||
| 		if res.StatusCode != http.StatusOK { | ||||
| 			b, _ := ioutil.ReadAll(res.Body) | ||||
| 			res.Body.Close() | ||||
| 			errRes := &ErrorResponse{Response: res} | ||||
| 			err := jsonx.Unmarshal(b, errRes) | ||||
| 			if err != nil { | ||||
| @@ -1192,6 +1202,7 @@ func (r *AccessPackageResourceAccessPackageResourceScopesCollectionRequest) Pagi | ||||
| 			value  []AccessPackageResourceScope | ||||
| 		) | ||||
| 		err := jsonx.NewDecoder(res.Body).Decode(&paging) | ||||
| 		res.Body.Close() | ||||
| 		if err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| @@ -1321,9 +1332,9 @@ func (r *AccessReviewDecisionsCollectionRequest) Paging(ctx context.Context, met | ||||
| 	} | ||||
| 	var values []AccessReviewDecision | ||||
| 	for { | ||||
| 		defer res.Body.Close() | ||||
| 		if res.StatusCode != http.StatusOK { | ||||
| 			b, _ := ioutil.ReadAll(res.Body) | ||||
| 			res.Body.Close() | ||||
| 			errRes := &ErrorResponse{Response: res} | ||||
| 			err := jsonx.Unmarshal(b, errRes) | ||||
| 			if err != nil { | ||||
| @@ -1336,6 +1347,7 @@ func (r *AccessReviewDecisionsCollectionRequest) Paging(ctx context.Context, met | ||||
| 			value  []AccessReviewDecision | ||||
| 		) | ||||
| 		err := jsonx.NewDecoder(res.Body).Decode(&paging) | ||||
| 		res.Body.Close() | ||||
| 		if err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| @@ -1423,9 +1435,9 @@ func (r *AccessReviewInstancesCollectionRequest) Paging(ctx context.Context, met | ||||
| 	} | ||||
| 	var values []AccessReview | ||||
| 	for { | ||||
| 		defer res.Body.Close() | ||||
| 		if res.StatusCode != http.StatusOK { | ||||
| 			b, _ := ioutil.ReadAll(res.Body) | ||||
| 			res.Body.Close() | ||||
| 			errRes := &ErrorResponse{Response: res} | ||||
| 			err := jsonx.Unmarshal(b, errRes) | ||||
| 			if err != nil { | ||||
| @@ -1438,6 +1450,7 @@ func (r *AccessReviewInstancesCollectionRequest) Paging(ctx context.Context, met | ||||
| 			value  []AccessReview | ||||
| 		) | ||||
| 		err := jsonx.NewDecoder(res.Body).Decode(&paging) | ||||
| 		res.Body.Close() | ||||
| 		if err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| @@ -1525,9 +1538,9 @@ func (r *AccessReviewMyDecisionsCollectionRequest) Paging(ctx context.Context, m | ||||
| 	} | ||||
| 	var values []AccessReviewDecision | ||||
| 	for { | ||||
| 		defer res.Body.Close() | ||||
| 		if res.StatusCode != http.StatusOK { | ||||
| 			b, _ := ioutil.ReadAll(res.Body) | ||||
| 			res.Body.Close() | ||||
| 			errRes := &ErrorResponse{Response: res} | ||||
| 			err := jsonx.Unmarshal(b, errRes) | ||||
| 			if err != nil { | ||||
| @@ -1540,6 +1553,7 @@ func (r *AccessReviewMyDecisionsCollectionRequest) Paging(ctx context.Context, m | ||||
| 			value  []AccessReviewDecision | ||||
| 		) | ||||
| 		err := jsonx.NewDecoder(res.Body).Decode(&paging) | ||||
| 		res.Body.Close() | ||||
| 		if err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| @@ -1627,9 +1641,9 @@ func (r *AccessReviewReviewersCollectionRequest) Paging(ctx context.Context, met | ||||
| 	} | ||||
| 	var values []AccessReviewReviewer | ||||
| 	for { | ||||
| 		defer res.Body.Close() | ||||
| 		if res.StatusCode != http.StatusOK { | ||||
| 			b, _ := ioutil.ReadAll(res.Body) | ||||
| 			res.Body.Close() | ||||
| 			errRes := &ErrorResponse{Response: res} | ||||
| 			err := jsonx.Unmarshal(b, errRes) | ||||
| 			if err != nil { | ||||
| @@ -1642,6 +1656,7 @@ func (r *AccessReviewReviewersCollectionRequest) Paging(ctx context.Context, met | ||||
| 			value  []AccessReviewReviewer | ||||
| 		) | ||||
| 		err := jsonx.NewDecoder(res.Body).Decode(&paging) | ||||
| 		res.Body.Close() | ||||
| 		if err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
|   | ||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user