twitter

package
v0.0.0-...-2e97daa Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrExceededLimiterLimit = errors.New("exceeded the limit in limiter")

Functions

This section is empty.

Types

type DevelopmentTwitter

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

func NewDevelopmentTwitter

func NewDevelopmentTwitter(logger logging.Logger) *DevelopmentTwitter

func (*DevelopmentTwitter) GetAccountDetails

func (t *DevelopmentTwitter) GetAccountDetails(
	ctx context.Context,
	userAccessToken accounts.TwitterUserAccessToken,
	userAccessSecret accounts.TwitterUserAccessSecret,
) (app.TwitterAccountDetails, error)

func (*DevelopmentTwitter) PostTweet

func (t *DevelopmentTwitter) PostTweet(
	ctx context.Context,
	userAccessToken accounts.TwitterUserAccessToken,
	userAccessSecret accounts.TwitterUserAccessSecret,
	tweet domain.Tweet,
) error

type Limiter

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

func NewLimiter

func NewLimiter() *Limiter

func (*Limiter) Limit

func (l *Limiter) Limit(key string, number int, window time.Duration) error

type Twitter

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

func NewTwitter

func NewTwitter(
	conf config.Config,
	logger logging.Logger,
	metrics app.Metrics,
) *Twitter

func (*Twitter) GetAccountDetails

func (t *Twitter) GetAccountDetails(
	ctx context.Context,
	userAccessToken accounts.TwitterUserAccessToken,
	userAccessSecret accounts.TwitterUserAccessSecret,
) (app.TwitterAccountDetails, error)

func (*Twitter) PostTweet

func (t *Twitter) PostTweet(
	ctx context.Context,
	userAccessToken accounts.TwitterUserAccessToken,
	userAccessSecret accounts.TwitterUserAccessSecret,
	tweet domain.Tweet,
) error

type TwitterError

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

func NewTwitterError

func NewTwitterError(underlying *twitter.ErrorResponse) TwitterError

func (TwitterError) Description

func (t TwitterError) Description() string

func (TwitterError) Error

func (t TwitterError) Error() string

func (TwitterError) Is

func (t TwitterError) Is(target error) bool

func (TwitterError) Unwrap

func (t TwitterError) Unwrap() error

Jump to

Keyboard shortcuts

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