svc

package
v0.0.0-...-654c9c4 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SNSClient

type SNSClient struct {
	Client *sns.SNS
}

SNSClient implements SNSType for a generic way of managing the SNS service

func NewSNSClient

func NewSNSClient() *SNSClient

NewSNSClient creates an SNSClient object

func (*SNSClient) Publish

func (c *SNSClient) Publish(message string, topicArn string, feed string) error

Publish sends a message to a given topic and feed

type SNSType

type SNSType interface {
	Publish(string, string, string) error
}

SNSType is an interface for the SNSClient and associated mock

type TweetData

type TweetData struct {
	Text   string                     `json:"text"`
	Params twitter.StatusUpdateParams `json:"params"`
}

TweetData is a simplified struct for working with tweets

type Twitter

type Twitter interface {
	PostTweet(string, *twitter.StatusUpdateParams) error
	GetMentions(*twitter.MentionTimelineParams) ([]twitter.Tweet, error)
}

Twitter is an interface for TwitterClient and its associated mock

type TwitterClient

type TwitterClient struct {
	Client *twitter.Client
}

TwitterClient implements the Twitter interface for working with the Twitter API

func NewTwitterClient

func NewTwitterClient() *TwitterClient

NewTwitterClient creates a TwitterClient from environment variable credentials

func (*TwitterClient) GetMentions

func (t *TwitterClient) GetMentions(params *twitter.MentionTimelineParams) ([]twitter.Tweet, error)

GetMentions queries recent mentions on Twitter

func (*TwitterClient) PostTweet

func (t *TwitterClient) PostTweet(tweet string, params *twitter.StatusUpdateParams) error

PostTweet posts a tweet to Twitter

Jump to

Keyboard shortcuts

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