encode

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: LGPL-2.1 Imports: 7 Imported by: 0

Documentation

Overview

Commands used to encode data into various formats.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Commands

type Commands struct {
	utils.Module
	// contains filtered or unexported fields
}

func New

func New(env utils.Runtime) *Commands

func (*Commands) Base64

func (self *Commands) Base64(value any) (string, error)

Encode the given data into base64

func (*Commands) Json

func (self *Commands) Json(value any, args *JsonArgs) (out string, merr error)

Encode the given data into a JSON document.

func (*Commands) Yaml

func (self *Commands) Yaml(value any) (string, error)

Encode the given data into a YAML document.

type JsonArgs

type JsonArgs struct {
	// Indent output with the given number of spaces.
	Indent int `json:"indent" default:"2"`
}

Jump to

Keyboard shortcuts

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