internal

package
v0.0.0-...-be31693 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGraphQLHandler

func NewGraphQLHandler(cnf *Config, dbc *db.Queries, m *metrics.Client) (*handler.Server, error)

Types

type Config

type Config struct {
	Port            int  `envconfig:"PORT" default:"8000"`
	GracefulTimeout int  `envconfig:"GRACEFUL_TIMEOUT" default:"30"`
	DebugMode       bool `envconfig:"DEBUG_MODE" default:"false"`
	/// DB
	DatabaseUser     string `envconfig:"DATABASE_USER" required:"true"`
	DatabasePassword string `envconfig:"DATABASE_PASSWORD" required:"true"`
	DatabaseHost     string `envconfig:"DATABASE_HOST" required:"true"`
	DatabaseName     string `envconfig:"DATABASE_NAME" required:"true"`
	DatabasePort     int    `envconfig:"DATABASE_PORT" default:"5432"`
}

Config is the configuration for the API server.

func NewConfig

func NewConfig() (*Config, error)

func (*Config) DataSource

func (cnf *Config) DataSource() string

type Server

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

func NewServer

func NewServer(port int, gqlHandler handler.Server) *Server

func (*Server) Server

func (s *Server) Server() *echo.Echo

Server is used in test

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

func (*Server) Start

func (s *Server) Start(hasPlayground bool) error

Directories

Path Synopsis
generated
db

Jump to

Keyboard shortcuts

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