Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/cdipaolo/sentiment-server
/ functions
Functions
34 in github.com/cdipaolo/sentiment-server
⨍
Functions
34
◇
Types & classes
7
↓ 12 callers
Function
post
post takes a path and a json to post, performs a POST request, and returns the status, the body, and any errors
sentiment_test.go:101
↓ 6 callers
Function
GetHookResponse
GetHookResponse takes in a TaskJSON and returns the text of the response given by the hook. The text is found by returning the JSON field from the par
handler.go:181
↓ 5 callers
Function
HTTPHandlerWithMethod
HTTPHandlerWithMethod only allows the given method to a handler, else returning an http.StatusMethodNotAllowed status code as well as an error
wrapper.go:12
↓ 2 callers
Function
Post
Post only allows POST requests to a handler
wrapper.go:27
↓ 2 callers
Function
TurnTimeSeriesIntoText
TurnTimeSeriesIntoText compiles all the text values within an []TimeSeries into one string for use with regular analysis
handler.go:280
↓ 1 callers
Function
Get
Get only allows GET requests to a handler
wrapper.go:32
↓ 1 callers
Function
ParseConfig
ParseConfig determines whether the config is at a URL or a file, unmarshals and munges the configuration, and returns any errors.
config.go:143
↓ 1 callers
Function
ParseConfigFromFile
ParseConfigFromFile must be run after the flag.Parse() function has been run to set the global configuration variable
config.go:64
↓ 1 callers
Function
ParseConfigFromURL
ParseConfigFromURL pulls the config from a URL by making a get request This expects that the config path is, in fact, a URL routing to either HTTP or
config.go:107
↓ 1 callers
Function
get
get makes a get request to the server at the specified path
sentiment_test.go:118
↓ 1 callers
Function
main
()
sentiment.go:28
Function
BenchmarkPOSTAnalyze
* Benchmarks * //
sentiment_test.go:526
Function
Delete
Delete only allows DELETE requests to a handler
wrapper.go:42
Function
HandleHookedRequest
HandleHookedRequest is an http.HandlerFunc which will take a POST request with some id string and a hook_id string, post a GET request to the hook num
handler.go:108
Function
HandleSentiment
HandleSentiment takes in a POST with JSON containing a 'text' param. The handler runs sentiment analysis on the text and returns the results.
handler.go:58
Function
HandleStatus
HandleStatus is a simple health-check endpoint that will tell the user the total number of successful analyses and the number of successful hooked req
handler.go:32
Function
Patch
Patch only allows PATCH requests to a handler
wrapper.go:37
Function
Put
Put only allows PUT requests to a handler
wrapper.go:47
Function
TestHookedSentimentShouldFail1
(t *testing.T)
sentiment_test.go:495
Function
TestHookedSentimentShouldFail2
(t *testing.T)
sentiment_test.go:511
Function
TestHookedSentimentShouldPass1
* Hooked Requests * //
sentiment_test.go:265
Function
TestHookedSentimentShouldPass2
(t *testing.T)
sentiment_test.go:307
Function
TestHookedSentimentShouldPass3
test default hook settings
sentiment_test.go:350
Function
TestHookedSentimentShouldPass4
test temporal data handling
sentiment_test.go:393
Function
TestHookedSentimentShouldPass5
(t *testing.T)
sentiment_test.go:444
Function
TestSentimentShouldFail1
(t *testing.T)
sentiment_test.go:230
Function
TestSentimentShouldFail2
(t *testing.T)
sentiment_test.go:248
Function
TestSentimentShouldPass1
* POST /analyze tests * //
sentiment_test.go:164
Function
TestSentimentShouldPass2
use different language but should default to English
sentiment_test.go:197
Function
TestStatusShouldPass1
* GET / tests * //
sentiment_test.go:135
Function
init
()
handler.go:22
Function
init
()
sentiment_test.go:61
Function
init
init grabs the config from the expected command line args. Else initializes with defaults
config.go:54
Function
init
()
sentiment.go:16