storyactions

package
v0.0.0-...-a11cca7 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: AGPL-3.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSubscribers

func AddSubscribers(productId int64) error

AddSubscribers adds subscribers to the product

func CountHashTag

func CountHashTag(name string) int

CountHashTag returns the number of hashtag in the string

func CreateSubscriptionPlan

func CreateSubscriptionPlan(productId int64, amount int64, currency string) (string, error)

CreateSubscriptionPlan creates a subscription plan for square

func HandleCreate

func HandleCreate(w http.ResponseWriter, r *http.Request) error

HandleCreate handles the POST of the create form for products

func HandleCreateShow

func HandleCreateShow(w http.ResponseWriter, r *http.Request) error

HandleCreateShow serves the create form via GET for products.

func HandleDestroy

func HandleDestroy(w http.ResponseWriter, r *http.Request) error

HandleDestroy responds to /products/n/destroy by deleting the story.

func HandleDownvote

func HandleDownvote(w http.ResponseWriter, r *http.Request) error

HandleDownvote handles POST to /products/123/downvote

func HandleFileAttachment

func HandleFileAttachment(w http.ResponseWriter, r *http.Request) error

HandleFileAttachment handles file upload for the post from the editor

func HandleFlag

func HandleFlag(w http.ResponseWriter, r *http.Request) error

HandleFlag handles POST to /products/123/flag

func HandleGetSuggestion

func HandleGetSuggestion(w http.ResponseWriter, r *http.Request) error

HandleGetSuggestion handles the suggestion for the editor

func HandleIndex

func HandleIndex(w http.ResponseWriter, r *http.Request) error

HandleIndex repsponds to GET /stories

func HandleListCode

func HandleListCode(w http.ResponseWriter, r *http.Request) error

HandleListCode displays a list of products linking to repos (github etc) responds to GET /products/code

func HandleListUpvoted

func HandleListUpvoted(w http.ResponseWriter, r *http.Request) error

HandleListUpvoted displays a list of products the user has upvoted in the past

func HandleShow

func HandleShow(w http.ResponseWriter, r *http.Request) error

HandleShow displays a single story.

func HandleSiteMap

func HandleSiteMap(w http.ResponseWriter, r *http.Request) error

HandleSiteMap renders a site map of top products

func HandleSubscription

func HandleSubscription(w http.ResponseWriter, r *http.Request) error

HandleSubscription adds subscribers to the product by responding to the POST request

func HandleSubscriptionShow

func HandleSubscriptionShow(w http.ResponseWriter, r *http.Request) error

HandleSubscriptionShow shows the subscriptions page by responding to the GET request

func HandleUnSubscription

func HandleUnSubscription(w http.ResponseWriter, r *http.Request) error

HandleUnSubscription removes subscribers to the product by responding to the POST request

func HandleUpdate

func HandleUpdate(w http.ResponseWriter, r *http.Request) error

HandleUpdate handles the POST of the form to update a story

func HandleUpdateShow

func HandleUpdateShow(w http.ResponseWriter, r *http.Request) error

HandleUpdateShow renders the form to update a story.

func HandleUpvote

func HandleUpvote(w http.ResponseWriter, r *http.Request) error

HandleUpvote handles POST to /products/123/upvote

func ListSubscriptions

func ListSubscriptions(userId int64) ([]*products.Story, error)

ListSubscriptions returns the list of subscriptions for the user

func MetaHashTag

func MetaHashTag(hashtags []string) string

MetaHashTag removes #from hashtag and returns a single string formatted for meta Keywords

func RemoveHashTag

func RemoveHashTag(name string) string

RemoveHashTag removes hashtag from the string and returns the string

func RemoveSubscribers

func RemoveSubscribers(productId int64) error

RemoveSubscribers removes subscribers to the product

func Shareproduct

func Shareproduct(story *products.Story)

Shareproduct shares the product to social media

func TweetStory

func TweetStory(story *products.Story)

TweetStory tweets the given story

func TweetTopStory

func TweetTopStory()

TweetTopStory tweets the top story

Types

This section is empty.

Jump to

Keyboard shortcuts

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