config

package
v0.0.0-...-57b3fe1 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorResponse

func ErrorResponse(w http.ResponseWriter, msg string, status int) error

func PrettyPrint

func PrettyPrint(i interface{}) string

func ReadBody

func ReadBody(w http.ResponseWriter, r *http.Request, data any) error

func WriteResponse

func WriteResponse(w http.ResponseWriter, status int, data any, headers ...http.Header) error

Types

type ClientResponse

type ClientResponse struct {
	Error   bool   `json:"error,omitempty"`
	Message string `json:"message,omitempty"`
	Data    any    `json:"data,omitempty"`
}

type EnvVariables

type EnvVariables struct {
	PORT                 string `mapstructure:"PORT"`
	DB_DRIVER            string `mapstructure:"DB_DRIVER"`
	DB_SOURCE            string `mapstructure:"DB_SOURCE"`
	GOOGLE_CLIENT_ID     string `mapstructure:"GOOGLE_CLIENT_ID"`
	GOOGLE_CLIENT_SECRET string `mapstructure:"GOOGLE_CLIENT_SECRET"`
	GOOGLE_REDIRECT_URI  string `mapstructure:"GOOGLE_REDIRECT_URI"`
	GOOGLE_GRANT_TYPE    string `mapstructure:"GOOGLE_GRANT_TYPE"`
	ACCESS_TOKEN_KEY     string `mapstructure:"ACCESS_TOKEN_KEY"`
	REFRESH_TOKEN_KEY    string `mapstructure:"REFRESH_TOKEN_KEY"`
}

func LoadEnv

func LoadEnv() (config EnvVariables, err error)

Jump to

Keyboard shortcuts

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