ntoml

package
v0.58.4 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultFilename = "netlify.toml"

Variables

This section is empty.

Functions

func GetNetlifyConfigPath

func GetNetlifyConfigPath(base string) (path string, err error)

func Save

func Save(conf *NetlifyToml) error

func SaveTo

func SaveTo(conf *NetlifyToml, path string) error

Types

type BuildConfig

type BuildConfig struct {
	Command      string            `toml:"command" json:"command" yaml:"command"`
	Base         string            `toml:"base" json:"base" yaml:"base"`
	Publish      string            `toml:"publish" json:"publish" yaml:"publish"`
	Ignore       string            `toml:"ignore" json:"ignore" yaml:"ignore"`
	Environment  map[string]string `toml:"environment" json:"environment" yaml:"environment"`
	Functions    string            `toml:"functions" json:"functions" yaml:"functions"`
	EdgeHandlers string            `toml:"edge_handlers" json:"edge_handlers" yaml:"edge_handlers"`
}

type DeployContext

type DeployContext struct {
	BuildConfig `yaml:",inline"`
}

type FoundMoreThanOneConfigPathError

type FoundMoreThanOneConfigPathError struct {
	// contains filtered or unexported fields
}

func (*FoundMoreThanOneConfigPathError) Error

type FoundNoConfigPathError

type FoundNoConfigPathError struct {
	// contains filtered or unexported fields
}

func (*FoundNoConfigPathError) Error

func (f *FoundNoConfigPathError) Error() string

type NetlifyToml

type NetlifyToml struct {
	Settings Settings `toml:"settings" json:"settings" yaml:"settings"`

	Redirects []Redirect `toml:"redirects,omitempty" json:"redirects,omitempty" yaml:"redirects,omitempty"`

	// this is the default context
	Build   *BuildConfig             `toml:"build" json:"build" yaml:"build"`
	Plugins []Plugin                 `toml:"plugins" json:"plugins" yaml:"plugins"`
	Context map[string]DeployContext `toml:"context,omitempty" json:"context,omitempty" yaml:"context,omitempty"`
}

func Load

func Load() (*NetlifyToml, error)

func LoadFrom

func LoadFrom(paths ...string) (*NetlifyToml, error)

type Plugin added in v0.34.0

type Plugin struct {
	Package       string `toml:"package" json:"package" yaml:"package"`
	PinnedVersion string `toml:"pinned_version,omitempty" json:"pinned_version,omitempty" yaml:"pinned_version,omitempty"`
}

type Redirect

type Redirect struct {
	Origin      string             `toml:"origin" json:"origin" yaml:"origin"`
	Destination string             `toml:"destination" json:"destination" yaml:"destination"`
	Parmeters   map[string]string  `toml:"parameters" json:"parameters" yaml:"parameters"`
	Status      int                `toml:"status" json:"status" yaml:"status"`
	Force       bool               `toml:"force" json:"force" yaml:"force"`
	Conditions  *RedirectCondition `toml:"conditions" json:"conditions" yaml:"conditions"`
	Headers     map[string]string  `toml:"headers" json:"headers" yaml:"headers"`
}

type RedirectCondition

type RedirectCondition struct {
	Language []string `toml:"language" json:"language" yaml:"language"`
	Country  []string `toml:"country" json:"country" yaml:"country"`
	Role     []string `toml:"role" json:"role" yaml:"role"`
}

type Settings

type Settings struct {
	ID   string `toml:"id" json:"id" yaml:"id"`
	Path string `toml:"path" json:"path" yaml:"path"`
}

Jump to

Keyboard shortcuts

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