transform

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: MIT Imports: 3 Imported by: 0

README

transform

Table of contents

Summary

Package transform provides utilities for data transformation and type conversion.

Architecture

Dependencies

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrPkg package error.
	ErrPkg = errors.New("transform")
	// ErrMarshal error.
	ErrMarshal = fmt.Errorf("%w: unable to marshal", ErrPkg)
	// ErrUnmarshal error.
	ErrUnmarshal = fmt.Errorf("%w: unable to unmarshal", ErrPkg)
)

Functions

This section is empty.

Types

type JSON

type JSON struct{}

JSON transform type.

func NewJSON

func NewJSON() *JSON

NewJSON factory function.

func (*JSON) Transform

func (j *JSON) Transform(input any, output any) error

Transform method to transform types by using json marshal/unmarshal functions.

type Transformer

type Transformer interface {
	// Transform converts input into output. The output parameter must be a pointer.
	Transform(input any, output any) error
}

Transformer generic transform interface.

Jump to

Keyboard shortcuts

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