Documentation ¶
Index ¶
- Constants
- func Default() *gin.Engine
- func NewGraphIQLHandler() gin.HandlerFunc
- func NewGraphQLHandler(config GraphQLHandlerConfig) gin.HandlerFunc
- type AppContext
- type DbClientFactory
- type GraphQLHandlerConfig
- type HttpClientFactory
- type Logger
- func (l *Logger) Debug(format string, args ...interface{})
- func (l *Logger) DebugWithFields(format string, fields logrus.Fields, args ...interface{})
- func (l *Logger) Error(format string, args ...interface{})
- func (l *Logger) ErrorWithFields(format string, fields logrus.Fields, args ...interface{})
- func (l *Logger) Info(format string, args ...interface{})
- func (l *Logger) InfoWithFields(format string, fields logrus.Fields, args ...interface{})
- func (l *Logger) Panic(format string, args ...interface{})
- func (l *Logger) PanicWithFields(format string, fields logrus.Fields, args ...interface{})
- func (l *Logger) Warn(format string, args ...interface{})
- func (l *Logger) WarnWithFields(format string, fields logrus.Fields, args ...interface{})
- type LoggerFactory
- type MongoClient
- type MongoCollection
- func (ms *MongoCollection) FindById(id interface{}) *MongoQuery
- func (ms *MongoCollection) Insert(entity interface{}) error
- func (ms *MongoCollection) Query(selectors Selectors) *MongoQuery
- func (ms *MongoCollection) Remove(selectors Selectors) error
- func (ms *MongoCollection) RemoveById(id interface{}) error
- func (ms *MongoCollection) Update(entity interface{}) error
- type MongoQuery
- type MongoSession
- type RequestOptions
- type Selectors
Constants ¶
View Source
const ( ContentTypeJSON = "application/json" ContentTypeGraphQL = "application/graphql" ContentTypeFormURLEncoded = "application/x-www-form-urlencoded" )
View Source
const GraphIQLHTML = `` /* 5190-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func NewGraphIQLHandler ¶
func NewGraphIQLHandler() gin.HandlerFunc
func NewGraphQLHandler ¶
func NewGraphQLHandler(config GraphQLHandlerConfig) gin.HandlerFunc
Types ¶
type AppContext ¶
type AppContext struct {
// contains filtered or unexported fields
}
func NewAppContext ¶
func NewAppContext(ctx *gin.Context) *AppContext
type DbClientFactory ¶
type DbClientFactory struct { MongoClient MongoClient // contains filtered or unexported fields }
func NewDbClientFactory ¶
func NewDbClientFactory(loggerFactory *LoggerFactory) *DbClientFactory
type GraphQLHandlerConfig ¶
type HttpClientFactory ¶
type HttpClientFactory struct {
// contains filtered or unexported fields
}
func NewHttpClientFactory ¶
func NewHttpClientFactory(loggerFactory *LoggerFactory) *HttpClientFactory
type Logger ¶
type Logger struct { Name string // contains filtered or unexported fields }
func (*Logger) DebugWithFields ¶
func (*Logger) ErrorWithFields ¶
func (*Logger) InfoWithFields ¶
func (*Logger) PanicWithFields ¶
type LoggerFactory ¶
type LoggerFactory struct {
// contains filtered or unexported fields
}
func NewLoggerFactory ¶
func NewLoggerFactory() *LoggerFactory
func NewLoggerFactoryWithFields ¶
func NewLoggerFactoryWithFields(fields map[string]interface{}) *LoggerFactory
func (*LoggerFactory) GetFields ¶
func (l *LoggerFactory) GetFields() map[string]interface{}
func (*LoggerFactory) NewLogger ¶
func (l *LoggerFactory) NewLogger(name string) Logger
type MongoClient ¶
type MongoClient struct {
// contains filtered or unexported fields
}
func NewMongoClient ¶
func NewMongoClient(uri string, loggerFactory *LoggerFactory) MongoClient
func (*MongoClient) OpenSession ¶
func (m *MongoClient) OpenSession() (MongoSession, error)
type MongoCollection ¶
type MongoCollection struct { }
*****************************************
Mongo Collection *****************************************
func (*MongoCollection) FindById ¶
func (ms *MongoCollection) FindById(id interface{}) *MongoQuery
func (*MongoCollection) Insert ¶
func (ms *MongoCollection) Insert(entity interface{}) error
func (*MongoCollection) Query ¶
func (ms *MongoCollection) Query(selectors Selectors) *MongoQuery
func (*MongoCollection) Remove ¶
func (ms *MongoCollection) Remove(selectors Selectors) error
func (*MongoCollection) RemoveById ¶
func (ms *MongoCollection) RemoveById(id interface{}) error
func (*MongoCollection) Update ¶
func (ms *MongoCollection) Update(entity interface{}) error
type MongoQuery ¶
type MongoQuery struct { }
func (*MongoQuery) All ¶
func (ms *MongoQuery) All(result interface{}) error
func (*MongoQuery) One ¶
func (ms *MongoQuery) One(result interface{}) error
type MongoSession ¶
type MongoSession struct { }
func (*MongoSession) Close ¶
func (ms *MongoSession) Close() error
func (*MongoSession) Collection ¶
func (ms *MongoSession) Collection(name string) *MongoCollection
func (*MongoSession) Db ¶
func (ms *MongoSession) Db(name string) *MongoSession
type RequestOptions ¶
type RequestOptions struct { Query string `json:"query" url:"query" schema:"query"` Variables map[string]interface{} `json:"variables" url:"variables" schema:"variables"` OperationName string `json:"operationName" url:"operationName" schema:"operationName"` }
func NewRequestOptions ¶
func NewRequestOptions(r *http.Request) *RequestOptions
Source Files ¶
Click to show internal directories.
Click to hide internal directories.