helper

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBadRequestError

func GetBadRequestError(w http.ResponseWriter)

GetBadRequestError : This is helper function to prepare bad request error.

func GetError

func GetError(err error, w http.ResponseWriter)

GetError : This is helper function to prepare internal standard error.

func GetNotFoundError

func GetNotFoundError(w http.ResponseWriter)

GetNotFoundError : This is helper function to prepare not found error.

func LoadEnv

func LoadEnv(env Env)

LoadEnv : Load env

Types

type Configuration

type Configuration struct {
	ServerHTTPHost             string
	ServerGRPCHost             string
	GoEnv                      string
	UIUrl                      string
	LogLevel                   string
	RedisAddr                  string
	RedisPassword              string
	RedisDB                    string
	PolicyServiceEndpoint      string
	PolicyServiceAuthorization string
	PolicyServiceTimeout       string
	MetricsEnabled             string
}

Configuration model.

func GetConfiguration

func GetConfiguration() Configuration

GetConfiguration : Populate from env

type Env

type Env string

Env : Type of env

const (
	TestEnv Env = "../../../.env.test"
	AllEnv  Env = ".env"
)

Env types

type ErrorResponse

type ErrorResponse struct {
	StatusCode   int    `json:"status"`
	ErrorMessage string `json:"message"`
}

ErrorResponse : This is error model.

Jump to

Keyboard shortcuts

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