setup

package
v0.39.3 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	Address        string
	Name           string
	OverrideHost   string
	Port           uint
	SSLSNIHostname string
}

Backend represents the configuration parameters for creating a backend via the API client.

type Backends

type Backends struct {
	// Public
	Available      []*fastly.Backend
	APIClient      api.Interface
	Progress       text.Progress
	Required       []Backend
	ServiceID      string
	ServiceVersion int
	Setup          map[string]*manifest.SetupBackend
	AcceptDefaults bool
	Stdin          io.Reader
	Stdout         io.Writer
}

Backends represents the service state related to backends defined within the fastly.toml setup configuration.

NOTE: It implements the setup.Interface interface.

func (*Backends) Configure

func (b *Backends) Configure() error

Configure prompts the user for specific values related to the service resource.

func (*Backends) Create

func (b *Backends) Create() error

Create calls the relevant API to create the service resource(s).

func (*Backends) Predefined

func (b *Backends) Predefined() bool

Predefined indicates if the service resource has been specified within the fastly.toml file using a setup configuration block.

type Domain

type Domain struct {
	Name string
}

Domain represents the configuration parameters for creating a domain via the API client.

type Domains

type Domains struct {
	// Public
	Available      []*fastly.Domain
	APIClient      api.Interface
	PackageDomain  string
	Progress       text.Progress
	Required       []Domain
	ServiceID      string
	ServiceVersion int
	AcceptDefaults bool
	Stdin          io.Reader
	Stdout         io.Writer
	// contains filtered or unexported fields
}

Domains represents the service state related to domains defined within the fastly.toml setup configuration.

NOTE: It implements the setup.Interface interface.

func (*Domains) Configure

func (d *Domains) Configure() error

Configure prompts the user for specific values related to the service resource.

NOTE: If --domain flag is used we'll use that as the domain to create.

func (*Domains) Create

func (d *Domains) Create() error

Create calls the relevant API to create the service resource(s).

func (*Domains) Missing

func (d *Domains) Missing() bool

Missing indicates if there are missing resources that need to be created.

func (*Domains) Predefined

func (d *Domains) Predefined() bool

Predefined indicates if the service resource has been specified within the fastly.toml file using a setup configuration block.

NOTE: Domains are not configurable via the fastly.toml setup and so this becomes a no-op function that returned a canned response.

func (*Domains) Validate

func (d *Domains) Validate() error

Validate checks if the service has the required resources.

NOTE: It should set an internal `missing` field (boolean) accordingly so that the Missing() method can report the state of the resource.

type Interface

type Interface interface {
	// Configure prompts the user for specific values related to the service resource.
	Configure() error

	// Create calls the relevant API to create the service resource(s).
	Create() error

	// Missing indicates if there are missing resources that need to be
	// configured and/or created.
	Missing() bool

	// Predefined indicates if the service resource has been specified within the
	// fastly.toml file using a [setup] configuration block.
	Predefined() bool

	// Validate checks if the service has the required resources.
	Validate() error
}

Interface represents the behaviour of a setup resource.

Jump to

Keyboard shortcuts

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