util

package
v0.0.0-...-87de96b Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// MasterContextKeys the project's context keys
	MasterContextKeys = ContextKeys{
		ProviderCtxKey:       "provider",
		UserCtxKey:           "auth-user",
		GinContextKey:        "gin",
		ConfigCtxKey:         "config",
		LoggerCtxKey:         "logger",
		RoleServiceCtxKey:    "role-service",
		UserServiceCtxKey:    "user-service",
		AuthServiceCtxKey:    "auth-service",
		ManagerServiceCtxKey: "manager-service",
		BrokerServiceCtxKey:  "broker-service",
	}
)

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 as boolean or panic if it is not present

func ToSnakeCase

func ToSnakeCase(str string) string

ToSnakeCase converts camelcase str to snake_case

Types

type ContextKey

type ContextKey string

ContextKey defines a type for context keys shared in the app

type ContextKeys

type ContextKeys struct {
	ProviderCtxKey       ContextKey // Provider in Auth
	UserCtxKey           ContextKey // User db object in Auth
	GinContextKey        ContextKey
	ConfigCtxKey         ContextKey
	LoggerCtxKey         ContextKey
	RoleServiceCtxKey    ContextKey
	UserServiceCtxKey    ContextKey // XXX: redundant?
	AuthServiceCtxKey    ContextKey // XXX: redundant?
	ManagerServiceCtxKey ContextKey
	BrokerServiceCtxKey  ContextKey
}

ContextKeys holds the context keys through the project

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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