Documentation ¶
Index ¶
- Constants
- func AddQueries(s string, opt interface{}) (string, error)
- func CheckResponse(r *http.Response) error
- func StructToValues(data interface{}) (url.Values, error)
- func TestFormValues(t *testing.T, r *http.Request, values Values)
- func TestHeader(t *testing.T, r *http.Request, header string, want string)
- func TestMethod(t *testing.T, r *http.Request, want string)
- func TestQueryValues(t *testing.T, r *http.Request, values Values)
- type ClientCore
- func (c *ClientCore) Call(ctx context.Context, method string, url string, body interface{}, ...) (*shared.Response, error)
- func (c *ClientCore) Delete(ctx context.Context, url string, v interface{}) (*shared.Response, error)
- func (c *ClientCore) Do(ctx context.Context, req *http.Request, v interface{}) (*shared.Response, error)
- func (c *ClientCore) Get(ctx context.Context, url string, v interface{}) (*shared.Response, error)
- func (c *ClientCore) NewMultipartRequest(urlStr string, values map[string]io.Reader) (*http.Request, error)
- func (c *ClientCore) NewRequest(method, urlStr string, body interface{}) (*http.Request, error)
- func (c *ClientCore) NewUploadRequest(urlStr string, reader io.Reader, size int64, mediaType string) (*http.Request, error)
- func (c *ClientCore) Post(ctx context.Context, url string, body interface{}, v interface{}) (*shared.Response, error)
- func (c *ClientCore) Put(ctx context.Context, url string, body interface{}, v interface{}) (*shared.Response, error)
- type Values
Constants ¶
View Source
const ( DefaultBaseURL = "https://typetalk.com/api/" UserAgent = "go-typetalk/" + version DefaultMediaType = "application/octet-stream" )
Variables ¶
This section is empty.
Functions ¶
func AddQueries ¶
func CheckResponse ¶
func StructToValues ¶
Types ¶
type ClientCore ¶
type ClientCore struct { Client *http.Client BaseURL *url.URL UserAgent string TypetalkToken string }
func (*ClientCore) NewMultipartRequest ¶
func (*ClientCore) NewRequest ¶
func (c *ClientCore) NewRequest(method, urlStr string, body interface{}) (*http.Request, error)
func (*ClientCore) NewUploadRequest ¶
Click to show internal directories.
Click to hide internal directories.