grp

package
v2.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package grp holds the InstanceGroup interface

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyCluster

func AnyCluster(g InstanceGroup) bool

AnyCluster is true if the group matches any cluster

func AnyRegion

func AnyRegion(g InstanceGroup) bool

AnyRegion is true if the group matches any region

func AnyStack

func AnyStack(g InstanceGroup) bool

AnyStack is true if the group matches any stack

func Contains

func Contains(g InstanceGroup, account, region, cluster string) bool

Contains returns true if the (account, region, cluster) is within the instance group

func Equal

func Equal(g1, g2 InstanceGroup) bool

Equal returns true if g1 and g2 represent the same group of instances

func String

func String(group InstanceGroup) string

String outputs a string representation of InstanceGroup suitable for logging

Types

type InstanceGroup

type InstanceGroup interface {
	// App returns the name of the app
	App() string

	// Account returns the name of the account
	Account() string

	// Region returns (region name, region present)
	// If the group is cross-region, the boolean will be false
	Region() (name string, ok bool)

	// Stack returns (region name, region present)
	// If the group is cross-stack, the boolean will be false
	Stack() (name string, ok bool)

	// Cluster returns (cluster name, cluster present)
	// If the group is cross-cluster, the boolean will be false
	Cluster() (name string, ok bool)

	// String outputs a stringified rep
	String() string
}

InstanceGroup represents a group of instances

func New

func New(app, account, region, stack, cluster string) InstanceGroup

New generates an InstanceGroup. region, stack, and cluster may be empty strings, in which case the group is cross-region, cross-stack, or cross-cluster Note that stack and cluster are mutually exclusive, can specify one but not both

Jump to

Keyboard shortcuts

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