storyactions

package
v0.0.0-...-86d9da7 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2025 License: AGPL-3.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountHashTag

func CountHashTag(name string) int

CountHashTag returns the number of hashtag in the string

func CreateCountryMap

func CreateCountryMap() map[string]string

CreateCountryMap creates a map of countries given the country codes

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 HandlePrice

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

HandlePrice updates the pricing field Responds to get /create/price

func HandleSchedule

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

HandleSchedule updates the pricing field based on the selected schedule Responds to get /create/schedule

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

type ByName

type ByName []Country

ByName implements sort.Interface for []Country based on the Name field.

func (ByName) Len

func (a ByName) Len() int

func (ByName) Less

func (a ByName) Less(i, j int) bool

func (ByName) Swap

func (a ByName) Swap(i, j int)

type Country

type Country struct {
	Code string
	Name string
}

Jump to

Keyboard shortcuts

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