Documentation
¶
Index ¶
- Variables
- type Client
- func NewMockAndHandler() (Client, *test.MockHandler, *test.Server)
- func NewMockAndHandlerNilResponse() (Client, *test.MockHandler, *test.Server)
- func NewMockAndHandlerWithGithubToken(githubToken string) (Client, *test.MockHandler, *test.Server)
- func NewMockAndHandlerWithZapprToken(zapprToken string) (Client, *test.MockHandler, *test.Server)
- func NewWithGithubToken(zapprURL string, githubToken string, httpClient *http.Client) Client
- func NewWithZapprToken(zapprURL string, zapprToken string, httpClient *http.Client) Client
- type NilResponseTransport
- type RewriteTransport
Constants ¶
This section is empty.
Variables ¶
var ( ErrZapprUnauthorized = errors.New("you do not have permissions to use zappr api") // ErrZapprAlreadyEnabled is used when "Enable" is called for a repo that Zappr is already enabled for ErrZapprAlreadyEnabled = errors.New("zappr already enabled for the repo") // ErrZapprAlreadyNotEnabled is used when "Disable" is called for a repo that Zappr is already NOT enabled for ErrZapprAlreadyNotEnabled = errors.New("zappr is already not enabled for the repo") // ErrZapprServerError is used when we receive a code different than 200 from Zappr ErrZapprServerError = errors.New("unknown error from zappr") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client represents a zappr client
func NewMockAndHandler ¶
func NewMockAndHandler() (Client, *test.MockHandler, *test.Server)
NewMockAndHandler returns a Zappr Client that uses Github Token, Mockhandler, and Server. The client proxies requests to the server and handlers can be registered on the mux to handle requests. The caller must close the test server.
func NewMockAndHandlerNilResponse ¶
func NewMockAndHandlerNilResponse() (Client, *test.MockHandler, *test.Server)
NewMockAndHandlerNilResponse returns a Zappr Client that uses Github Token, Mockhandler, and Server. The internal http client always returns a nil response object.
func NewMockAndHandlerWithGithubToken ¶
NewMockAndHandlerWithGithubToken returns a Zappr Client that uses Github Token, Mockhandler, and Server. The client proxies requests to the server and handlers can be registered on the mux to handle requests. The caller must close the test server.
func NewMockAndHandlerWithZapprToken ¶
NewMockAndHandlerWithZapprToken returns a Zappr Client that uses Zappr Token, Mockhandler, and Server. The client proxies requests to the server and handlers can be registered on the mux to handle requests. The caller must close the test server.
func NewWithGithubToken ¶
NewWithGithubToken creates a new Zappr client that uses Github Token to make calls to Zappr
type NilResponseTransport ¶
type NilResponseTransport struct {
Transport http.RoundTripper
}
NilResponseTransport always returns a nil response object
type RewriteTransport ¶
type RewriteTransport struct {
Transport http.RoundTripper
}
RewriteTransport rewrites https requests to http to avoid TLS cert issues during testing.