json

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package json defines the JSON format decoder and decoder creation strategy to be integrated into the config package decoder factory instance.

Index

Constants

View Source
const (
	// Format defines the value to be used to declare
	// a JSON config source encoding format.
	Format = "json"
)
View Source
const (
	// ID defines the application container registration string for the
	// JSON format decoder strategy.
	ID = decoder.ID + ".json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

type Decoder struct {
	decoder.Decoder
}

Decoder defines a config source JSON content decoder instance.

func NewDecoder

func NewDecoder(
	reader io.Reader,
) (*Decoder, error)

NewDecoder will instantiate a new JSON configuration decoder.

type DecoderStrategy

type DecoderStrategy struct{}

DecoderStrategy defines a JSON config decoder instantiation strategy

func NewDecoderStrategy

func NewDecoderStrategy() *DecoderStrategy

NewDecoderStrategy will instantiate a new JSON format decoder creation strategy

func (DecoderStrategy) Accept

func (DecoderStrategy) Accept(
	format string,
) bool

Accept will check if the decoder factory strategy can instantiate a decoder giving the format and the creation request parameters.

func (DecoderStrategy) Create

func (DecoderStrategy) Create(
	args ...interface{},
) (config.Decoder, error)

Create will instantiate the desired decoder instance with the given JSON underlying decoder instance as source of the content to decode.

type Provider

type Provider struct{}

Provider defines the slate.config module service provider to be used on the application initialization to register the config service.

func (Provider) Boot

func (p Provider) Boot(
	container *slate.Container,
) error

Boot will start the configuration config instance by calling the configuration loader with the defined provider base entry information.

func (Provider) Register

func (Provider) Register(
	container *slate.Container,
) error

Register will register the configuration section instances in the application container.

Jump to

Keyboard shortcuts

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