http

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const OAuthServerEndpoint = "https://slack.com/api/oauth.v2.access"

Variables

This section is empty.

Functions

This section is empty.

Types

type CodeExchangeHTTPResponse

type CodeExchangeHTTPResponse struct {
	AccessToken string `json:"access_token"`
	Team        struct {
		Name string `json:"name"`
	} `json:"team"`
	Ok bool `json:"ok"`
}

type Doer

type Doer interface {
	Do(req *http.Request) (*http.Response, error)
}

type DoerMock

type DoerMock struct {
	mock.Mock
}

DoerMock is an autogenerated mock type for the Doer type

func (*DoerMock) Do

func (_m *DoerMock) Do(req *http.Request) (*http.Response, error)

Do provides a mock function with given fields: req

type Exchanger

type Exchanger interface {
	Exchange(string, string, string) (CodeExchangeHTTPResponse, error)
}

type SlackClient

type SlackClient struct {
	// contains filtered or unexported fields
}

func NewSlackClient

func NewSlackClient(doer Doer) *SlackClient

func (*SlackClient) Exchange

func (c *SlackClient) Exchange(code, clientID, clientSecret string) (CodeExchangeHTTPResponse, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL