20 Commits

Author SHA1 Message Date
Janos Dobronszki
b17a9fdc38 F 2021-09-14 16:29:22 +01:00
Janos Dobronszki
09a1dac9fe Add services 2021-09-14 15:36:03 +01:00
Asim Aslam
0fe1baa576 Update README.md 2021-08-19 14:13:18 +01:00
Asim Aslam
824a47df5f Update README.md 2021-08-19 14:12:58 +01:00
Asim Aslam
3851006b3f Merge pull request #3 from lambdaR/timeout
Timeout
2021-06-11 20:48:18 +01:00
Daniel Joudat
6f6c4595f8 handling Timeout inside NewClient() 2021-06-11 22:03:59 +03:00
Daniel Joudat
b0c2e0b5c3 added timeout option 2021-06-11 20:19:07 +03:00
Asim Aslam
cf961b497e Merge branch 'master' of ssh://github.com/m3o/m3o-go 2021-04-21 16:08:13 +01:00
Asim Aslam
e335107786 Update README.md 2021-04-21 16:07:32 +01:00
Asim Aslam
384cfd9411 Update README.md 2021-04-21 16:06:25 +01:00
Asim Aslam
6d6edbe311 Update README.md 2021-04-21 16:06:06 +01:00
Asim Aslam
d273bcb0b9 move go mod to top level 2021-04-21 16:05:08 +01:00
Asim Aslam
8bfd7992ad Update README.md 2021-04-21 15:47:25 +01:00
Asim Aslam
c120cd2cf9 remove leading slash 2021-04-21 15:22:30 +01:00
Asim Aslam
facbb32e8e check nil options 2021-04-21 15:20:16 +01:00
Asim Aslam
4f3b55fa74 fix go mod 2021-04-21 15:18:07 +01:00
Asim Aslam
8d0170e51c Merge pull request #2 from m3o/fix-stream
use v1 api for stream
2021-04-21 13:53:14 +01:00
Asim Aslam
7b553cd374 use v1 api for stream 2021-04-21 13:52:21 +01:00
Janos Dobronszki
f7f75653ba Fix client to call v1api (#1) 2021-04-21 11:55:02 +01:00
Asim Aslam
c0d3889746 Update README.md 2021-02-06 09:24:10 +00:00
48 changed files with 2980 additions and 1288 deletions

BIN
.DS_Store vendored

Binary file not shown.

191
LICENSE Normal file
View File

@@ -0,0 +1,191 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
Copyright 2020 Micro Services, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

96
README.md Normal file
View File

@@ -0,0 +1,96 @@
# M3O Go Client [![godoc](https://godoc.org/github.com/m3o/m3o-go?status.svg)](https://godoc.org/github.com/m3o/m3o-go) [![Go Report Card](https://goreportcard.com/badge/github.com/m3o/m3o-go)](https://goreportcard.com/report/github.com/m3o/m3o-go) [![Apache 2.0 License](https://img.shields.io/github/license/m3o/m3o-go)](https://github.com/m3o/m3o-go/blob/master/LICENSE)
This is the Go client to access APIs on the M3O Platform
## Usage
```go
package main
import (
"fmt"
"os"
"github.com/m3o/m3o-go/client"
)
type Request struct {
Name string `json:"name"`
}
type Response struct {
Msg string `json:"msg"`
}
var (
token, _ = os.Getenv("TOKEN")
)
func main() {
c := client.NewClient(nil)
// set your api token
c.SetToken(token)
req := &Request{
Name: "John",
}
var rsp Response
if err := c.Call("helloworld", "call", req, &rsp); err != nil {
fmt.Println(err)
return
}
fmt.Println(rsp)
}
```
## Streaming
The client supports streaming
```go
package main
import (
"fmt"
"github.com/m3o/m3o-go/client"
)
type Request struct {
Count string `json:"count"`
}
type Response struct {
Count string `json:"count"`
}
var (
token, _ = os.Getenv("TOKEN")
)
func main() {
c := client.NewClient(nil)
// set your api token
c.SetToken(token)
stream, err := c.Stream("streams", "subscribe", Request{Count: "10"})
if err != nil {
fmt.Println(err)
return
}
for {
var rsp Response
if err := stream.Recv(&rsp); err != nil {
fmt.Println(err)
return
}
fmt.Println("got", rsp.Count)
}
}
```

220
client/client.go Normal file
View File

@@ -0,0 +1,220 @@
package client
import (
"bytes"
"encoding/json"
"errors"
"io/ioutil"
"net/http"
"net/url"
"strings"
"time"
"github.com/gorilla/websocket"
)
const (
// local address for api
localAddress = "http://localhost:8080"
// public address for api
liveAddress = "https://api.m3o.com"
)
// Options of the Client
type Options struct {
// Token for authentication
Token string
// Address of the micro platform.
// By default it connects to live. Change it or use the local flag
// to connect to your local installation.
Address string
// Helper flag to help users connect to the default local address
Local bool
// set a timeout
Timeout time.Duration
}
// Request is the request of the generic `api-client` call
type Request struct {
// eg. "go.micro.srv.greeter"
Service string `json:"service"`
// eg. "Say.Hello"
Endpoint string `json:"endpoint"`
// json and then base64 encoded body
Body string `json:"body"`
}
// Response is the response of the generic `api-client` call.
type Response struct {
// json and base64 encoded response body
Body string `json:"body"`
// error fields. Error json example
// {"id":"go.micro.client","code":500,"detail":"malformed method name: \"\"","status":"Internal Server Error"}
Code int `json:"code"`
ID string `json:"id"`
Detail string `json:"detail"`
Status string `json:"status"`
}
// Client enables generic calls to micro
type Client struct {
options Options
}
type Stream struct {
conn *websocket.Conn
service, endpoint string
}
// NewClient returns a generic micro client that connects to live by default
func NewClient(options *Options) *Client {
ret := new(Client)
ret.options = Options{
Address: liveAddress,
}
// no options provided
if options == nil {
return ret
}
if options.Token != "" {
ret.options.Token = options.Token
}
if options.Local {
ret.options.Address = localAddress
ret.options.Local = true
}
if options.Timeout > 0 {
ret.options.Timeout = options.Timeout
}
return ret
}
// SetToken sets the api auth token
func (client *Client) SetToken(t string) {
client.options.Token = t
}
// SetTimeout sets the http client's timeout
func (client *Client) SetTimeout(d time.Duration) {
client.options.Timeout = d
}
// Call enables you to access any endpoint of any service on Micro
func (client *Client) Call(service, endpoint string, request, response interface{}) error {
// example curl: curl -XPOST -d '{"service": "go.micro.srv.greeter", "endpoint": "Say.Hello"}'
// -H 'Content-Type: application/json' http://localhost:8080/client {"body":"eyJtc2ciOiJIZWxsbyAifQ=="}
uri, err := url.Parse(client.options.Address)
if err != nil {
return err
}
// set the url to go through the v1 api
uri.Path = "/v1/" + service + "/" + endpoint
b, err := marshalRequest(service, endpoint, request)
if err != nil {
return err
}
req, err := http.NewRequest("POST", uri.String(), bytes.NewBuffer(b))
if err != nil {
return err
}
// set the token if it exists
if len(client.options.Token) > 0 {
req.Header.Set("Authorization", "Bearer "+client.options.Token)
}
req.Header.Set("Content-Type", "application/json")
// if user didn't specify Timeout the default is 0 i.e no timeout
httpClient := &http.Client{
Timeout: client.options.Timeout,
}
resp, err := httpClient.Do(req)
if err != nil {
return err
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return err
}
if !(resp.StatusCode >= 200 && resp.StatusCode < 300) {
return errors.New(string(body))
}
return unmarshalResponse(body, response)
}
// Stream enables the ability to stream via websockets
func (client *Client) Stream(service, endpoint string, request interface{}) (*Stream, error) {
b, err := marshalRequest(service, endpoint, request)
if err != nil {
return nil, err
}
uri, err := url.Parse(client.options.Address)
if err != nil {
return nil, err
}
// set the url to go through the v1 api
uri.Path = "/v1/" + service + "/" + endpoint
// replace http with websocket
uri.Scheme = strings.Replace(uri.Scheme, "http", "ws", 1)
// create the headers
header := make(http.Header)
// set the token if it exists
if len(client.options.Token) > 0 {
header.Set("Authorization", "Bearer "+client.options.Token)
}
header.Set("Content-Type", "application/json")
// dial the connection
conn, _, err := websocket.DefaultDialer.Dial(uri.String(), header)
if err != nil {
return nil, err
}
// send the first request
if err := conn.WriteMessage(websocket.TextMessage, b); err != nil {
return nil, err
}
return &Stream{conn, service, endpoint}, nil
}
func (s *Stream) Recv(v interface{}) error {
// read response
_, message, err := s.conn.ReadMessage()
if err != nil {
return err
}
return unmarshalResponse(message, v)
}
func (s *Stream) Send(v interface{}) error {
b, err := marshalRequest(s.service, s.endpoint, v)
if err != nil {
return err
}
return s.conn.WriteMessage(websocket.TextMessage, b)
}
func marshalRequest(service, endpoint string, v interface{}) ([]byte, error) {
return json.Marshal(v)
}
func unmarshalResponse(body []byte, v interface{}) error {
return json.Unmarshal(body, &v)
}

20
client/client_test.go Normal file
View File

@@ -0,0 +1,20 @@
package client
import (
"os"
"testing"
)
func TestBasicCall(t *testing.T) {
response := map[string]interface{}{}
if err := NewClient(&Options{
Token: os.Getenv("TOKEN"),
}).Call("groups", "list", map[string]interface{}{
"memberId": "random",
}, &response); err != nil {
t.Fatal(err)
}
if len(response) > 0 {
t.Fatal(len(response))
}
}

View File

@@ -1,27 +0,0 @@
// Package context provides a layer of abstraction above go's native context, providing access to
// metadata which can be set by passing headers to the M3O API.
package context
import "context"
// Context provided to a service handler
type Context struct {
context.Context
}
// GetRequestHeader from the request
func (c *Context) GetRequestHeader(key string) string {
return ""
}
// SetRequestHeader on the context
func (c *Context) SetRequestHeader(key, value string) {
}
// SetResponseHeader on the context
func (c *Context) SetResponseHeader(key, value string) {
}
// SetResponseCode on the context
func (c *Context) SetResponseCode(code int) {
}

View File

@@ -1,39 +0,0 @@
package errors
import (
"fmt"
"net/http"
)
// Error returned from a M3O service handler, the status code is used by the M3O API to determine
// the status code of the response.
type Error struct {
// Service which first returned the error
Service string
// StatusCode which indicates the type of error
StatusCode int
// Message provides additional information about an error
Message string
}
func (e *Error) Error() string {
return fmt.Sprintf("%v: %v", http.StatusText(e.StatusCode), e.Message)
}
// BadRequest error indicates that the server cannot or will not process the request due to something
// that is perceived to be a client error (e.g., malformed request syntax)
func BadRequest(format string, a ...interface{}) *Error {
return &Error{
StatusCode: http.StatusBadRequest,
Message: fmt.Sprintf(format, a...),
}
}
// InternalServerError indicates that the server encountered an unexpected condition that prevented
// it from fulfilling the request.
func InternalServerError(format string, a ...interface{}) *Error {
return &Error{
StatusCode: http.StatusInternalServerError,
Message: fmt.Sprintf(format, a...),
}
}

View File

@@ -1,99 +0,0 @@
package handler
import (
"crypto/rand"
otp "github.com/m3o/m3o-go/examples/otp/proto"
"github.com/m3o/m3o-go/context"
"github.com/m3o/m3o-go/errors"
"github.com/m3o/m3o-go/sms"
"github.com/m3o/m3o-go/store/keyvalue"
)
const (
otpChars = "1234567890"
otpLength = 6
otpTTL = time.Minute * 5
)
var (
errMissingPhoneNumber = errors.BadRequest("Missing PhoneNumber")
errMissingCode = errors.BadRequest("Missing Code")
errInvalidCode = errors.BadRequest("Invalid Code")
)
// OTP satisfies the OTP handler interface. Note: this handler is an exampple and not intended for
// production use - the handler does not enforce verification limits so it would be possible to brute
// force the verification process. It is advised to use a retry limit of 3 in real-world applications.
type OTP struct {
SMS sms.Service
Store keyvalue.Store
}
// Send a one time password to the phone number provided
func (o *OTP) Send(ctx context.Context, req *otp.SendRequest) (*otp.SendResponse, error) {
// validate the request
if len(req.PhoneNumber) == 0 {
return nil, errMissingPhoneNumber
}
// generate and send the OPT
otp := generateOTP()
msg := fmt.Sprintf("Your M3O verification code is %v", otp
if err := o.SMS.Send(req.PhoneNumber, msg); err != nil {
return nil, err
}
// write the code to the store
err := o.Store.Write(req.PhoneNumber, otp, keyvalue.WriteOptions{
Expiry: time.Now().Add(otpTTL),
})
if err != nil {
return nil, errors.InternalServerError("Error writing OTP to the store")
}
// return no error, indicating the verification code send successfully
return &otp.SendResponse{}, nil
}
// Validate a one time password
func (o *OTP) Verify(ctx context.Context, req *otp.VerifyRequest) (*otp.VerifyResponse, error) {
// validate the request
if len(req.PhoneNumber) == 0 {
return nil, errMissingPhoneNumber
}
if len(req.Code) == 0 {
return nil, errMissingCode
}
// lookup the phone number from the store
rec, err := o.Store.Read(req.PhoneNumber)
if err == keyvalue.ErrRecordNotFound {
return nil, errMissingCode
} else if err != nil {
return nil, errors.InternalServerError("Error reading OTP from the store")
}
// ensure the codes match
if rec.Value != req.Code {
return nil, errInvalidCode
}
// return no error, indicating the verification was successful
return &otp.VerifyResponse{}, nil
}
func generateOTP() (string, error) {
buffer := make([]byte, otpLength)
_, err := rand.Read(buffer)
if err != nil {
return "", err
}
otpCharsLength := len(otpChars)
for i := 0; i < otpLength; i++ {
buffer[i] = otpChars[int(buffer[i])%otpCharsLength]
}
return string(buffer), nil
}

View File

@@ -1,23 +0,0 @@
package handler
import (
"testing"
"github.com/m3o/m3o-go/sms"
"github.com/m3o/m3o-go/store/keyvalue"
)
func TestHandler(t *testing.T) {
h := OTP{
SMS: sms.NewMock(),
Store: keyvalue.NewMock(),
}
t.Run("Send", func(t *testing.T) {
})
t.Run("Verify", func(t *testing.T) {
})
}

View File

@@ -1,19 +0,0 @@
package otp
import (
"github.com/m3o/m3o-go/examples/otp/handler"
"github.com/m3o/m3o-go/server"
"github.com/m3o/m3o-go/sms"
"github.com/m3o/m3o-go/store/keyvalue"
)
func main() {
// register the handler
server.RegisterHandler(handler.OTP{
SMS: sms.NewClient(),
Store: keyvalue.NewClient(),
})
// run the server
server.Run()
}

View File

@@ -1,339 +0,0 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.23.0
// protoc v3.13.0
// source: otp/proto/otp.proto
package otp
import (
proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
type SendRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
PhoneNumber string `protobuf:"bytes,1,opt,name=phone_number,json=phoneNumber,proto3" json:"phone_number,omitempty"`
}
func (x *SendRequest) Reset() {
*x = SendRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_otp_proto_otp_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SendRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SendRequest) ProtoMessage() {}
func (x *SendRequest) ProtoReflect() protoreflect.Message {
mi := &file_otp_proto_otp_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SendRequest.ProtoReflect.Descriptor instead.
func (*SendRequest) Descriptor() ([]byte, []int) {
return file_otp_proto_otp_proto_rawDescGZIP(), []int{0}
}
func (x *SendRequest) GetPhoneNumber() string {
if x != nil {
return x.PhoneNumber
}
return ""
}
type SendResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *SendResponse) Reset() {
*x = SendResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_otp_proto_otp_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SendResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SendResponse) ProtoMessage() {}
func (x *SendResponse) ProtoReflect() protoreflect.Message {
mi := &file_otp_proto_otp_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SendResponse.ProtoReflect.Descriptor instead.
func (*SendResponse) Descriptor() ([]byte, []int) {
return file_otp_proto_otp_proto_rawDescGZIP(), []int{1}
}
type VerifyRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
PhoneNumber string `protobuf:"bytes,1,opt,name=phone_number,json=phoneNumber,proto3" json:"phone_number,omitempty"`
Code string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"`
}
func (x *VerifyRequest) Reset() {
*x = VerifyRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_otp_proto_otp_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *VerifyRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*VerifyRequest) ProtoMessage() {}
func (x *VerifyRequest) ProtoReflect() protoreflect.Message {
mi := &file_otp_proto_otp_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use VerifyRequest.ProtoReflect.Descriptor instead.
func (*VerifyRequest) Descriptor() ([]byte, []int) {
return file_otp_proto_otp_proto_rawDescGZIP(), []int{2}
}
func (x *VerifyRequest) GetPhoneNumber() string {
if x != nil {
return x.PhoneNumber
}
return ""
}
func (x *VerifyRequest) GetCode() string {
if x != nil {
return x.Code
}
return ""
}
type VerifyResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *VerifyResponse) Reset() {
*x = VerifyResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_otp_proto_otp_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *VerifyResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*VerifyResponse) ProtoMessage() {}
func (x *VerifyResponse) ProtoReflect() protoreflect.Message {
mi := &file_otp_proto_otp_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use VerifyResponse.ProtoReflect.Descriptor instead.
func (*VerifyResponse) Descriptor() ([]byte, []int) {
return file_otp_proto_otp_proto_rawDescGZIP(), []int{3}
}
var File_otp_proto_otp_proto protoreflect.FileDescriptor
var file_otp_proto_otp_proto_rawDesc = []byte{
0x0a, 0x13, 0x6f, 0x74, 0x70, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6f, 0x74, 0x70, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x6f,
0x74, 0x70, 0x22, 0x30, 0x0a, 0x0b, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65,
0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75,
0x6d, 0x62, 0x65, 0x72, 0x22, 0x0e, 0x0a, 0x0c, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x46, 0x0a, 0x0d, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x5f, 0x6e,
0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x68, 0x6f,
0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x10, 0x0a, 0x0e,
0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x85,
0x01, 0x0a, 0x03, 0x4f, 0x54, 0x50, 0x12, 0x3b, 0x0a, 0x04, 0x53, 0x65, 0x6e, 0x64, 0x12, 0x18,
0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x6f, 0x74, 0x70, 0x2e, 0x53, 0x65, 0x6e,
0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70,
0x6c, 0x65, 0x2e, 0x6f, 0x74, 0x70, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x06, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x12, 0x1a, 0x2e,
0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x6f, 0x74, 0x70, 0x2e, 0x56, 0x65, 0x72, 0x69,
0x66, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x65, 0x78, 0x61, 0x6d,
0x70, 0x6c, 0x65, 0x2e, 0x6f, 0x74, 0x70, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x2e, 0x5a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x33, 0x6f, 0x2f, 0x6d, 0x33, 0x6f, 0x2d, 0x67, 0x6f, 0x2d,
0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2f, 0x6f, 0x74, 0x70, 0x2f, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x3b, 0x6f, 0x74, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_otp_proto_otp_proto_rawDescOnce sync.Once
file_otp_proto_otp_proto_rawDescData = file_otp_proto_otp_proto_rawDesc
)
func file_otp_proto_otp_proto_rawDescGZIP() []byte {
file_otp_proto_otp_proto_rawDescOnce.Do(func() {
file_otp_proto_otp_proto_rawDescData = protoimpl.X.CompressGZIP(file_otp_proto_otp_proto_rawDescData)
})
return file_otp_proto_otp_proto_rawDescData
}
var file_otp_proto_otp_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_otp_proto_otp_proto_goTypes = []interface{}{
(*SendRequest)(nil), // 0: example.otp.SendRequest
(*SendResponse)(nil), // 1: example.otp.SendResponse
(*VerifyRequest)(nil), // 2: example.otp.VerifyRequest
(*VerifyResponse)(nil), // 3: example.otp.VerifyResponse
}
var file_otp_proto_otp_proto_depIdxs = []int32{
0, // 0: example.otp.OTP.Send:input_type -> example.otp.SendRequest
2, // 1: example.otp.OTP.Verify:input_type -> example.otp.VerifyRequest
1, // 2: example.otp.OTP.Send:output_type -> example.otp.SendResponse
3, // 3: example.otp.OTP.Verify:output_type -> example.otp.VerifyResponse
2, // [2:4] is the sub-list for method output_type
0, // [0:2] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_otp_proto_otp_proto_init() }
func file_otp_proto_otp_proto_init() {
if File_otp_proto_otp_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_otp_proto_otp_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SendRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_otp_proto_otp_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SendResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_otp_proto_otp_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*VerifyRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_otp_proto_otp_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*VerifyResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_otp_proto_otp_proto_rawDesc,
NumEnums: 0,
NumMessages: 4,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_otp_proto_otp_proto_goTypes,
DependencyIndexes: file_otp_proto_otp_proto_depIdxs,
MessageInfos: file_otp_proto_otp_proto_msgTypes,
}.Build()
File_otp_proto_otp_proto = out.File
file_otp_proto_otp_proto_rawDesc = nil
file_otp_proto_otp_proto_goTypes = nil
file_otp_proto_otp_proto_depIdxs = nil
}

View File

@@ -1,101 +0,0 @@
// Code generated by protoc-gen-micro. DO NOT EDIT.
// source: otp/proto/otp.proto
package otp
import (
fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto"
context "context"
api "github.com/micro/micro/v3/service/api"
client "github.com/micro/micro/v3/service/client"
server "github.com/micro/micro/v3/service/server"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
// Reference imports to suppress errors if they are not otherwise used.
var _ api.Endpoint
var _ context.Context
var _ client.Option
var _ server.Option
// Api Endpoints for OTP service
func NewOTPEndpoints() []*api.Endpoint {
return []*api.Endpoint{}
}
// Client API for OTP service
type OTPService interface {
Send(ctx context.Context, in *SendRequest, opts ...client.CallOption) (*SendResponse, error)
Verify(ctx context.Context, in *VerifyRequest, opts ...client.CallOption) (*VerifyResponse, error)
}
type oTPService struct {
c client.Client
name string
}
func NewOTPClient() OTPService {
return &oTPService{}
}
func NewOTPMock() OTPService {
return &oTPService{}
}
func (c *oTPService) Send(ctx context.Context, in *SendRequest, opts ...client.CallOption) (*SendResponse, error) {
req := c.c.NewRequest(c.name, "OTP.Send", in)
out := new(SendResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *oTPService) Verify(ctx context.Context, in *VerifyRequest, opts ...client.CallOption) (*VerifyResponse, error) {
req := c.c.NewRequest(c.name, "OTP.Verify", in)
out := new(VerifyResponse)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for OTP service
type OTPHandler interface {
Send(context.Context, *SendRequest) (*SendResponse, error)
Verify(context.Context, *VerifyRequest) (*VerifyResponse, error)
}
type oTPHandler struct {
OTPHandler
}
func (h *oTPHandler) Send(ctx context.Context, req *SendRequest) (*SendResponse, error) {
return h.OTPHandler.Send(ctx, req)
}
func (h *oTPHandler) Verify(ctx context.Context, req *VerifyRequest) (*VerifyResponse, error) {
return h.OTPHandler.Verify(ctx, req)
}

View File

@@ -1,22 +0,0 @@
syntax = "proto3";
package example.otp;
option go_package = "github.com/m3o/m3o-go-examples/otp/proto;otp";
service OTP {
rpc Send(SendRequest) returns (SendResponse);
rpc Verify(VerifyRequest) returns (VerifyResponse);
}
message SendRequest {
string phone_number = 1;
}
message SendResponse {}
message VerifyRequest {
string phone_number = 1;
string code = 2;
}
message VerifyResponse {}

6
go.mod
View File

@@ -2,8 +2,4 @@ module github.com/m3o/m3o-go
go 1.15
require (
github.com/golang/protobuf v1.4.3
github.com/micro/micro/v3 v3.0.1
google.golang.org/protobuf v1.25.0
)
require github.com/gorilla/websocket v1.4.2

477
go.sum
View File

@@ -1,477 +1,2 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
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/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
contrib.go.opencensus.io/exporter/ocagent v0.4.12/go.mod h1:450APlNTSR6FrvC3CTRqYosuDstRB9un7SOx2k/9ckA=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/Azure/azure-sdk-for-go v32.4.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/go-autorest/autorest v0.1.0/go.mod h1:AKyIcETwSUFxIcs/Wnq/C+kwCtlEYGUVd7FPNb2slmg=
github.com/Azure/go-autorest/autorest v0.5.0/go.mod h1:9HLKlQjVBH6U3oDfsXOeVc56THsLPw1L03yban4xThw=
github.com/Azure/go-autorest/autorest/adal v0.1.0/go.mod h1:MeS4XhScH55IST095THyTxElntu7WqB7pNbZo8Q5G3E=
github.com/Azure/go-autorest/autorest/adal v0.2.0/go.mod h1:MeS4XhScH55IST095THyTxElntu7WqB7pNbZo8Q5G3E=
github.com/Azure/go-autorest/autorest/azure/auth v0.1.0/go.mod h1:Gf7/i2FUpyb/sGBLIFxTBzrNzBo7aPXXE3ZVeDRwdpM=
github.com/Azure/go-autorest/autorest/azure/cli v0.1.0/go.mod h1:Dk8CUAt/b/PzkfeRsWzVG9Yj3ps8mS8ECztu43rdU8U=
github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA=
github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0=
github.com/Azure/go-autorest/autorest/to v0.2.0/go.mod h1:GunWKJp1AEqgMaGLV+iocmRAJWqST1wQYhyyjXJ3SJc=
github.com/Azure/go-autorest/autorest/validation v0.1.0/go.mod h1:Ha3z/SqBeaalWQvokg3NZAlQTalVMtOIAs1aGK7G6u8=
github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc=
github.com/Azure/go-autorest/tracing v0.1.0/go.mod h1:ROEEAFwXycQw7Sn3DXNtEedEvdeRAgDr0izn4z5Ij88=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/OpenDNS/vegadns2client v0.0.0-20180418235048-a3fa4a771d87/go.mod h1:iGLljf5n9GjT6kc0HBvyI1nOKnGQbNB66VzSNbK5iks=
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/akamai/AkamaiOPEN-edgegrid-golang v0.9.0/go.mod h1:zpDJeKyp9ScW4NNrbdr+Eyxvry3ilGPewKoXw3XGN1k=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20190808125512-07798873deee/go.mod h1:myCDvQSzCW+wB1WAlocEru4wMGJxy+vlxHdhegi1CDQ=
github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20190307165228-86c17b95fcd5/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8=
github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
github.com/aws/aws-sdk-go v1.23.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA=
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4=
github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps=
github.com/caddyserver/certmagic v0.10.6/go.mod h1:Y8jcUBctgk/IhpAzlHKfimZNyXCkfGgRTC0orl8gROQ=
github.com/cenkalti/backoff/v4 v4.0.0/go.mod h1:eEew/i+1Q6OrCDZh3WiXYv3+nJwBASZ8Bog/87DQnVg=
github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
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/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cloudflare/cloudflare-go v0.10.2/go.mod h1:qhVI5MKwBGhdNU89ZRz2plgYutcJ5PCekLxXn56w6SY=
github.com/cloudflare/cloudflare-go v0.10.9/go.mod h1:5TrsWH+3f4NV6WjtS5QFp+DifH81rph40gU374Sh0dQ=
github.com/cpu/goacmedns v0.0.1/go.mod h1:sesf/pNnCYwUevQEQfEwY0Y3DydlQWSGZbaMElOWxok=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8=
github.com/dnaeon/go-vcr v0.0.0-20180814043457-aafff18a5cc2/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E=
github.com/dnsimple/dnsimple-go v0.30.0/go.mod h1:O5TJ0/U6r7AfT8niYNlmohpLbCSG+c71tQlGr9SeGrg=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/evanphx/json-patch/v5 v5.0.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4=
github.com/exoscale/egoscale v0.18.1/go.mod h1:Z7OOdzzTOz1Q1PjQXumlz9Wn/CddH0zSYdCF3rnBKXE=
github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/go-acme/lego/v3 v3.4.0/go.mod h1:xYbLDuxq3Hy4bMUT1t9JIuz6GWIWb3m5X+TeTHYaT7M=
github.com/go-cmd/cmd v1.0.5/go.mod h1:y8q8qlK5wQibcw63djSl/ntiHUHXHGdCkPk0j4QeW4s=
github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-ini/ini v1.44.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8=
github.com/go-kit/kit v0.8.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-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo=
github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw=
github.com/gobwas/ws v1.0.3/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM=
github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
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/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
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.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
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=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-github/v30 v30.1.0/go.mod h1:n8jBpHl45a/rlBUtRJMOG4GhNADUQFEufcolZ95JfU8=
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/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
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/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/gophercloud/gophercloud v0.3.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ=
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI=
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
github.com/hashicorp/go-retryablehttp v0.6.4/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/iij/doapi v0.0.0-20190504054126-0bbf12d6d7df/go.mod h1:QMZY7/J/KSQEhKWFeDesPjMj+wCHReeknARU3wqlyN4=
github.com/improbable-eng/grpc-web v0.13.0/go.mod h1:6hRR09jOEG81ADP5wCQju1z71g6OL4eEvELdran/3cs=
github.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf/go.mod h1:hyb9oH7vZsitZCiBt0ZvifOrB+qc8PS5IiilCIb87rg=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/juju/fslock v0.0.0-20160525022230-4d5c94c67b4b/go.mod h1:HMcgvsgd0Fjj4XXDkbjdmlbI505rUPBs6WBMYg2pXks=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/cpuid v1.2.3/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
github.com/klauspost/cpuid v1.3.1/go.mod h1:bYW4mA6ZgKPob1/Dlai2LviZJO7KGI3uoWLd42rAQw4=
github.com/kolo/xmlrpc v0.0.0-20190717152603-07c4ee3fd181/go.mod h1:o03bZfuBwAXHetKXuInt4S7omeXUu62/A845kiycsSQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/labbsr0x/bindman-dns-webhook v1.0.2/go.mod h1:p6b+VCXIR8NYKpDr8/dg1HKfQoRHCdcsROXKvmoehKA=
github.com/labbsr0x/goh v1.0.1/go.mod h1:8K2UhVoaWXcCU7Lxoa2omWnC8gyW8px7/lmO61c027w=
github.com/linode/linodego v0.10.0/go.mod h1:cziNP7pbvE3mXIPneHj0oRY8L1WtGEIKlZ8LANE4eXA=
github.com/liquidweb/liquidweb-go v1.6.0/go.mod h1:UDcVnAMDkZxpw4Y7NOHkqoeiGacVLEIG/i5J9cyixzQ=
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-tty v0.0.0-20180219170247-931426f7535a/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/micro/micro v1.18.0 h1:v+xiQOXbT9xxotLwu1nJM81t4FbruBxZSSyIdhUfujM=
github.com/micro/micro/v3 v3.0.1 h1:f4NNOPBJm6EJOYgIyN5yrI+T7ib80iu8L2hY5po1cBk=
github.com/micro/micro/v3 v3.0.1/go.mod h1:4nd3UmJRBY3E29h4dvarrldPmxMSQ6abTFBzE0wOWgw=
github.com/miekg/dns v1.1.15/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
github.com/miekg/dns v1.1.27/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM=
github.com/minio/md5-simd v1.1.0/go.mod h1:XpBqgZULrMYD3R+M28PcmP0CkI7PEMzB3U77ZrKZ0Gw=
github.com/minio/minio-go/v7 v7.0.5/go.mod h1:TA0CQCjJZHM5SJj9IjqR0NmpmQJ6bCbXifAJ3mUU6Hw=
github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/go-vnc v0.0.0-20150629162542-723ed9867aed/go.mod h1:3rdaFaCv4AyBgu5ALFM0+tSuHrBh6v692nyQe3ikrq0=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/namedotcom/go v0.0.0-20180403034216-08470befbe04/go.mod h1:5sN+Lt1CaY4wsPvgQH/jsuJi4XO2ssZbdsIizr4CVC8=
github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/nrdcg/auroradns v1.0.0/go.mod h1:6JPXKzIRzZzMqtTDgueIhTi6rFf1QvYE/HzqidhOhjw=
github.com/nrdcg/dnspod-go v0.4.0/go.mod h1:vZSoFSFeQVm2gWLMkyX61LZ8HI3BaqtHZWgPTGKr6KQ=
github.com/nrdcg/goinwx v0.6.1/go.mod h1:XPiut7enlbEdntAqalBIqcYcTEVhpv/dKWgDCX2SwKQ=
github.com/nrdcg/namesilo v0.2.1/go.mod h1:lwMvfQTyYq+BbjJd30ylEG4GPSS6PII0Tia4rRpRiyw=
github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
github.com/olekukonko/tablewriter v0.0.3/go.mod h1:YZeBtGzYYEsCHp2LST/u/0NDwGkRoBtmn1cIWCJiS6M=
github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg=
github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
github.com/oracle/oci-go-sdk v7.0.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35ukwStZIg5F66tcBccjip/j888=
github.com/ovh/go-ovh v0.0.0-20181109152953-ba5adb4cf014/go.mod h1:joRatxRJaZBsY3JAOEMcoOp05CnZzsx4scTxi95DHyQ=
github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c/go.mod h1:X07ZCGwUbLaax7L0S3Tw4hpejzu63ZrrQiUe6W0hcy0=
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ=
github.com/rainycape/memcache v0.0.0-20150622160815-1031fa0ce2f2/go.mod h1:7tZKcyumwBO6qip7RNQ5r77yrssm9bfCowcLEBcU5IA=
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
github.com/rhysd/go-github-selfupdate v1.2.2/go.mod h1:khesvSyKcXDUxeySCedFh621iawCks0dS/QnHPcpCws=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sacloud/libsacloud v1.26.1/go.mod h1:79ZwATmHLIFZIMd7sxA3LwzVy/B77uj3LDoToVTxDoQ=
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
github.com/serenize/snaker v0.0.0-20171204205717-a683aaf2d516/go.mod h1:Yow6lPLSAXx2ifx470yD/nUe22Dv5vBvxK/UK9UUTVs=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/skratchdot/open-golang v0.0.0-20160302144031-75fb7ed4208c/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/tcnksm/go-gitconfig v0.1.2/go.mod h1:/8EhP4H7oJZdIPyT+/UIsG87kTzrzM4UsLGSItWYCpE=
github.com/teris-io/shortid v0.0.0-20171029131806-771a37caa5cf/go.mod h1:M8agBzgqHIhgj7wEn9/0hJUZcrvt9VY+Ln+S1I5Mha0=
github.com/timewasted/linode v0.0.0-20160829202747-37e84520dcf7/go.mod h1:imsgLplxEC/etjIhdr3dNzV3JeT27LbVu5pYWm0JCBY=
github.com/transip/gotransip v0.0.0-20190812104329-6d8d9179b66f/go.mod h1:i0f4R4o2HM0m3DZYQWsj6/MEowD57VzoH0v3d7igeFY=
github.com/uber-go/atomic v1.3.2/go.mod h1:/Ct5t2lcmbJ4OSe/waGBoaVvVqtO0bmtfVNex1PFV8g=
github.com/ulikunitz/xz v0.5.5/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8=
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/cli/v2 v2.2.0/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ=
github.com/vultr/govultr v0.1.4/go.mod h1:9H008Uxr/C4vFNGLqKx232C206GL0PBHzOP0809bGNA=
github.com/xanzy/go-gitlab v0.35.1/go.mod h1:sPLojNBn68fMUWSxIJtdVVIP8uSBYqesTfDUseX11Ug=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
github.com/xeipuuv/gojsonschema v1.1.0/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs=
github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg=
go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/ratelimit v0.0.0-20180316092928-c15da0234277/go.mod h1:2X8KaoNd1J0lZV+PxJk/5+DGbO/tpwLR1m++a7FnB/Y=
golang.org/x/crypto v0.0.0-20180621125126-a49355c7e3f8/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190418165655-df01cb2cc480/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/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/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-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
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-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/net v0.0.0-20180611182652-db08ff08e862/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=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181108082009-03003ca0c849/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
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-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-20190930134127-c5a3c61f89f3/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191027093000-83d349e8ac1a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191126235420-ef20fe5d7933/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU=
golang.org/x/net v0.0.0-20200707034311-ab3426394381/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-20181106182150-f42d05182288/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-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
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/sys v0.0.0-20180622082034-63fc586f45fe/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=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
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-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae h1:Ih9Yo4hSPImZOpfGuA4bR/ORKTAbhZo2AbWNRCnevdo=
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
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/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-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-20190921001708-c4c64cad1fd0/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-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/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-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/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/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
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.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
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-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
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.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
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/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.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/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/h2non/gock.v1 v1.0.15/go.mod h1:sX4zAkdYX1TRGJ2JY156cFspQn4yRWn6p9EMdODlynE=
gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/ini.v1 v1.44.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/ini.v1 v1.57.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/ns1/ns1-go.v2 v2.0.0-20190730140822-b51389932cbc/go.mod h1:VV+3haRsgDiVLxyifmMBrBIuCWFBPYKbRssXB9z67Hw=
gopkg.in/resty.v1 v1.9.1/go.mod h1:vo52Hzryw9PnPHcJfPsBiFW62XhNx5OczbV9y+IMpgc=
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
gopkg.in/square/go-jose.v2 v2.4.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=

View File

@@ -1,12 +0,0 @@
package server
// RegisterHandler to be serverd by the grpc server upon Run()
func RegisterHandler(h interface{}) {
}
// Run the server. This will start a grpc server and register to service discovery
func Run() {
c := make(chan bool)
<-c
}

57
service/address/address.go Executable file
View File

@@ -0,0 +1,57 @@
package address
import (
"github.com/m3o/m3o-go/client"
)
func NewAddressService(token string) *AddressService {
return &AddressService{
client: client.NewClient(&client.Options{
Token: token,
}),
}
}
type AddressService struct {
client *client.Client
}
// Lookup a list of UK addresses by postcode
func (t *AddressService) LookupPostcode(request *LookupPostcodeRequest) (*LookupPostcodeResponse, error) {
rsp := &LookupPostcodeResponse{}
return rsp, t.client.Call("address", "LookupPostcode", request, rsp)
}
type LookupPostcodeRequest struct {
// UK postcode e.g SW1A 2AA
Postcode string `json:"postcode"`
}
type LookupPostcodeResponse struct {
Addresses []Record `json:"addresses"`
}
type Record struct {
// building name
BuildingName string `json:"buildingName"`
// the county
County string `json:"county"`
// line one of address
LineOne string `json:"lineOne"`
// line two of address
LineTwo string `json:"lineTwo"`
// dependent locality
Locality string `json:"locality"`
// organisation if present
Organisation string `json:"organisation"`
// the postcode
Postcode string `json:"postcode"`
// the premise
Premise string `json:"premise"`
// street name
Street string `json:"street"`
// the complete address
Summary string `json:"summary"`
// post town
Town string `json:"town"`
}

37
service/answer/answer.go Executable file
View File

@@ -0,0 +1,37 @@
package answer
import (
"github.com/m3o/m3o-go/client"
)
func NewAnswerService(token string) *AnswerService {
return &AnswerService{
client: client.NewClient(&client.Options{
Token: token,
}),
}
}
type AnswerService struct {
client *client.Client
}
// Ask a question and receive an instant answer
func (t *AnswerService) Question(request *QuestionRequest) (*QuestionResponse, error) {
rsp := &QuestionResponse{}
return rsp, t.client.Call("answer", "Question", request, rsp)
}
type QuestionRequest struct {
// the question to answer
Query string `json:"query"`
}
type QuestionResponse struct {
// the answer to your question
Answer string `json:"answer"`
// any related image
Image string `json:"image"`
// a related url
Url string `json:"url"`
}

113
service/cache/cache.go vendored Executable file
View File

@@ -0,0 +1,113 @@
package cache
import (
"github.com/m3o/m3o-go/client"
)
func NewCacheService(token string) *CacheService {
return &CacheService{
client: client.NewClient(&client.Options{
Token: token,
}),
}
}
type CacheService struct {
client *client.Client
}
// Decrement a value (if it's a number)
func (t *CacheService) Decrement(request *DecrementRequest) (*DecrementResponse, error) {
rsp := &DecrementResponse{}
return rsp, t.client.Call("cache", "Decrement", request, rsp)
}
// Delete a value from the cache
func (t *CacheService) Delete(request *DeleteRequest) (*DeleteResponse, error) {
rsp := &DeleteResponse{}
return rsp, t.client.Call("cache", "Delete", request, rsp)
}
// Get an item from the cache by key
func (t *CacheService) Get(request *GetRequest) (*GetResponse, error) {
rsp := &GetResponse{}
return rsp, t.client.Call("cache", "Get", request, rsp)
}
// Increment a value (if it's a number)
func (t *CacheService) Increment(request *IncrementRequest) (*IncrementResponse, error) {
rsp := &IncrementResponse{}
return rsp, t.client.Call("cache", "Increment", request, rsp)
}
// Set an item in the cache. Overwrites any existing value already set.
func (t *CacheService) Set(request *SetRequest) (*SetResponse, error) {
rsp := &SetResponse{}
return rsp, t.client.Call("cache", "Set", request, rsp)
}
type DecrementRequest struct {
// The key to decrement
Key string `json:"key"`
// The amount to decrement the value by
Value int64 `json:"value"`
}
type DecrementResponse struct {
// The key decremented
Key string `json:"key"`
// The new value
Value int64 `json:"value"`
}
type DeleteRequest struct {
// The key to delete
Key string `json:"key"`
}
type DeleteResponse struct {
// Returns "ok" if successful
Status string `json:"status"`
}
type GetRequest struct {
// The key to retrieve
Key string `json:"key"`
}
type GetResponse struct {
// The key
Key string `json:"key"`
// Time to live in seconds
Ttl int64 `json:"ttl"`
// The value
Value string `json:"value"`
}
type IncrementRequest struct {
// The key to increment
Key string `json:"key"`
// The amount to increment the value by
Value int64 `json:"value"`
}
type IncrementResponse struct {
// The key incremented
Key string `json:"key"`
// The new value
Value int64 `json:"value"`
}
type SetRequest struct {
// The key to update
Key string `json:"key"`
// Time to live in seconds
Ttl int64 `json:"ttl"`
// The value to set
Value string `json:"value"`
}
type SetResponse struct {
// Returns "ok" if successful
Status string `json:"status"`
}

120
service/crypto/crypto.go Executable file
View File

@@ -0,0 +1,120 @@
package crypto
import (
"github.com/m3o/m3o-go/client"
)
func NewCryptoService(token string) *CryptoService {
return &CryptoService{
client: client.NewClient(&client.Options{
Token: token,
}),
}
}
type CryptoService struct {
client *client.Client
}
// Returns the history for the previous close
func (t *CryptoService) History(request *HistoryRequest) (*HistoryResponse, error) {
rsp := &HistoryResponse{}
return rsp, t.client.Call("crypto", "History", request, rsp)
}
// Get news related to a currency
func (t *CryptoService) News(request *NewsRequest) (*NewsResponse, error) {
rsp := &NewsResponse{}
return rsp, t.client.Call("crypto", "News", request, rsp)
}
// Get the last price for a given crypto ticker
func (t *CryptoService) Price(request *PriceRequest) (*PriceResponse, error) {
rsp := &PriceResponse{}
return rsp, t.client.Call("crypto", "Price", request, rsp)
}
// Get the last quote for a given crypto ticker
func (t *CryptoService) Quote(request *QuoteRequest) (*QuoteResponse, error) {
rsp := &QuoteResponse{}
return rsp, t.client.Call("crypto", "Quote", request, rsp)
}
type Article struct {
// the date published
Date string `json:"date"`
// its description
Description string `json:"description"`
// the source
Source string `json:"source"`
// title of the article
Title string `json:"title"`
// the source url
Url string `json:"url"`
}
type HistoryRequest struct {
// the crypto symbol e.g BTCUSD
Symbol string `json:"symbol"`
}
type HistoryResponse struct {
// the close price
Close float64 `json:"close"`
// the date
Date string `json:"date"`
// the peak price
High float64 `json:"high"`
// the low price
Low float64 `json:"low"`
// the open price
Open float64 `json:"open"`
// the crypto symbol
Symbol string `json:"symbol"`
// the volume
Volume float64 `json:"volume"`
}
type NewsRequest struct {
// cryptocurrency ticker to request news for e.g BTC
Symbol string `json:"symbol"`
}
type NewsResponse struct {
// list of articles
Articles []Article `json:"articles"`
// symbol requested for
Symbol string `json:"symbol"`
}
type PriceRequest struct {
// the crypto symbol e.g BTCUSD
Symbol string `json:"symbol"`
}
type PriceResponse struct {
// the last price
Price float64 `json:"price"`
// the crypto symbol e.g BTCUSD
Symbol string `json:"symbol"`
}
type QuoteRequest struct {
// the crypto symbol e.g BTCUSD
Symbol string `json:"symbol"`
}
type QuoteResponse struct {
// the asking price
AskPrice float64 `json:"askPrice"`
// the ask size
AskSize float64 `json:"askSize"`
// the bidding price
BidPrice float64 `json:"bidPrice"`
// the bid size
BidSize float64 `json:"bidSize"`
// the crypto symbol
Symbol string `json:"symbol"`
// the UTC timestamp of the quote
Timestamp string `json:"timestamp"`
}

103
service/currency/currency.go Executable file
View File

@@ -0,0 +1,103 @@
package currency
import (
"github.com/m3o/m3o-go/client"
)
func NewCurrencyService(token string) *CurrencyService {
return &CurrencyService{
client: client.NewClient(&client.Options{
Token: token,
}),
}
}
type CurrencyService struct {
client *client.Client
}
// Codes returns the supported currency codes for the API
func (t *CurrencyService) Codes(request *CodesRequest) (*CodesResponse, error) {
rsp := &CodesResponse{}
return rsp, t.client.Call("currency", "Codes", request, rsp)
}
// Convert returns the currency conversion rate between two pairs e.g USD/GBP
func (t *CurrencyService) Convert(request *ConvertRequest) (*ConvertResponse, error) {
rsp := &ConvertResponse{}
return rsp, t.client.Call("currency", "Convert", request, rsp)
}
// Returns the historic rates for a currency on a given date
func (t *CurrencyService) History(request *HistoryRequest) (*HistoryResponse, error) {
rsp := &HistoryResponse{}
return rsp, t.client.Call("currency", "History", request, rsp)
}
// Rates returns the currency rates for a given code e.g USD
func (t *CurrencyService) Rates(request *RatesRequest) (*RatesResponse, error) {
rsp := &RatesResponse{}
return rsp, t.client.Call("currency", "Rates", request, rsp)
}
type Code struct {
// e.g United States Dollar
Currency string `json:"currency"`
// e.g USD
Name string `json:"name"`
}
type CodesRequest struct {
}
type CodesResponse struct {
Codes []Code `json:"codes"`
}
type ConvertRequest struct {
// optional amount to convert e.g 10.0
Amount float64 `json:"amount"`
// base code to convert from e.g USD
From string `json:"from"`
// target code to convert to e.g GBP
To string `json:"to"`
}
type ConvertResponse struct {
// converted amount e.g 7.10
Amount float64 `json:"amount"`
// the base code e.g USD
From string `json:"from"`
// conversion rate e.g 0.71
Rate float64 `json:"rate"`
// the target code e.g GBP
To string `json:"to"`
}
type HistoryRequest struct {
// currency code e.g USD
Code string `json:"code"`
// date formatted as YYYY-MM-DD
Date string `json:"date"`
}
type HistoryResponse struct {
// The code of the request
Code string `json:"code"`
// The date requested
Date string `json:"date"`
// The rate for the day as code:rate
Rates map[string]float64 `json:"rates"`
}
type RatesRequest struct {
// The currency code to get rates for e.g USD
Code string `json:"code"`
}
type RatesResponse struct {
// The code requested e.g USD
Code string `json:"code"`
// The rates for the given code as key-value pairs code:rate
Rates map[string]float64 `json:"rates"`
}

117
service/db/db.go Executable file
View File

@@ -0,0 +1,117 @@
package db
import (
"github.com/m3o/m3o-go/client"
)
func NewDbService(token string) *DbService {
return &DbService{
client: client.NewClient(&client.Options{
Token: token,
}),
}
}
type DbService struct {
client *client.Client
}
// Create a record in the database. Optionally include an "id" field otherwise it's set automatically.
func (t *DbService) Create(request *CreateRequest) (*CreateResponse, error) {
rsp := &CreateResponse{}
return rsp, t.client.Call("db", "Create", request, rsp)
}
// Delete a record in the database by id.
func (t *DbService) Delete(request *DeleteRequest) (*DeleteResponse, error) {
rsp := &DeleteResponse{}
return rsp, t.client.Call("db", "Delete", request, rsp)
}
// Read data from a table. Lookup can be by ID or via querying any field in the record.
func (t *DbService) Read(request *ReadRequest) (*ReadResponse, error) {
rsp := &ReadResponse{}
return rsp, t.client.Call("db", "Read", request, rsp)
}
// Truncate the records in a table
func (t *DbService) Truncate(request *TruncateRequest) (*TruncateResponse, error) {
rsp := &TruncateResponse{}
return rsp, t.client.Call("db", "Truncate", request, rsp)
}
// Update a record in the database. Include an "id" in the record to update.
func (t *DbService) Update(request *UpdateRequest) (*UpdateResponse, error) {
rsp := &UpdateResponse{}
return rsp, t.client.Call("db", "Update", request, rsp)
}
type CreateRequest struct {
// JSON encoded record or records (can be array or object)
Record map[string]interface{} `json:"record"`
// Optional table name. Defaults to 'default'
Table string `json:"table"`
}
type CreateResponse struct {
// The id of the record (either specified or automatically created)
Id string `json:"id"`
}
type DeleteRequest struct {
// id of the record
Id string `json:"id"`
// Optional table name. Defaults to 'default'
Table string `json:"table"`
}
type DeleteResponse struct {
}
type ReadRequest struct {
// Read by id. Equivalent to 'id == "your-id"'
Id string `json:"id"`
// Maximum number of records to return. Default limit is 25.
// Maximum limit is 1000. Anything higher will return an error.
Limit int32 `json:"limit"`
Offset int32 `json:"offset"`
// 'asc' (default), 'desc'
Order string `json:"order"`
// field name to order by
OrderBy string `json:"orderBy"`
// Examples: 'age >= 18', 'age >= 18 and verified == true'
// Comparison operators: '==', '!=', '<', '>', '<=', '>='
// Logical operator: 'and'
// Dot access is supported, eg: 'user.age == 11'
// Accessing list elements is not supported yet.
Query string `json:"query"`
// Optional table name. Defaults to 'default'
Table string `json:"table"`
}
type ReadResponse struct {
// JSON encoded records
Records []map[string]interface{} `json:"records"`
}
type TruncateRequest struct {
// Optional table name. Defaults to 'default'
Table string `json:"table"`
}
type TruncateResponse struct {
// The table truncated
Table string `json:"table"`
}
type UpdateRequest struct {
// The id of the record. If not specified it is inferred from the 'id' field of the record
Id string `json:"id"`
// record, JSON object
Record map[string]interface{} `json:"record"`
// Optional table name. Defaults to 'default'
Table string `json:"table"`
}
type UpdateResponse struct {
}

41
service/email/email.go Executable file
View File

@@ -0,0 +1,41 @@
package email
import (
"github.com/m3o/m3o-go/client"
)
func NewEmailService(token string) *EmailService {
return &EmailService{
client: client.NewClient(&client.Options{
Token: token,
}),
}
}
type EmailService struct {
client *client.Client
}
// Send an email by passing in from, to, subject, and a text or html body
func (t *EmailService) Send(request *SendRequest) (*SendResponse, error) {
rsp := &SendResponse{}
return rsp, t.client.Call("email", "Send", request, rsp)
}
type SendRequest struct {
// the display name of the sender
From string `json:"from"`
// the html body
HtmlBody string `json:"htmlBody"`
// an optional reply to email address
ReplyTo string `json:"replyTo"`
// the email subject
Subject string `json:"subject"`
// the text body
TextBody string `json:"textBody"`
// the email address of the recipient
To string `json:"to"`
}
type SendResponse struct {
}

86
service/emoji/emoji.go Executable file
View File

@@ -0,0 +1,86 @@
package emoji
import (
"github.com/m3o/m3o-go/client"
)
func NewEmojiService(token string) *EmojiService {
return &EmojiService{
client: client.NewClient(&client.Options{
Token: token,
}),
}
}
type EmojiService struct {
client *client.Client
}
// Find an emoji by its alias e.g :beer:
func (t *EmojiService) Find(request *FindRequest) (*FindResponse, error) {
rsp := &FindResponse{}
return rsp, t.client.Call("emoji", "Find", request, rsp)
}
// Get the flag for a country. Requires country code e.g GB for great britain
func (t *EmojiService) Flag(request *FlagRequest) (*FlagResponse, error) {
rsp := &FlagResponse{}
return rsp, t.client.Call("emoji", "Flag", request, rsp)
}
// Print text and renders the emojis with aliases e.g
// let's grab a :beer: becomes let's grab a 🍺
func (t *EmojiService) Print(request *PrintRequest) (*PrintResponse, error) {
rsp := &PrintResponse{}
return rsp, t.client.Call("emoji", "Print", request, rsp)
}
// Send an emoji to anyone via SMS. Messages are sent in the form '<message> Sent from <from>'
func (t *EmojiService) Send(request *SendRequest) (*SendResponse, error) {
rsp := &SendResponse{}
return rsp, t.client.Call("emoji", "Send", request, rsp)
}
type FindRequest struct {
// the alias code e.g :beer:
Alias string `json:"alias"`
}
type FindResponse struct {
// the unicode emoji 🍺
Emoji string `json:"emoji"`
}
type FlagRequest struct {
// country code e.g GB
Code string `json:"code"`
}
type FlagResponse struct {
// the emoji flag
Flag string `json:"flag"`
}
type PrintRequest struct {
// text including any alias e.g let's grab a :beer:
Text string `json:"text"`
}
type PrintResponse struct {
// text with rendered emojis
Text string `json:"text"`
}
type SendRequest struct {
// the name of the sender from e.g Alice
From string `json:"from"`
// message to send including emoji aliases
Message string `json:"message"`
// phone number to send to (including international dialing code)
To string `json:"to"`
}
type SendResponse struct {
// whether or not it succeeded
Success bool `json:"success"`
}

107
service/file/file.go Executable file
View File

@@ -0,0 +1,107 @@
package file
import (
"github.com/m3o/m3o-go/client"
)
func NewFileService(token string) *FileService {
return &FileService{
client: client.NewClient(&client.Options{
Token: token,
}),
}
}
type FileService struct {
client *client.Client
}
// Delete a file by project name/path
func (t *FileService) Delete(request *DeleteRequest) (*DeleteResponse, error) {
rsp := &DeleteResponse{}
return rsp, t.client.Call("file", "Delete", request, rsp)
}
// List files by their project and optionally a path.
func (t *FileService) List(request *ListRequest) (*ListResponse, error) {
rsp := &ListResponse{}
return rsp, t.client.Call("file", "List", request, rsp)
}
// Read a file by path
func (t *FileService) Read(request *ReadRequest) (*ReadResponse, error) {
rsp := &ReadResponse{}
return rsp, t.client.Call("file", "Read", request, rsp)
}
// Save a file
func (t *FileService) Save(request *SaveRequest) (*SaveResponse, error) {
rsp := &SaveResponse{}
return rsp, t.client.Call("file", "Save", request, rsp)
}
type BatchSaveRequest struct {
Files []Record `json:"files"`
}
type BatchSaveResponse struct {
}
type DeleteRequest struct {
// Path to the file
Path string `json:"path"`
// The project name
Project string `json:"project"`
}
type DeleteResponse struct {
}
type ListRequest struct {
// Defaults to '/', ie. lists all files in a project.
// Supply path to a folder if you want to list
// files inside that folder
// eg. '/docs'
Path string `json:"path"`
// Project, required for listing.
Project string `json:"project"`
}
type ListResponse struct {
Files []Record `json:"files"`
}
type ReadRequest struct {
// Path to the file
Path string `json:"path"`
// Project name
Project string `json:"project"`
}
type ReadResponse struct {
// Returns the file
File *Record `json:"file"`
}
type Record struct {
// File contents
Content string `json:"content"`
// Time the file was created e.g 2021-05-20T13:37:21Z
Created string `json:"created"`
// Any other associated metadata as a map of key-value pairs
Metadata map[string]string `json:"metadata"`
// Path to file or folder eg. '/documents/text-files/file.txt'.
Path string `json:"path"`
// A custom project to group files
// eg. file-of-mywebsite.com
Project string `json:"project"`
// Time the file was updated e.g 2021-05-20T13:37:21Z
Updated string `json:"updated"`
}
type SaveRequest struct {
File *Record `json:"file"`
}
type SaveResponse struct {
}

85
service/forex/forex.go Executable file
View File

@@ -0,0 +1,85 @@
package forex
import (
"github.com/m3o/m3o-go/client"
)
func NewForexService(token string) *ForexService {
return &ForexService{
client: client.NewClient(&client.Options{
Token: token,
}),
}
}
type ForexService struct {
client *client.Client
}
// Returns the data for the previous close
func (t *ForexService) History(request *HistoryRequest) (*HistoryResponse, error) {
rsp := &HistoryResponse{}
return rsp, t.client.Call("forex", "History", request, rsp)
}
// Get the latest price for a given forex ticker
func (t *ForexService) Price(request *PriceRequest) (*PriceResponse, error) {
rsp := &PriceResponse{}
return rsp, t.client.Call("forex", "Price", request, rsp)
}
// Get the latest quote for the forex
func (t *ForexService) Quote(request *QuoteRequest) (*QuoteResponse, error) {
rsp := &QuoteResponse{}
return rsp, t.client.Call("forex", "Quote", request, rsp)
}
type HistoryRequest struct {
// the forex symbol e.g GBPUSD
Symbol string `json:"symbol"`
}
type HistoryResponse struct {
// the close price
Close float64 `json:"close"`
// the date
Date string `json:"date"`
// the peak price
High float64 `json:"high"`
// the low price
Low float64 `json:"low"`
// the open price
Open float64 `json:"open"`
// the forex symbol
Symbol string `json:"symbol"`
// the volume
Volume float64 `json:"volume"`
}
type PriceRequest struct {
// forex symbol e.g GBPUSD
Symbol string `json:"symbol"`
}
type PriceResponse struct {
// the last price
Price float64 `json:"price"`
// the forex symbol e.g GBPUSD
Symbol string `json:"symbol"`
}
type QuoteRequest struct {
// the forex symbol e.g GBPUSD
Symbol string `json:"symbol"`
}
type QuoteResponse struct {
// the asking price
AskPrice float64 `json:"askPrice"`
// the bidding price
BidPrice float64 `json:"bidPrice"`
// the forex symbol
Symbol string `json:"symbol"`
// the UTC timestamp of the quote
Timestamp string `json:"timestamp"`
}

64
service/geocoding/geocoding.go Executable file
View File

@@ -0,0 +1,64 @@
package geocoding
import (
"github.com/m3o/m3o-go/client"
)
func NewGeocodingService(token string) *GeocodingService {
return &GeocodingService{
client: client.NewClient(&client.Options{
Token: token,
}),
}
}
type GeocodingService struct {
client *client.Client
}
// Lookup returns a geocoded address including normalized address and gps coordinates. All fields are optional, provide more to get more accurate results
func (t *GeocodingService) Lookup(request *LookupRequest) (*LookupResponse, error) {
rsp := &LookupResponse{}
return rsp, t.client.Call("geocoding", "Lookup", request, rsp)
}
// Reverse lookup an address from gps coordinates
func (t *GeocodingService) Reverse(request *ReverseRequest) (*ReverseResponse, error) {
rsp := &ReverseResponse{}
return rsp, t.client.Call("geocoding", "Reverse", request, rsp)
}
type Address struct {
City string `json:"city"`
Country string `json:"country"`
LineOne string `json:"lineOne"`
LineTwo string `json:"lineTwo"`
Postcode string `json:"postcode"`
}
type Location struct {
Latitude float64 `json:"latitude"`
Longitude float64 `json:"longitude"`
}
type LookupRequest struct {
Address string `json:"address"`
City string `json:"city"`
Country string `json:"country"`
Postcode string `json:"postcode"`
}
type LookupResponse struct {
Address *Address `json:"address"`
Location *Location `json:"location"`
}
type ReverseRequest struct {
Latitude float64 `json:"latitude"`
Longitude float64 `json:"longitude"`
}
type ReverseResponse struct {
Address *Address `json:"address"`
Location *Location `json:"location"`
}

View File

@@ -0,0 +1,47 @@
package helloworld
import (
"github.com/m3o/m3o-go/client"
)
func NewHelloworldService(token string) *HelloworldService {
return &HelloworldService{
client: client.NewClient(&client.Options{
Token: token,
}),
}
}
type HelloworldService struct {
client *client.Client
}
// Call returns a personalised "Hello $name" response
func (t *HelloworldService) Call(request *CallRequest) (*CallResponse, error) {
rsp := &CallResponse{}
return rsp, t.client.Call("helloworld", "Call", request, rsp)
}
// Stream returns a stream of "Hello $name" responses
func (t *HelloworldService) Stream(request *StreamRequest) (*StreamResponse, error) {
rsp := &StreamResponse{}
return rsp, t.client.Call("helloworld", "Stream", request, rsp)
}
type CallRequest struct {
Name string `json:"name"`
}
type CallResponse struct {
Message string `json:"message"`
}
type StreamRequest struct {
// the number of messages to send back
Messages int64 `json:"messages"`
Name string `json:"name"`
}
type StreamResponse struct {
Message string `json:"message"`
}

48
service/id/id.go Executable file
View File

@@ -0,0 +1,48 @@
package id
import (
"github.com/m3o/m3o-go/client"
)
func NewIdService(token string) *IdService {
return &IdService{
client: client.NewClient(&client.Options{
Token: token,
}),
}
}
type IdService struct {
client *client.Client
}
// Generate a unique ID. Defaults to uuid.
func (t *IdService) Generate(request *GenerateRequest) (*GenerateResponse, error) {
rsp := &GenerateResponse{}
return rsp, t.client.Call("id", "Generate", request, rsp)
}
// List the types of IDs available. No query params needed.
func (t *IdService) Types(request *TypesRequest) (*TypesResponse, error) {
rsp := &TypesResponse{}
return rsp, t.client.Call("id", "Types", request, rsp)
}
type GenerateRequest struct {
// type of id e.g uuid, shortid, snowflake (64 bit), bigflake (128 bit)
Type string `json:"type"`
}
type GenerateResponse struct {
// the unique id generated
Id string `json:"id"`
// the type of id generated
Type string `json:"type"`
}
type TypesRequest struct {
}
type TypesResponse struct {
Types []string `json:"types"`
}

115
service/image/image.go Executable file
View File

@@ -0,0 +1,115 @@
package image
import (
"github.com/m3o/m3o-go/client"
)
func NewImageService(token string) *ImageService {
return &ImageService{
client: client.NewClient(&client.Options{
Token: token,
}),
}
}
type ImageService struct {
client *client.Client
}
// Convert an image from one format (jpeg, png etc.) to an other either on the fly (from base64 to base64),
// or by uploading the conversion result.
func (t *ImageService) Convert(request *ConvertRequest) (*ConvertResponse, error) {
rsp := &ConvertResponse{}
return rsp, t.client.Call("image", "Convert", request, rsp)
}
// Resize an image on the fly without storing it (by sending and receiving a base64 encoded image), or resize and upload depending on parameters.
// If one of width or height is 0, the image aspect ratio is preserved.
// Optional cropping.
func (t *ImageService) Resize(request *ResizeRequest) (*ResizeResponse, error) {
rsp := &ResizeResponse{}
return rsp, t.client.Call("image", "Resize", request, rsp)
}
// Upload an image by either sending a base64 encoded image to this endpoint or a URL.
// To resize an image before uploading, see the Resize endpoint.
func (t *ImageService) Upload(request *UploadRequest) (*UploadResponse, error) {
rsp := &UploadResponse{}
return rsp, t.client.Call("image", "Upload", request, rsp)
}
type ConvertRequest struct {
// base64 encoded image to resize,
// ie. "data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="
Base64 string `json:"base64"`
// output name of the image including extension, ie. "cat.png"
Name string `json:"name"`
// make output a URL and not a base64 response
OutputUrl bool `json:"outputUrl"`
// url of the image to resize
Url string `json:"url"`
}
type ConvertResponse struct {
Base64 string `json:"base64"`
Url string `json:"url"`
}
type CropOptions struct {
// Crop anchor point: "top", "top left", "top right",
// "left", "center", "right"
// "bottom left", "bottom", "bottom right".
// Optional. Defaults to center.
Anchor string `json:"anchor"`
// height to crop to
Height int32 `json:"height"`
// width to crop to
Width int32 `json:"width"`
}
type Point struct {
X int32 `json:"x"`
Y int32 `json:"y"`
}
type Rectangle struct {
Max *Point `json:"max"`
Min *Point `json:"min"`
}
type ResizeRequest struct {
// base64 encoded image to resize,
// ie. "data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="
Base64 string `json:"base64"`
// optional crop options
// if provided, after resize, the image
// will be cropped
CropOptions *CropOptions `json:"cropOptions"`
Height int64 `json:"height"`
// output name of the image including extension, ie. "cat.png"
Name string `json:"name"`
// make output a URL and not a base64 response
OutputUrl bool `json:"outputUrl"`
// url of the image to resize
Url string `json:"url"`
Width int64 `json:"width"`
}
type ResizeResponse struct {
Base64 string `json:"base64"`
Url string `json:"url"`
}
type UploadRequest struct {
// Base64 encoded image to upload,
// ie. "data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="
Base64 string `json:"base64"`
// Output name of the image including extension, ie. "cat.png"
Name string `json:"name"`
// URL of the image to upload
Url string `json:"url"`
}
type UploadResponse struct {
Url string `json:"url"`
}

47
service/ip/ip.go Executable file
View File

@@ -0,0 +1,47 @@
package ip
import (
"github.com/m3o/m3o-go/client"
)
func NewIpService(token string) *IpService {
return &IpService{
client: client.NewClient(&client.Options{
Token: token,
}),
}
}
type IpService struct {
client *client.Client
}
// Lookup the geolocation information for an IP address
func (t *IpService) Lookup(request *LookupRequest) (*LookupResponse, error) {
rsp := &LookupResponse{}
return rsp, t.client.Call("ip", "Lookup", request, rsp)
}
type LookupRequest struct {
// IP to lookup
Ip string `json:"ip"`
}
type LookupResponse struct {
// Autonomous system number
Asn int32 `json:"asn"`
// Name of the city
City string `json:"city"`
// Name of the continent
Continent string `json:"continent"`
// Name of the country
Country string `json:"country"`
// IP of the query
Ip string `json:"ip"`
// Latitude e.g 52.523219
Latitude float64 `json:"latitude"`
// Longitude e.g 13.428555
Longitude float64 `json:"longitude"`
// Timezone e.g Europe/Rome
Timezone string `json:"timezone"`
}

78
service/location/location.go Executable file
View File

@@ -0,0 +1,78 @@
package location
import (
"github.com/m3o/m3o-go/client"
)
func NewLocationService(token string) *LocationService {
return &LocationService{
client: client.NewClient(&client.Options{
Token: token,
}),
}
}
type LocationService struct {
client *client.Client
}
// Read an entity by its ID
func (t *LocationService) Read(request *ReadRequest) (*ReadResponse, error) {
rsp := &ReadResponse{}
return rsp, t.client.Call("location", "Read", request, rsp)
}
// Save an entity's current position
func (t *LocationService) Save(request *SaveRequest) (*SaveResponse, error) {
rsp := &SaveResponse{}
return rsp, t.client.Call("location", "Save", request, rsp)
}
// Search for entities in a given radius
func (t *LocationService) Search(request *SearchRequest) (*SearchResponse, error) {
rsp := &SearchResponse{}
return rsp, t.client.Call("location", "Search", request, rsp)
}
type Entity struct {
Id string `json:"id"`
Location *Point `json:"location"`
Type string `json:"type"`
}
type Point struct {
Latitude float64 `json:"latitude"`
Longitude float64 `json:"longitude"`
Timestamp int64 `json:"timestamp"`
}
type ReadRequest struct {
// the entity id
Id string `json:"id"`
}
type ReadResponse struct {
Entity *Entity `json:"entity"`
}
type SaveRequest struct {
Entity *Entity `json:"entity"`
}
type SaveResponse struct {
}
type SearchRequest struct {
// Central position to search from
Center *Point `json:"center"`
// Maximum number of entities to return
NumEntities int64 `json:"numEntities"`
// radius in meters
Radius float64 `json:"radius"`
// type of entities to filter
Type string `json:"type"`
}
type SearchResponse struct {
Entities []Entity `json:"entities"`
}

55
service/otp/otp.go Executable file
View File

@@ -0,0 +1,55 @@
package otp
import (
"github.com/m3o/m3o-go/client"
)
func NewOtpService(token string) *OtpService {
return &OtpService{
client: client.NewClient(&client.Options{
Token: token,
}),
}
}
type OtpService struct {
client *client.Client
}
// Generate an OTP (one time pass) code
func (t *OtpService) Generate(request *GenerateRequest) (*GenerateResponse, error) {
rsp := &GenerateResponse{}
return rsp, t.client.Call("otp", "Generate", request, rsp)
}
// Validate the OTP code
func (t *OtpService) Validate(request *ValidateRequest) (*ValidateResponse, error) {
rsp := &ValidateResponse{}
return rsp, t.client.Call("otp", "Validate", request, rsp)
}
type GenerateRequest struct {
// expiration in seconds (default: 60)
Expiry int64 `json:"expiry"`
// unique id, email or user to generate an OTP for
Id string `json:"id"`
// number of characters (default: 6)
Size int64 `json:"size"`
}
type GenerateResponse struct {
// one time pass code
Code string `json:"code"`
}
type ValidateRequest struct {
// one time pass code to validate
Code string `json:"code"`
// unique id, email or user for which the code was generated
Id string `json:"id"`
}
type ValidateResponse struct {
// returns true if the code is valid for the ID
Success bool `json:"success"`
}

87
service/postcode/postcode.go Executable file
View File

@@ -0,0 +1,87 @@
package postcode
import (
"github.com/m3o/m3o-go/client"
)
func NewPostcodeService(token string) *PostcodeService {
return &PostcodeService{
client: client.NewClient(&client.Options{
Token: token,
}),
}
}
type PostcodeService struct {
client *client.Client
}
// Lookup a postcode to retrieve the related region, county, etc
func (t *PostcodeService) Lookup(request *LookupRequest) (*LookupResponse, error) {
rsp := &LookupResponse{}
return rsp, t.client.Call("postcode", "Lookup", request, rsp)
}
// Return a random postcode and its related info
func (t *PostcodeService) Random(request *RandomRequest) (*RandomResponse, error) {
rsp := &RandomResponse{}
return rsp, t.client.Call("postcode", "Random", request, rsp)
}
// Validate a postcode.
func (t *PostcodeService) Validate(request *ValidateRequest) (*ValidateResponse, error) {
rsp := &ValidateResponse{}
return rsp, t.client.Call("postcode", "Validate", request, rsp)
}
type LookupRequest struct {
// UK postcode e.g SW1A 2AA
Postcode string `json:"postcode"`
}
type LookupResponse struct {
// country e.g United Kingdom
Country string `json:"country"`
// e.g Westminster
District string `json:"district"`
// e.g 51.50354
Latitude float64 `json:"latitude"`
// e.g -0.127695
Longitude float64 `json:"longitude"`
// UK postcode e.g SW1A 2AA
Postcode string `json:"postcode"`
// related region e.g London
Region string `json:"region"`
// e.g St James's
Ward string `json:"ward"`
}
type RandomRequest struct {
}
type RandomResponse struct {
// country e.g United Kingdom
Country string `json:"country"`
// e.g Westminster
District string `json:"district"`
// e.g 51.50354
Latitude float64 `json:"latitude"`
// e.g -0.127695
Longitude float64 `json:"longitude"`
// UK postcode e.g SW1A 2AA
Postcode string `json:"postcode"`
// related region e.g London
Region string `json:"region"`
// e.g St James's
Ward string `json:"ward"`
}
type ValidateRequest struct {
// UK postcode e.g SW1A 2AA
Postcode string `json:"postcode"`
}
type ValidateResponse struct {
// Is the postcode valid (true) or not (false)
Valid bool `json:"valid"`
}

129
service/routing/routing.go Executable file
View File

@@ -0,0 +1,129 @@
package routing
import (
"github.com/m3o/m3o-go/client"
)
func NewRoutingService(token string) *RoutingService {
return &RoutingService{
client: client.NewClient(&client.Options{
Token: token,
}),
}
}
type RoutingService struct {
client *client.Client
}
// Turn by turn directions from a start point to an end point including maneuvers and bearings
func (t *RoutingService) Directions(request *DirectionsRequest) (*DirectionsResponse, error) {
rsp := &DirectionsResponse{}
return rsp, t.client.Call("routing", "Directions", request, rsp)
}
// Get the eta for a route from origin to destination. The eta is an estimated time based on car routes
func (t *RoutingService) Eta(request *EtaRequest) (*EtaResponse, error) {
rsp := &EtaResponse{}
return rsp, t.client.Call("routing", "Eta", request, rsp)
}
// Retrieve a route as a simple list of gps points along with total distance and estimated duration
func (t *RoutingService) Route(request *RouteRequest) (*RouteResponse, error) {
rsp := &RouteResponse{}
return rsp, t.client.Call("routing", "Route", request, rsp)
}
type Direction struct {
// distance to travel in meters
Distance float64 `json:"distance"`
// duration to travel in seconds
Duration float64 `json:"duration"`
// human readable instruction
Instruction string `json:"instruction"`
// intersections on route
Intersections []Intersection `json:"intersections"`
// maneuver to take
Maneuver *Maneuver `json:"maneuver"`
// street name or location
Name string `json:"name"`
// alternative reference
Reference string `json:"reference"`
}
type DirectionsRequest struct {
// The destination of the journey
Destination *Point `json:"destination"`
// The staring point for the journey
Origin *Point `json:"origin"`
}
type DirectionsResponse struct {
// Turn by turn directions
Directions []Direction `json:"directions"`
// Estimated distance of the route in meters
Distance float64 `json:"distance"`
// Estimated duration of the route in seconds
Duration float64 `json:"duration"`
// The waypoints on the route
Waypoints []Waypoint `json:"waypoints"`
}
type EtaRequest struct {
// The end point for the eta calculation
Destination *Point `json:"destination"`
// The starting point for the eta calculation
Origin *Point `json:"origin"`
// speed in kilometers
Speed float64 `json:"speed"`
// type of transport. Only "car" is supported currently.
Type string `json:"type"`
}
type EtaResponse struct {
// eta in seconds
Duration float64 `json:"duration"`
}
type Intersection struct {
Bearings []float64 `json:"bearings"`
Location *Point `json:"location"`
}
type Maneuver struct {
Action string `json:"action"`
BearingAfter float64 `json:"bearingAfter"`
BearingBefore float64 `json:"bearingBefore"`
Direction string `json:"direction"`
Location *Point `json:"location"`
}
type Point struct {
// Lat e.g 52.523219
Latitude float64 `json:"latitude"`
// Long e.g 13.428555
Longitude float64 `json:"longitude"`
}
type RouteRequest struct {
// Point of destination for the trip
Destination *Point `json:"destination"`
// Point of origin for the trip
Origin *Point `json:"origin"`
}
type RouteResponse struct {
// estimated distance in meters
Distance float64 `json:"distance"`
// estimated duration in seconds
Duration float64 `json:"duration"`
// waypoints on the route
Waypoints []Waypoint `json:"waypoints"`
}
type Waypoint struct {
// gps point coordinates
Location *Point `json:"location"`
// street name or related reference
Name string `json:"name"`
}

114
service/rss/rss.go Executable file
View File

@@ -0,0 +1,114 @@
package rss
import (
"github.com/m3o/m3o-go/client"
)
func NewRssService(token string) *RssService {
return &RssService{
client: client.NewClient(&client.Options{
Token: token,
}),
}
}
type RssService struct {
client *client.Client
}
// Add a new RSS feed with a name, url, and category
func (t *RssService) Add(request *AddRequest) (*AddResponse, error) {
rsp := &AddResponse{}
return rsp, t.client.Call("rss", "Add", request, rsp)
}
// Get an RSS feed by name. If no name is given, all feeds are returned. Default limit is 25 entries.
func (t *RssService) Feed(request *FeedRequest) (*FeedResponse, error) {
rsp := &FeedResponse{}
return rsp, t.client.Call("rss", "Feed", request, rsp)
}
// List the saved RSS fields
func (t *RssService) List(request *ListRequest) (*ListResponse, error) {
rsp := &ListResponse{}
return rsp, t.client.Call("rss", "List", request, rsp)
}
// Remove an RSS feed by name
func (t *RssService) Remove(request *RemoveRequest) (*RemoveResponse, error) {
rsp := &RemoveResponse{}
return rsp, t.client.Call("rss", "Remove", request, rsp)
}
type AddRequest struct {
// category to add e.g news
Category string `json:"category"`
// rss feed name
// eg. a16z
Name string `json:"name"`
// rss feed url
// eg. http://a16z.com/feed/
Url string `json:"url"`
}
type AddResponse struct {
}
type Entry struct {
// article content
Content string `json:"content"`
// data of the entry
Date string `json:"date"`
// the rss feed where it came from
Feed string `json:"feed"`
// unique id of the entry
Id string `json:"id"`
// rss feed url of the entry
Link string `json:"link"`
// article summary
Summary string `json:"summary"`
// title of the entry
Title string `json:"title"`
}
type Feed struct {
// category of the feed e.g news
Category string `json:"category"`
// unique id
Id string `json:"id"`
// rss feed name
// eg. a16z
Name string `json:"name"`
// rss feed url
// eg. http://a16z.com/feed/
Url string `json:"url"`
}
type FeedRequest struct {
// limit entries returned
Limit int64 `json:"limit"`
// rss feed name
Name string `json:"name"`
// offset entries
Offset int64 `json:"offset"`
}
type FeedResponse struct {
Entries []Entry `json:"entries"`
}
type ListRequest struct {
}
type ListResponse struct {
Feeds []Feed `json:"feeds"`
}
type RemoveRequest struct {
// rss feed name
// eg. a16z
Name string `json:"name"`
}
type RemoveResponse struct {
}

35
service/sentiment/sentiment.go Executable file
View File

@@ -0,0 +1,35 @@
package sentiment
import (
"github.com/m3o/m3o-go/client"
)
func NewSentimentService(token string) *SentimentService {
return &SentimentService{
client: client.NewClient(&client.Options{
Token: token,
}),
}
}
type SentimentService struct {
client *client.Client
}
// Analyze and score a piece of text
func (t *SentimentService) Analyze(request *AnalyzeRequest) (*AnalyzeResponse, error) {
rsp := &AnalyzeResponse{}
return rsp, t.client.Call("sentiment", "Analyze", request, rsp)
}
type AnalyzeRequest struct {
// The language. Defaults to english.
Lang string `json:"lang"`
// The text to analyze
Text string `json:"text"`
}
type AnalyzeResponse struct {
// The score of the text {positive is 1, negative is 0}
Score float64 `json:"score"`
}

39
service/sms/sms.go Executable file
View File

@@ -0,0 +1,39 @@
package sms
import (
"github.com/m3o/m3o-go/client"
)
func NewSmsService(token string) *SmsService {
return &SmsService{
client: client.NewClient(&client.Options{
Token: token,
}),
}
}
type SmsService struct {
client *client.Client
}
// Send an SMS.
func (t *SmsService) Send(request *SendRequest) (*SendResponse, error) {
rsp := &SendResponse{}
return rsp, t.client.Call("sms", "Send", request, rsp)
}
type SendRequest struct {
// who is the message from? The message will be suffixed with "Sent from <from>"
From string `json:"from"`
// the main body of the message to send
Message string `json:"message"`
// the destination phone number including the international dialling code (e.g. +44)
To string `json:"to"`
}
type SendResponse struct {
// any additional info
Info string `json:"info"`
// will return "ok" if successful
Status string `json:"status"`
}

132
service/stock/stock.go Executable file
View File

@@ -0,0 +1,132 @@
package stock
import (
"github.com/m3o/m3o-go/client"
)
func NewStockService(token string) *StockService {
return &StockService{
client: client.NewClient(&client.Options{
Token: token,
}),
}
}
type StockService struct {
client *client.Client
}
// Get the historic open-close for a given day
func (t *StockService) History(request *HistoryRequest) (*HistoryResponse, error) {
rsp := &HistoryResponse{}
return rsp, t.client.Call("stock", "History", request, rsp)
}
// Get the historic order book and each trade by timestamp
func (t *StockService) OrderBook(request *OrderBookRequest) (*OrderBookResponse, error) {
rsp := &OrderBookResponse{}
return rsp, t.client.Call("stock", "OrderBook", request, rsp)
}
// Get the last price for a given stock ticker
func (t *StockService) Price(request *PriceRequest) (*PriceResponse, error) {
rsp := &PriceResponse{}
return rsp, t.client.Call("stock", "Price", request, rsp)
}
// Get the last quote for the stock
func (t *StockService) Quote(request *QuoteRequest) (*QuoteResponse, error) {
rsp := &QuoteResponse{}
return rsp, t.client.Call("stock", "Quote", request, rsp)
}
type HistoryRequest struct {
// date to retrieve as YYYY-MM-DD
Date string `json:"date"`
// the stock symbol e.g AAPL
Stock string `json:"stock"`
}
type HistoryResponse struct {
// the close price
Close float64 `json:"close"`
// the date
Date string `json:"date"`
// the peak price
High float64 `json:"high"`
// the low price
Low float64 `json:"low"`
// the open price
Open float64 `json:"open"`
// the stock symbol
Symbol string `json:"symbol"`
// the volume
Volume int32 `json:"volume"`
}
type Order struct {
// the asking price
AskPrice float64 `json:"askPrice"`
// the ask size
AskSize int32 `json:"askSize"`
// the bidding price
BidPrice float64 `json:"bidPrice"`
// the bid size
BidSize int32 `json:"bidSize"`
// the UTC timestamp of the quote
Timestamp string `json:"timestamp"`
}
type OrderBookRequest struct {
// the date in format YYYY-MM-dd
Date string `json:"date"`
// optional RFC3339Nano end time e.g 2006-01-02T15:04:05.999999999Z07:00
End string `json:"end"`
// limit number of prices
Limit int32 `json:"limit"`
// optional RFC3339Nano start time e.g 2006-01-02T15:04:05.999999999Z07:00
Start string `json:"start"`
// stock to retrieve e.g AAPL
Stock string `json:"stock"`
}
type OrderBookResponse struct {
// date of the request
Date string `json:"date"`
// list of orders
Orders []Order `json:"orders"`
// the stock symbol
Symbol string `json:"symbol"`
}
type PriceRequest struct {
// stock symbol e.g AAPL
Symbol string `json:"symbol"`
}
type PriceResponse struct {
// the last price
Price float64 `json:"price"`
// the stock symbol e.g AAPL
Symbol string `json:"symbol"`
}
type QuoteRequest struct {
// the stock symbol e.g AAPL
Symbol string `json:"symbol"`
}
type QuoteResponse struct {
// the asking price
AskPrice float64 `json:"askPrice"`
// the ask size
AskSize int32 `json:"askSize"`
// the bidding price
BidPrice float64 `json:"bidPrice"`
// the bid size
BidSize int32 `json:"bidSize"`
// the stock symbol
Symbol string `json:"symbol"`
// the UTC timestamp of the quote
Timestamp string `json:"timestamp"`
}

51
service/stream/stream.go Executable file
View File

@@ -0,0 +1,51 @@
package stream
import (
"github.com/m3o/m3o-go/client"
)
func NewStreamService(token string) *StreamService {
return &StreamService{
client: client.NewClient(&client.Options{
Token: token,
}),
}
}
type StreamService struct {
client *client.Client
}
// Publish a message to the stream. Specify a topic to group messages for a specific topic.
func (t *StreamService) Publish(request *PublishRequest) (*PublishResponse, error) {
rsp := &PublishResponse{}
return rsp, t.client.Call("stream", "Publish", request, rsp)
}
// Subscribe to messages for a given topic.
func (t *StreamService) Subscribe(request *SubscribeRequest) (*SubscribeResponse, error) {
rsp := &SubscribeResponse{}
return rsp, t.client.Call("stream", "Subscribe", request, rsp)
}
type PublishRequest struct {
// The json message to publish
Message map[string]interface{} `json:"message"`
// The topic to publish to
Topic string `json:"topic"`
}
type PublishResponse struct {
}
type SubscribeRequest struct {
// The topic to subscribe to
Topic string `json:"topic"`
}
type SubscribeResponse struct {
// The next json message on the topic
Message map[string]interface{} `json:"message"`
// The topic subscribed to
Topic string `json:"topic"`
}

35
service/thumbnail/thumbnail.go Executable file
View File

@@ -0,0 +1,35 @@
package thumbnail
import (
"github.com/m3o/m3o-go/client"
)
func NewThumbnailService(token string) *ThumbnailService {
return &ThumbnailService{
client: client.NewClient(&client.Options{
Token: token,
}),
}
}
type ThumbnailService struct {
client *client.Client
}
// Create a thumbnail screenshot by passing in a url, height and width
func (t *ThumbnailService) Screenshot(request *ScreenshotRequest) (*ScreenshotResponse, error) {
rsp := &ScreenshotResponse{}
return rsp, t.client.Call("thumbnail", "Screenshot", request, rsp)
}
type ScreenshotRequest struct {
// height of the browser window, optional
Height int32 `json:"height"`
Url string `json:"url"`
// width of the browser window. optional
Width int32 `json:"width"`
}
type ScreenshotResponse struct {
ImageUrl string `json:"imageUrl"`
}

73
service/time/time.go Executable file
View File

@@ -0,0 +1,73 @@
package time
import (
"github.com/m3o/m3o-go/client"
)
func NewTimeService(token string) *TimeService {
return &TimeService{
client: client.NewClient(&client.Options{
Token: token,
}),
}
}
type TimeService struct {
client *client.Client
}
// Get the current time
func (t *TimeService) Now(request *NowRequest) (*NowResponse, error) {
rsp := &NowResponse{}
return rsp, t.client.Call("time", "Now", request, rsp)
}
// Get the timezone info for a specific location
func (t *TimeService) Zone(request *ZoneRequest) (*ZoneResponse, error) {
rsp := &ZoneResponse{}
return rsp, t.client.Call("time", "Zone", request, rsp)
}
type NowRequest struct {
// optional location, otherwise returns UTC
Location string `json:"location"`
}
type NowResponse struct {
// the current time as HH:MM:SS
Localtime string `json:"localtime"`
// the location as Europe/London
Location string `json:"location"`
// timestamp as 2006-01-02T15:04:05.999999999Z07:00
Timestamp string `json:"timestamp"`
// the timezone as BST
Timezone string `json:"timezone"`
// the unix timestamp
Unix int64 `json:"unix"`
}
type ZoneRequest struct {
// location to lookup e.g postcode, city, ip address
Location string `json:"location"`
}
type ZoneResponse struct {
// the abbreviated code e.g BST
Abbreviation string `json:"abbreviation"`
// country of the timezone
Country string `json:"country"`
// is daylight savings
Dst bool `json:"dst"`
// e.g 51.42
Latitude float64 `json:"latitude"`
// the local time
Localtime string `json:"localtime"`
// location requested
Location string `json:"location"`
// e.g -0.37
Longitude float64 `json:"longitude"`
// region of timezone
Region string `json:"region"`
// the timezone e.g Europe/London
Timezone string `json:"timezone"`
}

73
service/url/url.go Executable file
View File

@@ -0,0 +1,73 @@
package url
import (
"github.com/m3o/m3o-go/client"
)
func NewUrlService(token string) *UrlService {
return &UrlService{
client: client.NewClient(&client.Options{
Token: token,
}),
}
}
type UrlService struct {
client *client.Client
}
// List information on all the shortened URLs that you have created
func (t *UrlService) List(request *ListRequest) (*ListResponse, error) {
rsp := &ListResponse{}
return rsp, t.client.Call("url", "List", request, rsp)
}
// Proxy returns the destination URL of a short URL.
func (t *UrlService) Proxy(request *ProxyRequest) (*ProxyResponse, error) {
rsp := &ProxyResponse{}
return rsp, t.client.Call("url", "Proxy", request, rsp)
}
// Shortens a destination URL and returns a full short URL.
func (t *UrlService) Shorten(request *ShortenRequest) (*ShortenResponse, error) {
rsp := &ShortenResponse{}
return rsp, t.client.Call("url", "Shorten", request, rsp)
}
type ListRequest struct {
// filter by short URL, optional
ShortUrl string `json:"shortUrl"`
}
type ListResponse struct {
UrlPairs *URLPair `json:"urlPairs"`
}
type ProxyRequest struct {
// short url ID, without the domain, eg. if your short URL is
// `m3o.one/u/someshorturlid` then pass in `someshorturlid`
ShortUrl string `json:"shortUrl"`
}
type ProxyResponse struct {
DestinationUrl string `json:"destinationUrl"`
}
type ShortenRequest struct {
DestinationUrl string `json:"destinationUrl"`
}
type ShortenResponse struct {
ShortUrl string `json:"shortUrl"`
}
type URLPair struct {
Created int64 `json:"created"`
DestinationUrl string `json:"destinationUrl"`
// HitCount keeps track many times the short URL has been resolved.
// Hitcount only gets saved to disk (database) after every 10th hit, so
// its not intended to be 100% accurate, more like an almost correct estimate.
HitCount int64 `json:"hitCount"`
Owner string `json:"owner"`
ShortUrl string `json:"shortUrl"`
}

231
service/user/user.go Executable file
View File

@@ -0,0 +1,231 @@
package user
import (
"github.com/m3o/m3o-go/client"
)
func NewUserService(token string) *UserService {
return &UserService{
client: client.NewClient(&client.Options{
Token: token,
}),
}
}
type UserService struct {
client *client.Client
}
// Create a new user account. The email address and username for the account must be unique.
func (t *UserService) Create(request *CreateRequest) (*CreateResponse, error) {
rsp := &CreateResponse{}
return rsp, t.client.Call("user", "Create", request, rsp)
}
// Delete an account by id
func (t *UserService) Delete(request *DeleteRequest) (*DeleteResponse, error) {
rsp := &DeleteResponse{}
return rsp, t.client.Call("user", "Delete", request, rsp)
}
// Login using username or email. The response will return a new session for successful login,
// 401 in the case of login failure and 500 for any other error
func (t *UserService) Login(request *LoginRequest) (*LoginResponse, error) {
rsp := &LoginResponse{}
return rsp, t.client.Call("user", "Login", request, rsp)
}
// Logout a user account
func (t *UserService) Logout(request *LogoutRequest) (*LogoutResponse, error) {
rsp := &LogoutResponse{}
return rsp, t.client.Call("user", "Logout", request, rsp)
}
// Read an account by id, username or email. Only one need to be specified.
func (t *UserService) Read(request *ReadRequest) (*ReadResponse, error) {
rsp := &ReadResponse{}
return rsp, t.client.Call("user", "Read", request, rsp)
}
// Read a session by the session id. In the event it has expired or is not found and error is returned.
func (t *UserService) ReadSession(request *ReadSessionRequest) (*ReadSessionResponse, error) {
rsp := &ReadSessionResponse{}
return rsp, t.client.Call("user", "ReadSession", request, rsp)
}
// Send a verification email
// to the user being signed up. Email from will be from 'support@m3o.com',
// but you can provide the title and contents.
// The verification link will be injected in to the email as a template variable, $micro_verification_link.
// Example: 'Hi there, welcome onboard! Use the link below to verify your email: $micro_verification_link'
// The variable will be replaced with an actual url that will look similar to this:
// 'https://user.m3o.com/user/verify?token=a-verification-token&rediretUrl=your-redir-url'
func (t *UserService) SendVerificationEmail(request *SendVerificationEmailRequest) (*SendVerificationEmailResponse, error) {
rsp := &SendVerificationEmailResponse{}
return rsp, t.client.Call("user", "SendVerificationEmail", request, rsp)
}
// Update the account password
func (t *UserService) UpdatePassword(request *UpdatePasswordRequest) (*UpdatePasswordResponse, error) {
rsp := &UpdatePasswordResponse{}
return rsp, t.client.Call("user", "UpdatePassword", request, rsp)
}
// Update the account username or email
func (t *UserService) Update(request *UpdateRequest) (*UpdateResponse, error) {
rsp := &UpdateResponse{}
return rsp, t.client.Call("user", "Update", request, rsp)
}
// Verify the email address of an account from a token sent in an email to the user.
func (t *UserService) VerifyEmail(request *VerifyEmailRequest) (*VerifyEmailResponse, error) {
rsp := &VerifyEmailResponse{}
return rsp, t.client.Call("user", "VerifyEmail", request, rsp)
}
type Account struct {
// unix timestamp
Created int64 `json:"created"`
// an email address
Email string `json:"email"`
// unique account id
Id string `json:"id"`
// Store any custom data you want about your users in this fields.
Profile map[string]string `json:"profile"`
// unix timestamp
Updated int64 `json:"updated"`
// alphanumeric username
Username string `json:"username"`
VerificationDate int64 `json:"verificationDate"`
Verified bool `json:"verified"`
}
type CreateRequest struct {
// the email address
Email string `json:"email"`
// optional account id
Id string `json:"id"`
// the user password
Password string `json:"password"`
// optional user profile as map<string,string>
Profile map[string]string `json:"profile"`
// the username
Username string `json:"username"`
}
type CreateResponse struct {
Account *Account `json:"account"`
}
type DeleteRequest struct {
// the account id
Id string `json:"id"`
}
type DeleteResponse struct {
}
type LoginRequest struct {
// The email address of the user
Email string `json:"email"`
// The password of the user
Password string `json:"password"`
// The username of the user
Username string `json:"username"`
}
type LoginResponse struct {
// The session of the logged in user
Session *Session `json:"session"`
}
type LogoutRequest struct {
SessionId string `json:"sessionId"`
}
type LogoutResponse struct {
}
type ReadRequest struct {
// the account email
Email string `json:"email"`
// the account id
Id string `json:"id"`
// the account username
Username string `json:"username"`
}
type ReadResponse struct {
Account *Account `json:"account"`
}
type ReadSessionRequest struct {
// The unique session id
SessionId string `json:"sessionId"`
}
type ReadSessionResponse struct {
Session *Session `json:"session"`
}
type SendVerificationEmailRequest struct {
Email string `json:"email"`
FailureRedirectUrl string `json:"failureRedirectUrl"`
// Display name of the sender for the email. Note: the email address will still be 'support@m3o.com'
FromName string `json:"fromName"`
RedirectUrl string `json:"redirectUrl"`
Subject string `json:"subject"`
// Text content of the email. Don't forget to include the string '$micro_verification_link' which will be replaced by the real verification link
// HTML emails are not available currently.
TextContent string `json:"textContent"`
}
type SendVerificationEmailResponse struct {
}
type Session struct {
// unix timestamp
Created int64 `json:"created"`
// unix timestamp
Expires int64 `json:"expires"`
// the session id
Id string `json:"id"`
// the associated user id
UserId string `json:"userId"`
}
type UpdatePasswordRequest struct {
// confirm new password
ConfirmPassword string `json:"confirmPassword"`
// the new password
NewPassword string `json:"newPassword"`
// the old password
OldPassword string `json:"oldPassword"`
// the account id
UserId string `json:"userId"`
}
type UpdatePasswordResponse struct {
}
type UpdateRequest struct {
// the new email address
Email string `json:"email"`
// the account id
Id string `json:"id"`
// the user profile as map<string,string>
Profile map[string]string `json:"profile"`
// the new username
Username string `json:"username"`
}
type UpdateResponse struct {
}
type VerifyEmailRequest struct {
// The token from the verification email
Token string `json:"token"`
}
type VerifyEmailResponse struct {
}

132
service/weather/weather.go Executable file
View File

@@ -0,0 +1,132 @@
package weather
import (
"github.com/m3o/m3o-go/client"
)
func NewWeatherService(token string) *WeatherService {
return &WeatherService{
client: client.NewClient(&client.Options{
Token: token,
}),
}
}
type WeatherService struct {
client *client.Client
}
// Get the weather forecast for the next 1-10 days
func (t *WeatherService) Forecast(request *ForecastRequest) (*ForecastResponse, error) {
rsp := &ForecastResponse{}
return rsp, t.client.Call("weather", "Forecast", request, rsp)
}
// Get the current weather report for a location by postcode, city, zip code, ip address
func (t *WeatherService) Now(request *NowRequest) (*NowResponse, error) {
rsp := &NowResponse{}
return rsp, t.client.Call("weather", "Now", request, rsp)
}
type Forecast struct {
// the average temp in celsius
AvgTempC float64 `json:"avgTempC"`
// the average temp in fahrenheit
AvgTempF float64 `json:"avgTempF"`
// chance of rain (percentage)
ChanceOfRain int32 `json:"chanceOfRain"`
// forecast condition
Condition string `json:"condition"`
// date of the forecast
Date string `json:"date"`
// the URL of forecast condition icon. Simply prefix with either http or https to use it
IconUrl string `json:"iconUrl"`
// max temp in celsius
MaxTempC float64 `json:"maxTempC"`
// max temp in fahrenheit
MaxTempF float64 `json:"maxTempF"`
// minimum temp in celsius
MinTempC float64 `json:"minTempC"`
// minimum temp in fahrenheit
MinTempF float64 `json:"minTempF"`
// time of sunrise
Sunrise string `json:"sunrise"`
// time of sunset
Sunset string `json:"sunset"`
// will it rain
WillItRain bool `json:"willItRain"`
}
type ForecastRequest struct {
// number of days. default 1, max 10
Days int32 `json:"days"`
// location of the forecase
Location string `json:"location"`
}
type ForecastResponse struct {
// country of the request
Country string `json:"country"`
// forecast for the next number of days
Forecast []Forecast `json:"forecast"`
// e.g 37.55
Latitude float64 `json:"latitude"`
// the local time
LocalTime string `json:"localTime"`
// location of the request
Location string `json:"location"`
// e.g -77.46
Longitude float64 `json:"longitude"`
// region related to the location
Region string `json:"region"`
// timezone of the location
Timezone string `json:"timezone"`
}
type NowRequest struct {
// location to get weather e.g postcode, city
Location string `json:"location"`
}
type NowResponse struct {
// cloud cover percentage
Cloud int32 `json:"cloud"`
// the weather condition
Condition string `json:"condition"`
// country of the request
Country string `json:"country"`
// whether its daytime
Daytime bool `json:"daytime"`
// feels like in celsius
FeelsLikeC float64 `json:"feelsLikeC"`
// feels like in fahrenheit
FeelsLikeF float64 `json:"feelsLikeF"`
// the humidity percentage
Humidity int32 `json:"humidity"`
// the URL of the related icon. Simply prefix with either http or https to use it
IconUrl string `json:"iconUrl"`
// e.g 37.55
Latitude float64 `json:"latitude"`
// the local time
LocalTime string `json:"localTime"`
// location of the request
Location string `json:"location"`
// e.g -77.46
Longitude float64 `json:"longitude"`
// region related to the location
Region string `json:"region"`
// temperature in celsius
TempC float64 `json:"tempC"`
// temperature in fahrenheit
TempF float64 `json:"tempF"`
// timezone of the location
Timezone string `json:"timezone"`
// wind degree
WindDegree int32 `json:"windDegree"`
// wind direction
WindDirection string `json:"windDirection"`
// wind in kph
WindKph float64 `json:"windKph"`
// wind in mph
WindMph float64 `json:"windMph"`
}

View File

@@ -1,28 +0,0 @@
// Package sms provides the ability to send a text message
package sms
import "github.com/m3o/m3o-go/errors"
// NewClient returns an RPC client for the SMS service. It will communicate with the M3O SMS service
func NewClient() Service {
}
// NewMock returns an mock SMS service designed for usage with test
func NewMock() Service {
}
var (
// ErrMissingNumber is returned when a blank number is passed to Send
ErrMissingNumber = errors.BadRequest("Missing Number")
// ErrInvalidNumber is returned when the number passed to Send could not be parsed
ErrInvalidNumber = errors.BadRequest("Invalid Number")
// ErrMissingMessage is returned when a blank message is passed to Send
ErrMissingMessage = errors.BadRequest("Missing Message")
)
// Service is an interface providing SMS
type Service interface {
Send(number, message string) error
}

View File

@@ -1,48 +0,0 @@
// Package file provides a file store
package file
import (
"io"
"time"
)
// NewClient returns an RPC client for the file store. It will communicate with the M3O file
// service.
func NewClient() File {
}
// NewMock returns an in-memory mock for the file store. It is designed for use in tests.
func NewMock() File {
}
// File is an interface providing file storage
type File interface {
Read(key string) (Result, error)
List(ListOptions) ([]Result, error)
Write(key string, value io.Reader, opts WriteOptions) error
Delete(key string) error
}
// ListOptions are used to filter results of the list operation
type ListOptions struct {
// Prefix limits the results to those where the key has the given prefix
Prefix string
}
// WriteOptions are provided when writing a file to the store
type WriteOptions struct {
// Expiry sets the time at which the file should be deleted
Expiry time.Time
// Encoding of the file, e.g. PDF
Encoding string
}
// Result returned from the key value store
type Result struct {
Key string
Value io.Reader
Expiry time.Time
Encoding string
}

View File

@@ -1,50 +0,0 @@
// Package keyvalue provides a key value store
package keyvalue
import (
"errors"
"time"
)
var (
// ErrRecordNotFound is returned when trying to read a record which does not exist
ErrRecordNotFound = errors.New("Record not found")
)
// NewClient returns an RPC client for the KeyValue store. It will communicate with the M3O KeyValue
// service.
func NewClient() Store {
}
// NewMock returns an in-memory mock for the KeyValue store. It is designed for use in tests.
func NewMock() Store {
}
// Store is an interface providing key value storage
type Store interface {
Read(key string) (Record, error)
List(ListOptions) ([]Record, error)
Write(key, value string, opts WriteOptions) error
Delete(key string) error
}
// ListOptions are used to filter results of the list operation
type ListOptions struct {
// Prefix limits the results to those where the key has the given prefix
Prefix string
}
// WriteOptions are provided when writing a file to the store
type WriteOptions struct {
// Expiry sets the time at which the file should be deleted
Expiry time.Time
}
// Record returned from the key value store
type Record struct {
Key string
Value string
Expiry time.Time
}