httpclient

package
v0.0.0-...-17e3d52 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Endpoints = make(twitterEndpoints)

Endpoints is a map of twitter endpoints used to manage rules and streams.

Functions

func NewHttpClientMock

func NewHttpClientMock(token string) *mockHttpClient

Types

type IHttpClient

type IHttpClient interface {
	NewHttpRequest(opts *RequestOpts) (*http.Response, error)
	GetRules() (*http.Response, error)
	GetSearchStream(queryParams *url.Values) (*http.Response, error)
	AddRules(queryParams *url.Values, body string) (*http.Response, error)
	GenerateUrl(name string, queryParams *url.Values) (string, error)
}

IHttpClient is the interface the httpClient struct implements.

func NewHttpClient

func NewHttpClient(token string) IHttpClient

NewHttpClient constructs a an HttpClient to interact with twitter.

type RequestOpts

type RequestOpts struct {
	Retries uint8
	Method  string
	Url     string
	Body    string
	Headers []struct {
		Key   string
		Value string
	}
}

Jump to

Keyboard shortcuts

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