flamingo

package module
v0.0.0-...-da91906 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2016 License: MIT Imports: 12 Imported by: 5

README

Flamingo Cocktail

Gin-Gonic Starter Kit (THIS PROJECT IS CURRENTLY UNDER DEVELOPMENT)

Stack

Documentation

Index

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 Default

func Default() *gin.Engine

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 GraphQLHandlerConfig struct {
	Schema         graphql.Schema
	Pretty         bool
	ContextFactory func(ctx *gin.Context) context.Context
}

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

func (l *Logger) Debug(format string, args ...interface{})

func (*Logger) DebugWithFields

func (l *Logger) DebugWithFields(format string, fields logrus.Fields, args ...interface{})

func (*Logger) Error

func (l *Logger) Error(format string, args ...interface{})

func (*Logger) ErrorWithFields

func (l *Logger) ErrorWithFields(format string, fields logrus.Fields, args ...interface{})

func (*Logger) Info

func (l *Logger) Info(format string, args ...interface{})

func (*Logger) InfoWithFields

func (l *Logger) InfoWithFields(format string, fields logrus.Fields, args ...interface{})

func (*Logger) Panic

func (l *Logger) Panic(format string, args ...interface{})

func (*Logger) PanicWithFields

func (l *Logger) PanicWithFields(format string, fields logrus.Fields, args ...interface{})

func (*Logger) Warn

func (l *Logger) Warn(format string, args ...interface{})

func (*Logger) WarnWithFields

func (l *Logger) WarnWithFields(format string, fields logrus.Fields, args ...interface{})

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

type Selectors

type Selectors map[string]interface{}

Jump to

Keyboard shortcuts

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