This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func natsToHTTP(msg jetstream.Msg) *http.Request { | |
hdrs := msg.Headers() | |
request := http.Request{ | |
URL: &url.URL{ | |
Scheme: "queue", | |
Path: hdrs.Get(jetURLPath), | |
}, | |
Method: http.MethodPost, | |
Header: http.Header(hdrs), | |
Body: io.NopCloser(bytes.NewReader(msg.Data())), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bufio" | |
"image" | |
// "errors" | |
"fmt" | |
"os" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
type Number interface { | |
type int, float32 | |
} | |
func sum[T any, V Number](items []T, getvalue func(T) V) V { | |
var acc V |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package resolver | |
import ( | |
"reflect" | |
"strings" | |
"github.com/graphql-go/graphql" | |
"github.com/mitchellh/mapstructure" | |
"gopkg.in/asaskevich/govalidator.v4" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface AuthTokenResponse { | |
token?: string; | |
created?: boolean; | |
user?: UserType; | |
errors?: ValidationError[]; | |
} | |
// tslint:disable:no-multiline-string | |
const LOGIN_MUTATION = gql` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "1.0", | |
"sessionAttributes": { | |
"Counter": 1, | |
"QuizAnswer": "Jefferson City", | |
"QuizItemIndex": 24, | |
"QuizProperty": "Capital", | |
"QuizScore": 0, | |
"State": 1 | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func init() { | |
mutationConfig.AddFieldConfig("sentimentAnalysis", &graphql.Field{ | |
Type: graphql.NewObject(graphql.ObjectConfig{ | |
Name: "SentimentAnalysisResult", | |
Description: "Sentiment Analysis Response", | |
Fields: graphql.Fields{ | |
"score": &graphql.Field{ | |
Type: graphql.Int, | |
}, | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package nresolver | |
import ( | |
"context" | |
"github.com/graphql-go/graphql" | |
"github.com/koblas/projectx/server-go/pkg/contextkey" | |
"github.com/koblas/projectx/server-go/pkg/model" | |
"github.com/koblas/projectx/server-go/pkg/service" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package nresolver | |
import ( | |
"github.com/graphql-go/graphql" | |
) | |
var queryConfig = graphql.NewObject(graphql.ObjectConfig{ | |
Name: "Query", | |
// Must initialize to an empty set | |
Fields: graphql.Fields{}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package nresolver | |
import ( | |
"errors" | |
"github.com/graphql-go/graphql" | |
"github.com/koblas/projectx/server-go/pkg/contextkey" | |
"github.com/koblas/projectx/server-go/pkg/service" | |
) |
NewerOlder