endpoint

package
v0.0.0-...-a20aad9 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryCacheSize     = 1000
	PersistedQuerySize = 100

	KeepAlivePingInterval = 5
)
View Source
const (
	// Path where the application is served.
	AppPath = "/"
	// Internal path where the application files are stored.
	AppTargetPath = "./static"

	// Path where the API is served.
	APIPath        = "/graphql"
	PlaygroundPath = "/playground"

	// Title shown in the browser tab for the playground.
	PlaygroundTitle = "ZeeVision Playground"

	ServerReadTimeoutSecs  = 5
	ServerWriteTimeoutSecs = 10
)

Variables

This section is empty.

Functions

func NewAPIServer

func NewAPIServer(conf Config, fetcher *storage.Fetcher) (*http.Server, error)

Create a new API server.

func NewAppServer

func NewAppServer(conf Config) (*http.Server, error)

Create a new application server.

Types

type Config

type Config struct {
	// The port used to host the application.
	AppPort uint16
	// The port used to host the API.
	APIPort uint16
	// This defines if the endpoint should serve also the application
	// files or not.
	DoHostApp bool
	// This defines if the endpoint should serve also the GraphQL
	// playground or not.
	DoHostPlayground bool
	// This defines if the endpoint is running in production mode or
	// not.
	Production bool
	// This defines the allowed origins for CORS.
	AllowedOrigins []string
}

Configuration used to create a new endpoint.

type Endpoint

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

Endpoint represents a server that handles incoming requests.

func New

func New(conf Config, fetcher *storage.Fetcher) (*Endpoint, error)

Create a new endpoint.

func NewFromEnv

func NewFromEnv(fetcher *storage.Fetcher) (*Endpoint, error)

Create a new endpoint from environment variables.

func (*Endpoint) Run

func (e *Endpoint) Run() error

Run the endpoint.

This will block the current goroutine.

Jump to

Keyboard shortcuts

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