utils

package
v1.6.0 Latest Latest
Warning

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

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

Documentation

Overview

Package utils is about function utils that can be used ex: utils.StatusLevel(logger, writer.status, utils.ServerMode)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StatusLevel

func StatusLevel(logger log.Logger, status int, mode ModeEnum) func(ctx context.Context,
	msg string, fields ...log.Field)

StatusLevel is a function that return the log level based on the status code.

Types

type ModeEnum

type ModeEnum int

ModeEnum is the identifier of the http mode.

const (
	// ServerMode is when the http is used as a server.
	ServerMode ModeEnum = iota + 1
	// ClientMode is when the http is used as a client.
	ClientMode
)

Jump to

Keyboard shortcuts

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