ntoml

package
v0.64.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: MIT Imports: 7 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"`
	Base         string            `toml:"base"`
	Publish      string            `toml:"publish"`
	Ignore       string            `toml:"ignore"`
	Environment  map[string]string `toml:"environment"`
	Functions    string            `toml:"functions"`
	EdgeHandlers string            `toml:"edge_handlers"`
}

type DeployContext

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

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"`

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

	// this is the default context
	Build   *BuildConfig             `toml:"build"`
	Plugins []Plugin                 `toml:"plugins"`
	Context map[string]DeployContext `toml:"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"`
	PinnedVersion string `toml:"pinned_version,omitempty" json:"pinned_version,omitempty"`
}

type Redirect

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

type RedirectCondition

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

type Settings

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

Jump to

Keyboard shortcuts

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