conv

package module
v0.0.0-...-3be3c9f Latest Latest
Warning

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

Go to latest
Published: May 25, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

README

go-conv-helper

Converts an input and creates an output.

Go Reference

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Converter

type Converter[I, O any] func(ctx context.Context, input I) (output O, e error)

func ConverterAdd

func ConverterAdd[I, O1, O2 any](c1 Converter[I, O1], c2 Converter[O1, O2]) Converter[I, O2]

type ConverterBuilder

type ConverterBuilder[I, O any] struct {
	Serializer[I]
	Parser[O]
	RawConverter
}

func (ConverterBuilder[I, O]) Build

func (b ConverterBuilder[I, O]) Build() Converter[I, O]

type InputStore

type InputStore[I, K any] func(ctx context.Context, key K) (input I, e error)

type Parser

type Parser[O any] func(raw []byte) (parsed O, e error)

type RawConverter

type RawConverter Converter[[]byte, []byte]

type Serializer

type Serializer[I any] func(input I) (serialized []byte, e error)

Jump to

Keyboard shortcuts

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