flag

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const SkipValidation = ValidationError("skipping validation")

SkipValidation skips subsequent flag validation. Use with flags such as DryRun to skip validation of flags that are not used in dry-run mode.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	// contains filtered or unexported fields
}

Cluster name or other identifier

func (*Cluster) Add

func (c *Cluster) Add(flags *pflag.FlagSet)

func (*Cluster) Validate

func (c *Cluster) Validate() error

func (*Cluster) Value

func (c *Cluster) Value() string

type Description

type Description struct {
	// contains filtered or unexported fields
}

Description of a Security Command Center source. Ref: https://cloud.google.com/security-command-center/docs/reference/rest/v1/organizations.sources

func (*Description) Add

func (d *Description) Add(flags *pflag.FlagSet)

func (*Description) Validate

func (d *Description) Validate() error

func (*Description) Value

func (d *Description) Value() string

type DisplayName

type DisplayName struct {
	// contains filtered or unexported fields
}

DisplayName of a Security Command Center source. Ref: https://cloud.google.com/security-command-center/docs/reference/rest/v1/organizations.sources

func (*DisplayName) Add

func (d *DisplayName) Add(flags *pflag.FlagSet)

func (*DisplayName) Validate

func (d *DisplayName) Validate() error

func (*DisplayName) Value

func (d *DisplayName) Value() string

type DryRun

type DryRun struct {
	// contains filtered or unexported fields
}

DryRun skips all API write operations

func (*DryRun) Add

func (d *DryRun) Add(flags *pflag.FlagSet)

func (*DryRun) Validate

func (d *DryRun) Validate() error

func (*DryRun) Value

func (d *DryRun) Value() bool

type Flag

type Flag interface {
	// Add the flag to be parsed
	Add(*pflag.FlagSet)
	// Validate the flag value
	Validate() error
}

Flag interface to implement for each flag

type Flags

type Flags struct {
	// contains filtered or unexported fields
}

Flags for command line flags

func New

func New(flags ...Flag) *Flags

New creates a new flag validator. The flags will be validated in the order they were added.

func (*Flags) AddToFlagSet

func (p *Flags) AddToFlagSet(flagSet *pflag.FlagSet)

AddToFlagSet adds the

func (*Flags) Validate

func (p *Flags) Validate() error

Validate command-line flags

type ImpersonateServiceAccount

type ImpersonateServiceAccount struct {
	// contains filtered or unexported fields
}

ImpersonateServiceAccount represents a Google service account to impersonate when making requests to Google Cloud APIs. Only relevant for CLI usage. The controller should use Workload Identity to bind the Kubernetes service account to a Google service account instead of using this flag. Ref: https://cloud.google.com/iam/docs/impersonating-service-accounts

func (*ImpersonateServiceAccount) Add

func (a *ImpersonateServiceAccount) Add(flags *pflag.FlagSet)

func (*ImpersonateServiceAccount) Validate

func (a *ImpersonateServiceAccount) Validate() error

func (*ImpersonateServiceAccount) Value

func (a *ImpersonateServiceAccount) Value() string

type Interval

type Interval struct {
	// contains filtered or unexported fields
}

Interval number of seconds to sleep between each iteration of the control loop.

func (*Interval) Add

func (i *Interval) Add(flags *pflag.FlagSet)

func (*Interval) Validate

func (i *Interval) Validate() error

func (*Interval) Value

func (i *Interval) Value() int

type Kubeconfig

type Kubeconfig struct {
	// contains filtered or unexported fields
}

Kubeconfig used to connect to cluster Ref: https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/

func (*Kubeconfig) Add

func (k *Kubeconfig) Add(flags *pflag.FlagSet)

func (*Kubeconfig) Validate

func (k *Kubeconfig) Validate() error

func (*Kubeconfig) Value

func (k *Kubeconfig) Value() string

type Member

type Member struct {
	// contains filtered or unexported fields
}

Member represents a user, group, serviceAccount or domain used in an IAM policy binding Ref: https://cloud.google.com/security-command-center/docs/reference/rest/Shared.Types/Policy

func (*Member) Add

func (m *Member) Add(flags *pflag.FlagSet)

func (*Member) Validate

func (m *Member) Validate() error

func (*Member) Value

func (m *Member) Value() string

type OrganizationID

type OrganizationID struct {
	// contains filtered or unexported fields
}

OrganizationID represents the numeric Google Cloud organization ID. Ref: https://cloud.google.com/resource-manager/docs/creating-managing-organization#retrieving_your_organization_id

func (*OrganizationID) Add

func (o *OrganizationID) Add(flags *pflag.FlagSet)

func (*OrganizationID) Validate

func (o *OrganizationID) Validate() error

func (*OrganizationID) Value

func (o *OrganizationID) Value() string

type Role

type Role struct {
	// contains filtered or unexported fields
}

Role a Cloud IAM role used in an IAM policy binding Ref: https://cloud.google.com/iam/docs/understanding-roles

func (*Role) Add

func (r *Role) Add(flags *pflag.FlagSet)

func (*Role) Validate

func (r *Role) Validate() error

func (*Role) Value

func (r *Role) Value() string

type Source

type Source struct {
	// contains filtered or unexported fields
}

Source represents a Security Command Center source Ref: https://cloud.google.com/security-command-center/docs/reference/rest/v1/organizations.sources

func (*Source) Add

func (s *Source) Add(flags *pflag.FlagSet)

func (*Source) Validate

func (s *Source) Validate() error

func (*Source) Value

func (s *Source) Value() string

type SourceLimit

type SourceLimit struct {
	// contains filtered or unexported fields
}

SourceLimit defines the max number of sources to retrieve from the Security Command Center API when listing sources.

func (*SourceLimit) Add

func (l *SourceLimit) Add(flags *pflag.FlagSet)

func (*SourceLimit) Validate

func (l *SourceLimit) Validate() error

func (*SourceLimit) Value

func (l *SourceLimit) Value() int

type ValidationError

type ValidationError string

ValidationError is a type used to define sentinel errors that alter the way flags are validated.

func (ValidationError) Error

func (e ValidationError) Error() string

Jump to

Keyboard shortcuts

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