format

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package format provides formatting utilities for Tony documents.

Usage

// Format a Tony document
formatted, err := format.Format(input)

// Format with specific options
formatted, err := format.Format(input, format.WithIndent(2))

Formatting preserves semantic content while applying consistent style.

  • github.com/signadot/tony-format/go-tony/parse - Parse text to IR
  • github.com/signadot/tony-format/go-tony/encode - Encode IR to text

Index

Constants

This section is empty.

Variables

View Source
var ErrBadFormat = errors.New("bad format")

Functions

This section is empty.

Types

type Format

type Format int
const (
	TonyFormat Format = iota
	YAMLFormat
	JSONFormat
)

func ParseFormat

func ParseFormat(v string) (Format, error)

func (Format) IsJSON

func (f Format) IsJSON() bool

func (Format) IsTony

func (f Format) IsTony() bool

func (Format) IsYAML

func (f Format) IsYAML() bool

func (Format) MarshalText

func (f Format) MarshalText() ([]byte, error)

func (Format) String

func (f Format) String() string

func (*Format) UnmarshalText

func (f *Format) UnmarshalText(d []byte) error

Jump to

Keyboard shortcuts

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