config

package
v0.0.0-...-c46e59b Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Roles = []Role{READER, WRITER, ADMIN}

Functions

This section is empty.

Types

type Auth

type Auth struct {
	Disabled      bool          `mapstructure:"disabled"`
	SigningSecret string        `mapstructure:"signing_secret"`
	TokenTTL      time.Duration `mapstructure:"token_ttl"`
	Users         []User        `mapstructure:"users"`
}

type Config

type Config struct {
	Server   *Server   `mapstructure:"server"`
	Auth     *Auth     `mapstructure:"auth"`
	Features *Features `mapstructure:"features"`
	Database *Database `mapstructure:"database"`
}

func LoadConfig

func LoadConfig(configFile string) (*Config, error)

type Database

type Database struct {
	StoragePath string `mapstructure:"storage_path"`
}

type Features

type Features struct {
	GraphqlConsole string `mapstructure:"graphqlConsole"`
	LogQueries     bool   `mapstructure:"log_queries"`
	ApolloTracing  bool   `mapstructure:"apollo_tracing"`
	Introspection  bool   `mapstructure:"introspection"`
	Playground     bool   `mapstructure:"playground"`
}

type Role

type Role string
const (
	READER Role = "reader"
	WRITER Role = "writer"
	ADMIN  Role = "admin"
)

type Server

type Server struct {
	Port          int    `mapstructure:"port"`
	RaftCluster   string `mapstructure:"raft_cluster"`
	RaftSecret    string `mapstructure:"raft_secret"`
	RaftBroadcast string `mapstructure:"raft_broadcast"`
	TLSKey        string `mapstructure:"tls_key"`
	TLSCert       string `mapstructure:"tls_cert"`
}

type User

type User struct {
	Username string `mapstructure:"username"`
	Password string `mapstructure:"password"`
	Roles    []Role `mapstructure:"roles"`
}

Jump to

Keyboard shortcuts

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