latte

package module
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2022 License: MIT Imports: 4 Imported by: 0

README

Latte

What Is Latte?

Latte is a beans collector for go project. I made this to make it easier for me and my team when building all golang based projects


Installation

To install Latte package, you need to install Go and set your Go workspace first. You can use the below Go command to install Latte.

go get -u github.com/ridhwan-faris/latte

Created by Ridhwan Faris Hermawan

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Normal colors
	NBlack   = []byte{'\033', '[', '3', '0', 'm'}
	NRed     = []byte{'\033', '[', '3', '1', 'm'}
	NGreen   = []byte{'\033', '[', '3', '2', 'm'}
	NYellow  = []byte{'\033', '[', '3', '3', 'm'}
	NBlue    = []byte{'\033', '[', '3', '4', 'm'}
	NMagenta = []byte{'\033', '[', '3', '5', 'm'}
	NCyan    = []byte{'\033', '[', '3', '6', 'm'}
	NWhite   = []byte{'\033', '[', '3', '7', 'm'}
	// Bright colors
	BBlack   = []byte{'\033', '[', '3', '0', ';', '1', 'm'}
	BRed     = []byte{'\033', '[', '3', '1', ';', '1', 'm'}
	BGreen   = []byte{'\033', '[', '3', '2', ';', '1', 'm'}
	BYellow  = []byte{'\033', '[', '3', '3', ';', '1', 'm'}
	BBlue    = []byte{'\033', '[', '3', '4', ';', '1', 'm'}
	BMagenta = []byte{'\033', '[', '3', '5', ';', '1', 'm'}
	BCyan    = []byte{'\033', '[', '3', '6', ';', '1', 'm'}
	BWhite   = []byte{'\033', '[', '3', '7', ';', '1', 'm'}

	Reset = []byte{'\033', '[', '0', 'm'}
)

Functions

This section is empty.

Types

type Configuration

type Configuration interface {
	GetString(key string) string
	GetBool(key string) bool
	GetInt(key string) int
	Initialize(configPath string)
}

type Context

type Context struct {
	Debug         bool
	Configuration Configuration
	Validator     *validator.Validate
	MySqlDsn      string
	PostgreDsn    string
	RedisDsn      string
	MongoDsn      string
}

func (*Context) Info

func (c *Context) Info(message interface{})

func (*Context) ResponseWithJson added in v1.0.4

func (c *Context) ResponseWithJson(w http.ResponseWriter, httpCode int, code string, status string, message string, data interface{})

func (*Context) SendBadRequest added in v1.0.4

func (c *Context) SendBadRequest(w http.ResponseWriter, code string, message string)

func (*Context) SendForbidden added in v1.0.4

func (c *Context) SendForbidden(w http.ResponseWriter, code string, message string)

func (*Context) SendInternalServerError added in v1.0.4

func (c *Context) SendInternalServerError(w http.ResponseWriter, code string, message string)

func (*Context) SendSuccess added in v1.0.4

func (c *Context) SendSuccess(w http.ResponseWriter, code string, message string, payload interface{})

func (*Context) SendUnauthorized added in v1.0.4

func (c *Context) SendUnauthorized(w http.ResponseWriter, code string, message string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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