twitter

package
v0.0.0-...-47d33f9 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(client *http.Client, bearerToken string) *Client

func (*Client) FetchTweets

func (client *Client) FetchTweets(ctx context.Context, log logger.Interface, ftr FetchTweetsRequest) (FetchTweetsResponse, error)

type FetchTweetsRequest

type FetchTweetsRequest struct {
	MaxResults int
	EntityID   string
	StartTime  time.Time
	EndTime    time.Time
}

func (FetchTweetsRequest) Validate

func (request FetchTweetsRequest) Validate() error

type FetchTweetsResponse

type FetchTweetsResponse []Tweet

type MockTweetsFetcher

type MockTweetsFetcher struct {
	mock.Mock
}

MockTweetsFetcher is an autogenerated mock type for the TweetsFetcher type

func NewMockTweetsFetcher

func NewMockTweetsFetcher(t NewMockTweetsFetcherT) *MockTweetsFetcher

NewMockTweetsFetcher creates a new instance of MockTweetsFetcher. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*MockTweetsFetcher) FetchTweets

FetchTweets provides a mock function with given fields: _a0, _a1, _a2

type NewMockTweetsFetcherT

type NewMockTweetsFetcherT interface {
	mock.TestingT
	Cleanup(func())
}

type Tweet

type Tweet struct {
	ID        string
	Text      string
	CreatedAt time.Time
}

type TweetsFetcher

type TweetsFetcher interface {
	FetchTweets(context.Context, logger.Interface, FetchTweetsRequest) (FetchTweetsResponse, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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