socialmedia

package
v0.0.0-...-d41341d Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2018 License: BSD-3-Clause Imports: 2 Imported by: 9

Documentation

Overview

Package SocialMedia implements common functionality needed for social media web applications.

Index

Constants

This section is empty.

Variables

View Source
var Moods map[string]MoodState

Map that holds the various mood states with keys to serve as aliases to their respective mood states.

View Source
var MoodsEmoji map[MoodState]string

Functions

This section is empty.

Types

type AuditableContent

type AuditableContent struct {
	TimeCreated  time.Time `json:"timeCreated"`
	TimeModified time.Time `json:"timeModified"`
	CreatedBy    string    `json:"createdBy"`
	ModifiedBy   string    `json:"modifiedBy"`
}

AuditableContent types are meant to be embeded into types we want to keep a check on for auditing purposes

type MoodState

type MoodState int
const (
	MoodStateNeutral MoodState = iota
	MoodStateHappy
	MoodStateSad
	MoodStateAngry
	MoodStateHopeful
	MoodStateThrilled
	MoodStateBored
	MoodStateShy
	MoodStateComical
	MoodStateOnCloudNine
)

All possible mood states.

func (MoodState) String

func (i MoodState) String() string

type Post

type Post struct {
	AuditableContent           // Embedded type
	Caption          string    `json:"caption"`
	MessageBody      string    `json:"messageBody"`
	URL              string    `json:"url"`
	ImageURI         string    `json:"imageURI"`
	ThumbnailURI     string    `json:"thumbnailURI"`
	Keywords         []string  `json:"keywords"`
	Likers           []string  `json:"likers"`
	AuthorMood       MoodState `json:"authorMood"`
	AuthorMoodEmoji  string    `json:authorMoodEmoji"`
}

Post represents a Social Media Post type.

func NewPost

func NewPost(username string, mood MoodState, caption string, messageBody string, url string, imageURI string, thumbnailURI string, keywords []string) *Post

NewPost is responsible for creating an instance of the Post type.

Jump to

Keyboard shortcuts

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