Documentation ¶
Index ¶
- func ApplyGraphQLCustomComplexityCalculation(config *generated.Config)
- func CreateUserRest(w http.ResponseWriter, r *http.Request, repositories *repository.Container)
- func DefineDirectives(config *generated.Config, repositories *repository.Container)
- func HandleGraphQLServerError(server *handler.Server)
- func NewGraphQLServer(config generated.Config, repositories *repository.Container) *handler.Server
- func SetupGraphQLRoutes(repositories *repository.Container, servePlayground bool, ...)
- type ApiTemplateServer
- type Configuration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyGraphQLCustomComplexityCalculation ¶
ApplyGraphQLCustomComplexityCalculation handles specific query complexity calculation. Complexity values: - Basic field: 1 - Field with extra sql queries: 1 + 3 per additional query - Paginated lists: multiply by number of item requested
func CreateUserRest ¶
func CreateUserRest(w http.ResponseWriter, r *http.Request, repositories *repository.Container)
func DefineDirectives ¶
func DefineDirectives(config *generated.Config, repositories *repository.Container)
DefineDirectives implements Graph directives
func HandleGraphQLServerError ¶
HandleGraphQLServerError defines how graphql errors should be handled and logged.
func NewGraphQLServer ¶
NewGraphQLServer instanciates a new gqlgen server from a config and a logger.
func SetupGraphQLRoutes ¶
func SetupGraphQLRoutes( repositories *repository.Container, servePlayground bool, server *handler.Server, router *mux.Router, )
SetupGraphQLRoutes register HTTP handlers related to GraphQL/gqlgen.
Types ¶
type ApiTemplateServer ¶
ApiTemplateServer is the application entrypoint
func NewApiTemplateServer ¶
func NewApiTemplateServer(configuration *Configuration) *ApiTemplateServer
NewApiTemplateServer create a server instance with a router
func (*ApiTemplateServer) Start ¶
func (server *ApiTemplateServer) Start(ctx context.Context)
Start the server and wait for gracefull shutdown
type Configuration ¶
type Configuration struct { Hostname string Playground bool Port int HealthPort string ShutdownTimeout time.Duration }
Configuration provide options for HTTP server exposure.
func NewConfiguration ¶
func NewConfiguration(v *viper.Viper) (configuration *Configuration, err error)
NewConfiguration is a factory function for creating a Configuration instance using a viper sub tree.
func (*Configuration) Addr ¶
func (configuration *Configuration) Addr() string
Addr is a factory method for generating a server binding address.