loader

package
v27.4.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 25 Imported by: 313

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDeprecatedProperties

func GetDeprecatedProperties(configDicts ...map[string]any) map[string]string

GetDeprecatedProperties returns the list of any deprecated properties that are used in the compose files.

func GetUnsupportedProperties

func GetUnsupportedProperties(configDicts ...map[string]any) []string

GetUnsupportedProperties returns the list of any unsupported properties that are used in the Compose files.

func Load

func Load(configDetails types.ConfigDetails, opt ...func(*Options)) (*types.Config, error)

Load reads a ConfigDetails and returns a fully loaded configuration

func LoadConfigObjs

func LoadConfigObjs(source map[string]any, details types.ConfigDetails) (map[string]types.ConfigObjConfig, error)

LoadConfigObjs produces a ConfigObjConfig map from a compose file Dict the source Dict is not validated if directly used. Use Load() to enable validation

func LoadNetworks

func LoadNetworks(source map[string]any, version string) (map[string]types.NetworkConfig, error)

LoadNetworks produces a NetworkConfig map from a compose file Dict the source Dict is not validated if directly used. Use Load() to enable validation

func LoadSecrets

func LoadSecrets(source map[string]any, details types.ConfigDetails) (map[string]types.SecretConfig, error)

LoadSecrets produces a SecretConfig map from a compose file Dict the source Dict is not validated if directly used. Use Load() to enable validation

func LoadService

func LoadService(name string, serviceDict map[string]any, workingDir string, lookupEnv template.Mapping) (*types.ServiceConfig, error)

LoadService produces a single ServiceConfig from a compose file Dict the serviceDict is not validated if directly used. Use Load() to enable validation

func LoadServices

func LoadServices(servicesDict map[string]any, workingDir string, lookupEnv template.Mapping) ([]types.ServiceConfig, error)

LoadServices produces a ServiceConfig map from a compose file Dict the servicesDict is not validated if directly used. Use Load() to enable validation

func LoadVolumes

func LoadVolumes(source map[string]any, version string) (map[string]types.VolumeConfig, error)

LoadVolumes produces a VolumeConfig map from a compose file Dict the source Dict is not validated if directly used. Use Load() to enable validation

func ParseVolume

func ParseVolume(spec string) (types.ServiceVolumeConfig, error)

ParseVolume parses a volume spec without any knowledge of the target platform

func ParseYAML

func ParseYAML(source []byte) (map[string]any, error)

ParseYAML reads the bytes from a file, parses the bytes into a mapping structure, and returns it.

func Transform

func Transform(source any, target any, additionalTransformers ...Transformer) error

Transform converts the source into the target struct with compose types transformer and the specified transformers if any.

func WithDiscardEnvFiles

func WithDiscardEnvFiles(options *Options)

WithDiscardEnvFiles sets the Options to discard the `env_file` section after resolving to the `environment` section

Types

type ForbiddenPropertiesError

type ForbiddenPropertiesError struct {
	Properties map[string]string
}

ForbiddenPropertiesError is returned when there are properties in the Compose file that are forbidden.

func (*ForbiddenPropertiesError) Error

func (e *ForbiddenPropertiesError) Error() string

type Options

type Options struct {
	// Skip schema validation
	SkipValidation bool
	// Skip interpolation
	SkipInterpolation bool
	// Interpolation options
	Interpolate *interp.Options
	// contains filtered or unexported fields
}

Options supported by Load

type Transformer

type Transformer struct {
	TypeOf reflect.Type
	Func   TransformerFunc
}

Transformer defines a map to type transformer

type TransformerFunc

type TransformerFunc func(any) (any, error)

TransformerFunc defines a function to perform the actual transformation

Jump to

Keyboard shortcuts

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