utils

package
v0.0.0-...-dd147d8 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyTemplate

func ApplyTemplate(tmpl *template.Template, data interface{}) (strings.Builder, error)

applyTemplate aplica o template aos dados e retorna a string resultante.

func CreateTemplate

func CreateTemplate(templateName, content string) (*template.Template, error)

createTemplate cria um novo template com a sintaxe esperada.

func GenerateBadge

func GenerateBadge(name, message, color, href string, properties interface{}) string

GenerateBadge generates a badge HTML element.

func GenerateElement

func GenerateElement(tag string, properties map[string]string, children string) string

GenerateElement gera e retorna a string do elemento HTML.

func GenerateViewsBadge

func GenerateViewsBadge(badgeProperties interface{}) string

GenerateViewsBadge generates a views badge HTML element.

func JoinFile

func JoinFile(fileName string) string

func NormalizeColor

func NormalizeColor(color string) string

func OpenFile

func OpenFile(fileName string) (*os.File, error)

openFile abre o arquivo com o nome fornecido.

func OpenReadFile

func OpenReadFile(fileName string) ([]byte, error)

func QueryFromObject

func QueryFromObject(properties interface{}, isSnakeCase bool) string

QueryFromObject gera e retorna uma string de consulta a partir dos campos de uma estrutura.

func ReadFileContent

func ReadFileContent(file *os.File) ([]byte, error)

readFileContent lê o conteúdo do arquivo fornecido.

func WriteFile

func WriteFile(filePath, content string) error

writeToFile escreve o conteúdo em um arquivo no caminho fornecido.

Types

type ElementData

type ElementData struct {
	Tag        string
	Properties map[string]string
	Children   string
}

ElementData é a estrutura para armazenar dados do elemento HTML.

Jump to

Keyboard shortcuts

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