format

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatBytes

func FormatBytes(path string, data []byte, schema *Schema) ([]byte, error)

FormatBytes normalizes raw file contents according to the configured rules.

Types

type Result

type Result struct {
	Path    string
	Content []byte
	Changed bool
}

Result captures the outcome of formatting a file.

func FormatFile

func FormatFile(path string, schema *Schema) (*Result, error)

FormatFile loads a file, applies formatting rules, and returns the new body.

type Schema

type Schema struct {
	// contains filtered or unexported fields
}

Schema describes the canonical field ordering for an entity.

func NewSchema

func NewSchema(fields []*SchemaField) *Schema

NewSchema constructs a schema with the provided ordered fields.

type SchemaField

type SchemaField struct {
	Name     string
	Repeated bool
	Nested   *Schema
}

SchemaField represents a field entry and any nested schema for object properties.

Jump to

Keyboard shortcuts

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