manifest

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const Filename = "fastly.toml"

Filename is the name of the package manifest file.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	File File
	Flag Flag
}

Data holds global-ish manifest data from manifest files, and flag sources. It has methods to give each parameter to the components that need it, including the place the parameter came from, which is a requirement.

If the same parameter is defined in multiple places, it is resolved according to the following priority order: the manifest file (lowest priority) and then explicit flags (highest priority).

func (*Data) Name

func (d *Data) Name() (string, Source)

Name yields a Name.

func (*Data) ServiceID

func (d *Data) ServiceID() (string, Source)

ServiceID yields a ServiceID.

type File

type File struct {
	Version     int      `toml:"version"`
	Name        string   `toml:"name"`
	Description string   `toml:"description"`
	Authors     []string `toml:"authors"`
	Language    string   `toml:"language"`
	ServiceID   string   `toml:"service_id"`
}

File represents all of the configuration parameters in the fastly.toml manifest file schema.

func (*File) Read

func (f *File) Read(filename string) error

func (*File) Write

func (f *File) Write(filename string) error

type Flag

type Flag struct {
	ServiceID string
}

Flag represents all of the manifest parameters that can be set with explicit flags. Consumers should bind their flag values to these fields directly.

type Source

type Source uint8

Source enumerates where a manifest parameter is taken from.

const (
	// SourceUndefined indicates the parameter isn't provided in any of the
	// available sources, similar to "not found".
	SourceUndefined Source = iota

	// SourceFile indicates the parameter came from a manifest file.
	SourceFile

	// SourceFlag indicates the parameter came from an explicit flag.
	SourceFlag
)

Jump to

Keyboard shortcuts

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