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: 0

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 state

Functions

This section is empty.

Types

type AuditableContent

type AuditableContent struct {
	TimeCreated  time.Time
	TimeModified time.Time
	CreatedBy    string
	ModifiedBy   string
}

This is a type we embed 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
)

Here we define all the possible mood states using an iota enumerator.

func (MoodState) String

func (i MoodState) String() string

type Post

type Post struct {
	AuditableContent // Embedded type
	Caption          string
	MessageBody      string
	URL              string
	ImageURI         string
	ThumbnailURI     string
	Keywords         []string
	Likers           []string
	AuthorMood       MoodState
}

This is the type that represents a Social Media Post

func NewPost

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

This is the function responsible for creating a new social media post.

Jump to

Keyboard shortcuts

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