utils

package
v0.0.0-...-bcbc1e1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustGet

func MustGet(k string) string

MustGet will return the env or panic if it is not present

func MustGetBool

func MustGetBool(k string) bool

MustGetBool will return the env variable as a bool or panic if not present

func MustGetUint32

func MustGetUint32(k string) uint32

MustGetUint32 will return the env varaible as a uint32 of panic if not present

func PriceForSize

func PriceForSize(prices *model.Prices, size model.MiniSize) float64

PriceForSize returns the float64 value of the associated incoming price

Types

type AuthProvider

type AuthProvider struct {
	Provider  string
	ClientKey string
	Secret    string
	Domain    string // If needed, like with auth0
	Scopes    []string
}

AuthProvider defines the configuration for the Goth config

type ContextKey

type ContextKey string

ContextKey defines a type for context keys shared in the app

type DBConfig

type DBConfig struct {
	Dialect     string
	DSN         string
	LogMode     bool
	AutoMigrate bool
}

DBConfig defines the configuration for the DB config

type GQLConfig

type GQLConfig struct {
	Path                string
	PlaygroundPath      string
	IsPlaygroundEnabled bool
}

GQLConfig defines the configuration for the GQL Server

type JWTConfig

type JWTConfig struct {
	Secret    string
	Algorithm string
}

JWTConfig defines the options for JWT tokens

type ServerConfig

type ServerConfig struct {
	Port          string
	SessionSecret string
	JWT           JWTConfig
	GraphQL       GQLConfig
	Database      DBConfig
	AuthProviders []AuthProvider
}

ServerConfig defines the configuration for the server

Jump to

Keyboard shortcuts

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