util

package
v0.0.0-...-2be3cdd Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNonInteractive = errors.New("In non-interactive shell and --assume-yes not used.")

Functions

func ActivateVersion

func ActivateVersion(c *cli.Context, client *fastly.Client, s *fastly.Service, v *fastly.Version) error

func CheckFastlyKey

func CheckFastlyKey(c *cli.Context) *cli.ExitError

func CountChanges

func CountChanges(diff *string) (int, int)

func GetActiveVersion

func GetActiveVersion(service *fastly.Service) (uint, error)

getActiveVersion takes in a *fastly.Service and spits out the config version that is currently active for that service.

func GetDictionaryByName

func GetDictionaryByName(client *fastly.Client, serviceName, dictName string) (*fastly.Dictionary, error)

func GetDiffUrl

func GetDiffUrl(s *fastly.Service, from, to uint) *url.URL

func GetFastlyKey

func GetFastlyKey() string

func GetPager

func GetPager() *exec.Cmd

func GetServiceByName

func GetServiceByName(client *fastly.Client, name string) (*fastly.Service, error)

func GetUnifiedDiff

func GetUnifiedDiff(c *fastly.Client, s *fastly.Service, from, to uint) (string, error)

func IsInteractive

func IsInteractive() bool

func Prompt

func Prompt(question string) (bool, error)

func StringInSlice

func StringInSlice(check string, slice []string) bool

func ValidateVersion

func ValidateVersion(client *fastly.Client, service *fastly.Service, version uint) error

validateVersion takes in a service and version number and returns an error if the version is invalid.

func VersionsEqual

func VersionsEqual(c *fastly.Client, s *fastly.Service, from, to uint) (bool, error)

Returns true if two versions of a given service are identical. Generated VCL is not suitable as the ordering output of GeneratedVCL will vary if a no-op change has been made to a config (for example, removing and re-adding all domains). As such, this function generates a known-noop diff by comparing a version with itself, and then generating a diff between the from and to versions. If the two diffs are identical, then there is no difference between from and to.

Types

This section is empty.

Jump to

Keyboard shortcuts

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