server

package
v0.0.0-...-8c39dc6 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2020 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitExecutableSchema

func InitExecutableSchema(
	rootResolver *resolver.Root,
) graphql.ExecutableSchema

func InitGRPCGatewayServeMux

func InitGRPCGatewayServeMux(
	ctx context.Context,
	userServiceServer userv1beta1.UserServiceServer,
) (*runtime.ServeMux, error)

func InitGRPCServer

func InitGRPCServer(
	userServiceServer userv1beta1.UserServiceServer,
	todoServiceServer todov1beta1.TodoServiceServer,
) *grpc.Server

func InitHTTPServeMux

func InitHTTPServeMux(
	c *Config,
	logger *zap.Logger,
	executableSchema graphql.ExecutableSchema,
	dataLoaderMiddleware *middleware.Dataloader,
	grpcGatewayServeMux *runtime.ServeMux,
) *http.ServeMux

func InitHTTPServer

func InitHTTPServer(
	httpServeMux *http.ServeMux,
) *http.Server

func InitLogger

func InitLogger(
	c *Config,
) (*zap.Logger, func(), error)

func InitTodoServiceClient

func InitTodoServiceClient(
	ctx context.Context,
	c *Config,
	logger *zap.Logger,
) (todov1beta1.TodoServiceClient, func(), error)

func InitTodoServiceServer

func InitTodoServiceServer(
	ctx context.Context,
	logger *zap.Logger,
) (todov1beta1.TodoServiceServer, error)

func InitUserServiceClient

func InitUserServiceClient(
	ctx context.Context,
	c *Config,
	logger *zap.Logger,
) (userv1beta1.UserServiceClient, func(), error)

func InitUserServiceServer

func InitUserServiceServer(
	ctx context.Context,
	logger *zap.Logger,
) (userv1beta1.UserServiceServer, error)

Types

type App

type App struct {
	Config     *Config
	HTTPServer *http.Server
	GRPCServer *grpc.Server
	Logger     *zap.Logger
}

func Init

func Init(ctx context.Context, cfg *Config) (*App, func(), error)

func (*App) Run

func (a *App) Run(ctx context.Context) error

type Config

type Config struct {
	HTTPServeMux struct {
		Patterns struct {
			GRPCGateway       string
			GraphQL           string
			GraphQLPlayground string
		}
	}

	HTTPServer struct {
		Port int
	}

	GRPCServer struct {
		Port int
	}

	Logger struct {
		Level       string
		Development bool
	}
}

func (*Config) LoadFile

func (c *Config) LoadFile(configFile string) error

Jump to

Keyboard shortcuts

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