diff --git a/Gopkg.lock b/Gopkg.lock index 14f7d9c..316f347 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -18,20 +18,9 @@ version = "v1.0.0" [[projects]] - digest = "1:ac83cf90d08b63ad5f7e020ef480d319ae890c208f8524622a2f3136e2686b02" - name = "github.com/stretchr/objx" - packages = ["."] - pruneopts = "UT" - revision = "477a77ecc69700c7cdeb1fa9e129548e1c1c393c" - version = "v0.1.1" - -[[projects]] - digest = "1:0bcc464dabcfad5393daf87c3f8142911d0f6c52569b837e91a1c15e890265f3" + digest = "1:972c2427413d41a1e06ca4897e8528e5a1622894050e2f527b38ddf0f343f759" name = "github.com/stretchr/testify" - packages = [ - "assert", - "mock", - ] + packages = ["assert"] pruneopts = "UT" revision = "ffdc059bfe9ce6a4e144ba849dbedead332c6053" version = "v1.3.0" @@ -39,9 +28,6 @@ [solve-meta] analyzer-name = "dep" analyzer-version = 1 - input-imports = [ - "github.com/stretchr/testify/assert", - "github.com/stretchr/testify/mock", - ] + input-imports = ["github.com/stretchr/testify/assert"] solver-name = "gps-cdcl" solver-version = 1 diff --git a/README.md b/README.md index cc908f7..ce7f98e 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ To import this package, add the following line to your code: import "gopkg.in/dasrick/go-teams-notify.v1" ``` -And this is an example of a simple implemenatation ... +And this is an example of a simple implementation ... ``` import ( diff --git a/mocks/Client.go b/mocks/Client.go deleted file mode 100644 index 956d081..0000000 --- a/mocks/Client.go +++ /dev/null @@ -1,26 +0,0 @@ -// +build ignore -// Code generated by mockery v1.0.0. DO NOT EDIT. - -package mocks - -import goteamsnotify "go-teams-notify" -import mock "github.com/stretchr/testify/mock" - -// Client is an autogenerated mock type for the Client type -type Client struct { - mock.Mock -} - -// Send provides a mock function with given fields: webhookURL, webhookMessage -func (_m *Client) Send(webhookURL string, webhookMessage goteamsnotify.MessageCard) error { - ret := _m.Called(webhookURL, webhookMessage) - - var r0 error - if rf, ok := ret.Get(0).(func(string, goteamsnotify.MessageCard) error); ok { - r0 = rf(webhookURL, webhookMessage) - } else { - r0 = ret.Error(0) - } - - return r0 -} diff --git a/send.go b/send.go index 8dc34c7..3b81569 100644 --- a/send.go +++ b/send.go @@ -11,8 +11,8 @@ import ( "time" ) -// Client - interface of MS Teams notify -type Client interface { +// API - interface of MS Teams notify +type API interface { Send(webhookURL string, webhookMessage MessageCard) error } @@ -21,7 +21,7 @@ type teamsClient struct { } // NewClient - create a brand new client for MS Teams notify -func NewClient() (Client, error) { +func NewClient() (API, error) { client := teamsClient{ httpClient: &http.Client{ Timeout: 5 * time.Second, diff --git a/send_test.go b/send_test.go index 4a65dc4..370f4a6 100644 --- a/send_test.go +++ b/send_test.go @@ -95,7 +95,7 @@ func (f RoundTripFunc) RoundTrip(req *http.Request) (*http.Response, error) { return f(req) } -//NewTestClient returns *http.Client with Transport replaced to avoid making real calls +//NewTestClient returns *http.API with Transport replaced to avoid making real calls func NewTestClient(fn RoundTripFunc) *http.Client { return &http.Client{ Transport: RoundTripFunc(fn),