utils

package
v0.0.0-...-bd5a051 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Logger *log.Logger
)

Functions

func Contains

func Contains(slice []string, item string) bool

Contains verifica si un slice contiene un elemento específico.

func DeserializeBinary

func DeserializeBinary(data []byte, v interface{}) error

DeserializeBinary deserializa datos binarios a una estructura.

func DeserializeJSON

func DeserializeJSON(data []byte, v interface{}) error

DeserializeJSON deserializa datos JSON a una estructura.

func InitLogger

func InitLogger(logLevel string)

func IsEmpty

func IsEmpty(str string) bool

IsEmpty verifica si una cadena está vacía.

func MaxInt

func MaxInt(a, b int) int

MaxInt devuelve el mayor de dos enteros.

func SerializeBinary

func SerializeBinary(data interface{}) ([]byte, error)

SerializeBinary serializa una estructura a un formato binario.

func SerializeJSON

func SerializeJSON(data interface{}) ([]byte, error)

SerializeJSON serializa una estructura a JSON.

Types

type Config

type Config struct {
	ServerPort string `json:"server_port"`
	LogLevel   string `json:"log_level"`
}

func LoadConfig

func LoadConfig(filePath string) (*Config, error)

Jump to

Keyboard shortcuts

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