decoder

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterDecoder

func RegisterDecoder(format Format, decoder ConfDecoder, exts []string, mimes []string) error

RegisterDecoder registers a decoder for given scheme

Types

type ConfDecoder

type ConfDecoder interface {
	Unmarshal(data []byte, v any) error
}

ConfDecoder defines configuration decoder interface

func GetDecoder

func GetDecoder(format Format) (ConfDecoder, error)

GetDecoder returns decoder for given format

type Format

type Format string

Format represents configuration file format type

func FormatFromExtension

func FormatFromExtension(ext string) (Format, error)

FormatFromExtension returns format from file extension with validation

func FormatFromMIME

func FormatFromMIME(mime string) (Format, error)

FormatFromMIME returns format from MIME type with validation

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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