Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/abishekmuthian/open-payment-host
/ functions
Functions
1,100 in github.com/abishekmuthian/open-payment-host
⨍
Functions
1,100
◇
Types & classes
194
↓ 3 callers
Method
GetInt
GetInt returns the current configuration value as int64, or 0 if no value
src/lib/server/config/config.go:90
↓ 3 callers
Method
Insert
Insert a record, returning id
src/lib/query/adapters/database.go:23
↓ 3 callers
Function
List
List returns an error if this action is not authorised for this user
src/lib/auth/can/can.go:77
↓ 3 callers
Method
MessagesSendTemplate
MessagesSendTemplate sends a message using a Mandrill template
src/lib/mandrill/mandrill.go:262
↓ 3 callers
Method
Methods
(...string)
src/lib/mux/mux.go:36
↓ 3 callers
Function
NewWithColumns
NewWithColumns creates a new user instance and fills it with data from the database cols provided.
src/users/query.go:32
↓ 3 callers
Function
NewWithColumns
NewWithColumns creates a new story instance and fills it with data from the database cols provided.
src/products/query.go:34
↓ 3 callers
Method
PortString
PortString returns a string port suitable for passing to http.Server
src/lib/server/server.go:261
↓ 3 callers
Method
Production
()
src/lib/server/schedule/context.go:11
↓ 3 callers
Method
Put
()
src/lib/mux/mux.go:34
↓ 3 callers
Method
SQLDB
()
src/lib/query/adapters/database.go:16
↓ 3 callers
Method
Script
Script returns true if this file is a js file
src/lib/assets/file.go:47
↓ 3 callers
Function
ScriptLink
ScriptLink returns an html tag for a given file path
src/lib/assets/helpers.go:73
↓ 3 callers
Method
Start
Start starts an http server on the given port
src/lib/server/server.go:278
↓ 3 callers
Method
String
String returns a string formatting for the request id.
src/lib/server/log/middleware.go:18
↓ 3 callers
Function
StyleLink
StyleLink returns an html tag for a given file path
src/lib/assets/helpers.go:65
↓ 3 callers
Method
UpdateAll
UpdateAll updates all models specified in this relation
src/lib/query/query.go:213
↓ 3 callers
Function
ValidateNestedMap
ValidateNestedMap returns the nested map value of the JSON string
src/lib/resource/validate.go:152
↓ 3 callers
Function
addStoryVote
addStoryVote adjusts the story points, and adds a vote record for this user
src/products/actions/vote.go:179
↓ 3 callers
Function
adjustUserPoints
removeUserPoints removes these points from this user
src/products/actions/vote.go:205
↓ 3 callers
Function
bytesHash
bytesHash returns the sha hash of some bytes
src/lib/assets/assets.go:242
↓ 3 callers
Function
clearSession
clearSession clears the request session cookie entirely. If an error is encountered in processing params, the session is cleared.
src/lib/session/session.go:58
↓ 3 callers
Function
dotFile
PATH UTILITIES dotFile returns true if the file path supplied a dot file?
src/lib/view/parser/scanner.go:194
↓ 3 callers
Method
generateHash
Utility method to generate a hash from string
src/lib/view/parser/template.go:169
↓ 3 callers
Function
getUserIP
(r *http.Request)
src/products/actions/vote.go:271
↓ 3 callers
Method
performExec
performExec executes Query SQL on the given sqlDB with no rows returned, just result
src/lib/query/adapters/database.go:128
↓ 3 callers
Method
performQuery
performQuery executes Query SQL on the given sqlDB and return the rows. NB caller must call use defer rows.Close() with rows returned
src/lib/query/adapters/database.go:99
↓ 3 callers
Function
productsXMLPath
storiesXMLPath returns the xml path for a given request to a stories link
src/products/actions/index.go:127
↓ 3 callers
Method
setDefaultTemplates
Set sensible default layout/template paths after we know our path pages => pages/views/index.html.got pages/create => pages/views/create.html.got page
src/lib/view/render.go:330
↓ 3 callers
Function
sortedParamKeys
Sorts the param names given - map iteration order is explicitly random in Go but we need params in a defined order to avoid unexpected results.
src/lib/query/query.go:741
↓ 3 callers
Function
suffixes
suffixes returns true if the path has these suffixes (ignoring dotfiles)?
src/lib/view/parser/scanner.go:207
↓ 3 callers
Function
updateproductsRank
updateproductsRank updates the rank of all products with a rank based on their point score / time elapsed (as represented by id) to the power of gra
src/products/actions/vote.go:297
↓ 3 callers
Function
valuesFromParams
Generate a set of values for the params in order
src/lib/query/query.go:754
↓ 2 callers
Method
AddRecipient
AddRecipient appends a recipient to the message easier than message.To = []*To{&To{email, name}}
src/lib/mandrill/mandrill.go:332
↓ 2 callers
Function
AddSubscribers
AddSubscribers adds subscribers to the product
src/subscriptions/stripe.go:146
↓ 2 callers
Function
AllowedParamsAdmin
AllowedParamsAdmin returns the cols editable by admins
src/products/query.go:29
↓ 2 callers
Method
CanonicalURL
CanonicalURL is the canonical URL of the story on this site including a slug for seo
src/products/story.go:137
↓ 2 callers
Function
CloseDatabase
CloseDatabase closes the database opened by OpenDatabase
src/lib/query/database.go:122
↓ 2 callers
Method
Code
Code returns true if this is a link to a git repository At present we only check for github urls, we should at least check for bitbucket
src/products/story.go:157
↓ 2 callers
Method
CompleteURL
CompleteURL returns combination of protocol, root url and destination url
src/products/story.go:113
↓ 2 callers
Method
Configuration
Configuration returns all the configuration key/values for a given mode.
src/lib/server/config/config.go:77
↓ 2 callers
Method
ConfiguredTLSServer
ConfiguredTLSServer returns a TLS server instance with a secure config this server has read/write timeouts set to 20 seconds, prefers server cipher su
src/lib/server/server.go:392
↓ 2 callers
Function
ConvertLinks
ConvertLinks returns the text with various transformations applied - bare links are turned into anchor tags, and @refs are turned into user links. thi
src/lib/text/text.go:56
↓ 2 callers
Function
ConvertMapToVariablesForRecipient
ConvertMapToVariablesForRecipient converts a regular string/string map into the RcptMergeVars struct
src/lib/mandrill/mandrill.go:368
↓ 2 callers
Function
ConvertNewlines
ConvertNewlines converts \n to paragraph tags if the text already contains paragraph tags, return unaltered
src/lib/text/text.go:39
↓ 2 callers
Function
CountHashTag
CountHashTag returns the number of hashtag in the string
src/products/actions/create.go:463
↓ 2 callers
Method
Create
Create a model object, called from actions.
src/lib/query/query_test.go:35
↓ 2 callers
Function
CreateMAC
CreateMAC creates a MAC.
src/lib/auth/encode.go:42
↓ 2 callers
Function
CreateSubscriptionPlan
CreateSubscriptionPlan creates a subscription plan for square
src/products/actions/create.go:472
↓ 2 callers
Method
CreateURL
CreateURL returns the create url for this model /table/create
src/lib/resource/urls.go:13
↓ 2 callers
Method
DebugString
DebugString returns a query representation string useful for debugging
src/lib/query/query.go:673
↓ 2 callers
Function
DefaultHelpers
DefaultHelpers returns a default set of helpers for the app, which can then be extended/replaced. Helper functions may not be changed after LoadTempla
src/lib/view/view.go:38
↓ 2 callers
Method
DestinationURL
DestinationURL returns the URL of the story if no url is set, it uses the CanonicalURL
src/products/story.go:99
↓ 2 callers
Method
DestroyURL
DestroyURL returns the destroy url for this model /table/id/destroy
src/lib/resource/urls.go:23
↓ 2 callers
Function
Encrypt
Encrypt encrypts data using 256-bit AES-GCM. This both hides the content of the data and provides a check that it hasn't been altered. Output takes t
src/lib/auth/encrypt.go:30
↓ 2 callers
Function
EscapeURL
EscapeURL escapes URLs using HTMLEscapeString
src/lib/view/helpers/html.go:28
↓ 2 callers
Method
FetchOrCreateGroup
FetchOrCreateGroup returns the named group if it exists, or creates it if not
src/lib/assets/assets.go:57
↓ 2 callers
Function
FindFirst
FindFirst fetches a single user record from the database using a where query with the format and args provided.
src/users/query.go:61
↓ 2 callers
Function
Get
Get returns the translation for a given language and key if no result, it falls back to DefaultLanguage + key
src/lib/view/translation/translation.go:73
↓ 2 callers
Method
GetBool
GetBool returns the current configuration value as bool (yes=true, no=false), or false if no value
src/lib/server/config/config.go:103
↓ 2 callers
Function
GetPaypalSubscriptionTransaction
GetPaypalSubscriptionTransaction fetches the paypal transaction details given the transaction id and access token
src/subscriptions/paypal.go:523
↓ 2 callers
Method
Group
Group returns the named group if it exists or an empty group if not
src/lib/assets/assets.go:47
↓ 2 callers
Function
HandleCreateShow
HandleCreateShow serves the create form via GET for products.
src/products/actions/create.go:32
↓ 2 callers
Function
HandleDestroy
HandleDestroy responds to /users/n/destroy by deleting the user.
src/users/actions/destroy.go:15
↓ 2 callers
Function
HandleDestroy
HandleDestroy responds to /products/n/destroy by deleting the story.
src/products/actions/destroy.go:15
↓ 2 callers
Function
HandleLoginShow
HandleLoginShow shows the page at /users/login
src/users/actions/login.go:25
↓ 2 callers
Function
HandleLogout
HandleLogout clears the current user's session /users/logout
src/users/actions/logout.go:13
↓ 2 callers
Function
HandleUpdateShow
HandleUpdateShow renders the form to update a story.
src/products/actions/update.go:44
↓ 2 callers
Method
InsertJoins
InsertJoins using an array of ids (more general version of above) This inserts joins for every possible relation between the ids
src/lib/query/query.go:110
↓ 2 callers
Function
LoadTemplates
LoadTemplates loads our templates from ./src, and assigns them to the package variable Templates This function is deprecated and will be removed, use
src/lib/view/view.go:31
↓ 2 callers
Method
Logf
Logf logs the message with the given arguments to our internal logger
src/lib/server/deprecated.go:21
↓ 2 callers
Method
MatchMethod
MatchMethod returns true if our list of methods contains method
src/lib/mux/route.go:62
↓ 2 callers
Method
Mode
Deprecated - this config parsing (mostly internal to the server anyway) has been moved to a new file and will be removed in 2.0 Instead of passing con
src/lib/server/deprecated.go:59
↓ 2 callers
Method
NameDisplay
NameDisplay returns a title string without hashtags (assumed to be at the end), by truncating the title at the first #
src/products/story.go:207
↓ 2 callers
Function
New
New returns a new email with the default tenplates and the given recipient.
src/lib/mail/email.go:18
↓ 2 callers
Function
New
New returns a new sendgrid Service.
src/lib/mail/adapters/sendgrid/sendgrid.go:19
↓ 2 callers
Function
NewFile
NewFile creates a new file logger for the given path at Level Info.
src/lib/server/log/file.go:23
↓ 2 callers
Function
Options
Options returns an array of statuses for a status select.
src/lib/status/status.go:28
↓ 2 callers
Function
PagesNewWithColumns
NewWithColumns creates a new page instance and fills it with data from the database cols provided
src/lib/query/query_test.go:53
↓ 2 callers
Method
Placeholder
A format string for the arg placeholder
src/lib/query/adapters/database.go:29
↓ 2 callers
Method
PrimaryKey
PrimaryKey returns the id for primary key by default - used by query
src/lib/resource/resource.go:43
↓ 2 callers
Method
PrimaryURL
PrimaryURL returns the URL to use for this story in lists Videos and Show Ask products link to the story for other links for now it is the destination
src/products/story.go:126
↓ 2 callers
Method
Query
Query creates a new query relation referencing this specific resource by id.
src/lib/resource/query.go:10
↓ 2 callers
Function
ReloadTemplates
ReloadTemplates reloads the templates for our scanner
src/lib/view/view.go:141
↓ 2 callers
Function
RemoveHashTag
RemoveHashTag removes hashtag from the string and returns the string
src/products/actions/create.go:454
↓ 2 callers
Function
RenderTemplate
RenderTemplate renders the email into its template with context.
src/lib/mail/mail.go:52
↓ 2 callers
Function
ResizeImage
ResizeImage resizes the given image IF it is larger than maxWidth or maxHeight
src/lib/model/file/image.go:113
↓ 2 callers
Method
Rows
Rows executes the query against the database, and return the sql rows result for this query (Executes SQL)
src/lib/query/query.go:314
↓ 2 callers
Function
SanitizeName
SanitizeName makes a string safe to use in a file name by first finding the path basename, then replacing non-ascii characters.
src/lib/model/file/sanitize.go:14
↓ 2 callers
Method
ScanPaths
ScanPaths resets template list and rescans all template paths
src/lib/view/parser/scanner.go:152
↓ 2 callers
Method
ScriptName
ScriptName returns a fingerprinted group name for scripts
src/lib/assets/group.go:186
↓ 2 callers
Method
SelectName
()
src/lib/view/helpers/forms.go:98
↓ 2 callers
Method
Send
(email *Email)
src/lib/mail/mail.go:19
↓ 2 callers
Method
Setup
Setup is called once on setup of a parser
src/lib/view/parser/parser.go:10
↓ 2 callers
Function
SetupAuthorisation
SetupAuthorisation sets up mock authorisation.
src/lib/resource/testing.go:35
↓ 2 callers
Function
SetupView
SetupView sets up the view package for testing by loading templates.
src/lib/resource/testing.go:101
↓ 2 callers
Function
Show
Show returns an error if this action is not authorised for this user
src/lib/auth/can/can.go:82
↓ 2 callers
Method
Source
Source the parsed version of this template
src/lib/view/parser/template.go:113
↓ 2 callers
Method
StatusOptions
StatusOptions returns an array of statuses for a status select for this resource.
src/lib/status/status.go:46
↓ 2 callers
Method
String
String returns the route formatted as a string
src/lib/mux/route.go:133
← previous
next →
201–300 of 1,100, ranked by callers