config

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoltDB

type BoltDB struct {
	Path    string        `required:"true"`
	Timeout time.Duration `default:"5s"`
}

type Config

type Config struct {
	Backend                                 string        `required:"true" default:"linux"`
	BoltDB                                  *BoltDB       `split_words:"true"`
	HttpServer                              *HttpServer   `split_words:"true"`
	DebugServer                             *DebugServer  `split_words:"true"`
	Initial                                 *Initial      `required:"true"`
	AutomaticStatsUpdateInterval            time.Duration `split_words:"true" default:"30s"`
	AutomaticStatsUpdateOnlyWithSubscribers bool          `split_words:"true" default:"false"`
	CorsAllowedOrigins                      []string      `split_words:"true" default:"*"`
	CorsAllowCredentials                    bool          `split_words:"true" default:"true"`
	CorsAllowPrivateNetwork                 bool          `split_words:"true" default:"false"`
	SubscriptionAllowedOrigins              []string      `split_words:"true" default:"*"`
	JwtSecret                               string        `required:"true" split_words:"true"`
	JwtDuration                             time.Duration `split_words:"true" default:"8h"`
}

func Load

func Load(prefix string) (*Config, error)

type DebugServer

type DebugServer struct {
	Enabled bool   `default:"false"`
	Host    string `default:"127.0.0.1"`
	Port    uint16 `default:"6060"`
}

func (*DebugServer) Address

func (s *DebugServer) Address() string

type HttpServer

type HttpServer struct {
	Host                    string `default:""`
	Port                    uint16 `default:"8080"`
	APQCacheEnabled         bool   `default:"false" split_words:"true"`
	TracingEnabled          bool   `default:"false" split_words:"true"`
	FrontendEnabled         bool   `default:"true" split_words:"true"`
	GraphiQLEnabled         bool   `default:"true" split_words:"true"`
	GraphiQLEndpoint        string `default:"/graphiql" split_words:"true"`
	GraphiQLVersion         string `default:"default" split_words:"true"`
	SandboxExplorerEnabled  bool   `default:"true" split_words:"true"`
	SandboxExplorerEndpoint string `default:"/sandbox" split_words:"true"`
	PlaygroundEnabled       bool   `default:"false" split_words:"true"`
	PlaygroundEndpoint      string `default:"/playground" split_words:"true"`
	AltairEnabled           bool   `default:"false" split_words:"true"`
	AltairEndpoint          string `default:"/altair" split_words:"true"`
	VoyagerEnabled          bool   `default:"false" split_words:"true"`
	VoyagerEndpoint         string `default:"/voyager" split_words:"true"`
}

func (*HttpServer) Address

func (s *HttpServer) Address() string

type Initial

type Initial struct {
	Email    string `default:"admin@example.com"`
	Password string `default:"random"`
}

Jump to

Keyboard shortcuts

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