node

package
v0.179.1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 38 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildInfo

type BuildInfo struct {
	Version, Commit, Date, BuiltBy string
}

type GitHubAuthDemo

type GitHubAuthDemo struct {
	ClientID     string
	ClientSecret string
}

type HealthCheckReport added in v0.115.1

type HealthCheckReport struct {
	ServerStatus string    `json:"serverStatus"`
	NodeStatus   string    `json:"nodeStatus"`
	BuildInfo    BuildInfo `json:"buildInfo"`
	DeploymentId string    `json:"deploymentId"`
	CommitSHA    string    `json:"CommitSHA"`
	CommitURL    string    `json:"CommitURL"`
}

type Node

type Node struct {
	WundergraphDir string
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, info BuildInfo, wundergraphDir string, log *zap.Logger) *Node

func (*Node) Close added in v0.90.24

func (n *Node) Close() error

Close closes the node and all its dependencies. It is doing that without waiting for the node to shutdown properly.

func (*Node) GetHealthReport added in v0.115.1

func (n *Node) GetHealthReport(ctx context.Context, hooksClient *hooks.Client) (*HealthCheckReport, bool)

func (*Node) HandleGracefulShutdown added in v0.110.0

func (n *Node) HandleGracefulShutdown(gracefulTimeoutInSeconds int)

func (*Node) Shutdown added in v0.90.24

func (n *Node) Shutdown(ctx context.Context) error

func (*Node) StartBlocking

func (n *Node) StartBlocking(opts ...Option) error

type Option

type Option func(options *options)

func WithConfigFileChange added in v0.91.0

func WithConfigFileChange(event chan struct{}) Option

func WithDevMode added in v0.102.0

func WithDevMode() Option

WithDevMode will set cookie secrets to a static, insecure, string This way, you stay logged in during development Should never be used in production

func WithFileSystemConfig

func WithFileSystemConfig(configFilePath string) Option

func WithForceHttpsRedirects

func WithForceHttpsRedirects(forceHttpsRedirects bool) Option

func WithGitHubAuthDemo

func WithGitHubAuthDemo(authDemo GitHubAuthDemo) Option

func WithGlobalRateLimit

func WithGlobalRateLimit(requests int, perDuration time.Duration) Option

func WithHooksServerHealthCheck added in v0.114.0

func WithHooksServerHealthCheck(timeout time.Duration) Option

func WithIdleTimeout added in v0.113.0

func WithIdleTimeout(idleTimeout time.Duration, idleHandler func()) Option

WithIdleTimeout makes the Node call the given handler after idleTimeout has elapsed without any requests while the server is running. If there are no requests, the handler will be called after idleTimeout counting from the server start.

func WithInsecureCookies

func WithInsecureCookies() Option

func WithIntrospection

func WithIntrospection(enable bool) Option

func WithNATSDefaultServerURL added in v0.166.0

func WithNATSDefaultServerURL(serverURL string) Option

WithNATSDefaultServerURL sets the URL for the default NATS server

func WithRequestResponseLogging added in v0.174.0

func WithRequestResponseLogging(enable bool) Option

func WithServerConfigLoadHandler added in v0.139.0

func WithServerConfigLoadHandler(callback func(config *WunderNodeConfig)) Option

func WithServerErrorHandler added in v0.139.0

func WithServerErrorHandler(callback func(err error)) Option

func WithStaticWunderNodeConfig

func WithStaticWunderNodeConfig(config *WunderNodeConfig) Option

func WithTraceBatchTimeout added in v0.157.0

func WithTraceBatchTimeout(batchTimeout time.Duration) Option

WithTraceBatchTimeout sets the timeout for the trace batch exporter. It defines how long the exporter will wait for a batch to be filled before sending it. If the timeout is less or equal than 0, the default value of 5 seconds will be used

type Server added in v0.110.0

type Server struct {
	GracefulShutdownTimeout int64
	KeepAlive               int64
	ReadTimeout             int64
	WriteTimeout            int64
	IdleTimeout             int64
}

type WunderNodeConfig added in v0.110.0

type WunderNodeConfig struct {
	Server *Server
	Api    *apihandler.Api
}

func CreateConfig added in v0.110.0

func CreateConfig(graphConfig *wgpb.WunderGraphConfiguration) (*WunderNodeConfig, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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