core

package
v0.0.0-...-251a004 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package core create your graphql server

This package has functions to mount the schema and server your application, authenticate, serve static file, etc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterPrivateSchema

func RegisterPrivateSchema(endpoint string, schema Schema, resolver graphql.PrivateResolver, opt ...graphql.SchemaOpt)
RegisterPrivateSchema register your private schema to a resolver in an endpoint

RegisterPrivateSchema only calls RegisterSchema, but you may to use it if you want to garantee that your resolver is a PrivateResolver and you have a closed Schema.

func RegisterSchema

func RegisterSchema(endpoint string, schema Schema, resolver interface{}, opt ...graphql.SchemaOpt)

RegisterSchema register your schema to a resolver in an endpoint

func Server

func Server()

Server is user to run your goals application, User It after registering yours schemas.

Types

type Project

type Project struct {
	AbsPath    string `toml:"abs_path"`
	ImportPath string `toml:"import_path"`
	Name       string
	GoVersion  string `toml:"go_version"`
	AppMode    string `toml:"app_mode"`
	Config     config `toml:"config"`
}

Project model

func (Project) ConfigPath

func (p Project) ConfigPath() string

ConfigPath is the path to package lib

func (Project) LibPath

func (p Project) LibPath() string

LibPath is the path to package lib

func (Project) LoadDotEnv

func (p Project) LoadDotEnv()

func (Project) ModelPath

func (p Project) ModelPath() string

ModelPath is the path to package model

func (Project) ResolverPath

func (p Project) ResolverPath() string

ResolverPath is the path to package resolver

func (Project) ScalarPath

func (p Project) ScalarPath() string

ScalarPath is the path to package scalar

func (Project) SchemaPath

func (p Project) SchemaPath() string

SchemaPath is the path to package schema

type Schema

type Schema struct {
	// contains filtered or unexported fields
}

Schema definition

func MountSchema

func MountSchema(name, types, queries, mutations, subscriptions, scalars string) Schema

MountSchema from params

Jump to

Keyboard shortcuts

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