Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CloudStorageClientWrapper ¶
type CloudStorageClientWrapper struct {
// contains filtered or unexported fields
}
type Dictionary ¶
type Dictionary struct {
Words []Word `json:"dictionary"`
}
Dictionary is the parent element of json file
type MastodonClient ¶
type MastodonClient struct {
// contains filtered or unexported fields
}
func (*MastodonClient) NewClient ¶
func (mclient *MastodonClient) NewClient()
func (*MastodonClient) Toot ¶
func (mclient *MastodonClient) Toot(wo *Word, w http.ResponseWriter, bucketName string) *ent.AppError
type MastodonCredential ¶
type MastodonCredential struct { MastodonServerName string MastodonClientID string MastodonAccessToken string }
MastodonCredential is a wrapper for consumer and access secrets
type TwitterClient ¶
type TwitterClient struct {
// contains filtered or unexported fields
}
TwitterClient is a wrapper for twitter client implementation
func NewTwitterClient ¶
func NewTwitterClient(credential *TwitterCredential) *TwitterClient
NewTwitterClient returns an authenticated instance of Twitter client
type TwitterCredential ¶
type TwitterCredential struct { ConsumerKey string ConsumerSecret string AccessToken string AccessSecret string }
TwitterCredential is a wrapper for consumer and access secrets
type Word ¶
type Word struct { Index int `json:"index"` Word string `json:"word"` Meaning string `json:"meaning"` Link string `json:"link"` Photo string `json:"photo"` Attribution string `json:"photo_attribution"` }
Word is the wrapper around each word and it's meaning
type WordSelector ¶
type WordSelector struct { }
WordSelector reads, parses, and selects the word-of-the-day
func (*WordSelector) ParseFile ¶
func (ws *WordSelector) ParseFile(f []byte) (*Dictionary, error)
ParseFile unmarshal a json string to the struct type
func (*WordSelector) ReadFile ¶
func (ws *WordSelector) ReadFile() ([]byte, error)
ReadFile reads dictionary json file
func (*WordSelector) SelectWordByDay ¶
func (ws *WordSelector) SelectWordByDay(words []Word) *Word
SelectWordByDay selects a word from the provided array based on the day of the year
func (*WordSelector) SelectWordByIndex ¶
func (ws *WordSelector) SelectWordByIndex(words []Word, index int) *Word
SelectWordByIndex selects a word from the provided array based on the day of the year