aflag

package
v0.19.5 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package aflag is the eks anywhere flag handling package.

Index

Constants

This section is empty.

Variables

View Source
var BundleOverride = Flag[string]{
	Name:  "bundles-override",
	Usage: "A path to a custom bundles manifest",
}

BundleOverride is a path to a bundles manifest YAML that will be used in-place of the cluster specifications bundle override.

View Source
var ClusterConfig = Flag[string]{
	Name:  "filename",
	Short: "f",
	Usage: "Path that contains a cluster configuration",
}

ClusterConfig is the path to a cluster specification YAML.

View Source
var TinkerbellBMCAppendAlgoToHeaderDisabled = Flag[bool]{
	Name:  "tinkerbell-bmc-append-algo-to-header-disabled",
	Usage: "This disables appending of the algorithm type to the signature header used in RPC BMC interactions",
}

TinkerbellBMCAppendAlgoToHeaderDisabled is a Rufio RPC provider option. decides whether to append the algorithm to the signature header or not. Example: X-BMCLIB-Signature becomes X-BMCLIB-Signature-256 .

View Source
var TinkerbellBMCConsumerURL = Flag[string]{
	Name:  "tinkerbell-bmc-consumer-url",
	Usage: "The URL of a BMC RPC consumer/listener used for BMC interactions",
}

TinkerbellBMCConsumerURL is a Rufio RPC provider option. ConsumerURL is the URL where an rpc consumer/listener is running and to which we will send and receive all notifications.

View Source
var TinkerbellBMCCustomPayload = Flag[string]{
	Name:  "tinkerbell-bmc-custom-payload",
	Usage: "The custom payload used in RPC BMC interactions, must be used with tinkerbell-bmc-custom-payload-dot-location",
}

TinkerbellBMCCustomPayload allows providing a JSON payload that will be used in the RPC request.

View Source
var TinkerbellBMCCustomPayloadDotLocation = Flag[string]{
	Name:  "tinkerbell-bmc-custom-payload-dot-location",
	Usage: "The dot location of the custom payload used in RPC BMC interactions, must be used with tinkerbell-bmc-custom-payload",
}

TinkerbellBMCCustomPayloadDotLocation is the path to where the bmclib RequestPayload{} will be embedded. For example: object.data.body.

View Source
var TinkerbellBMCHMACSecrets = Flag[[]string]{
	Name:  "tinkerbell-bmc-hmac-secrets",
	Usage: "The secrets used to HMAC sign a payload, used in RPC BMC interactions",
}

TinkerbellBMCHMACSecrets is a Rufio RPC provider option. secrets used for signing the payload, all secrets with used to sign with both sha256 and sha512.

View Source
var TinkerbellBMCHTTPContentType = Flag[string]{
	Name:  "tinkerbell-bmc-http-content-type",
	Usage: "The HTTP content type used for the RPC BMC interactions",
}

TinkerbellBMCHTTPContentType is a Rufio RPC provider option. The content type header to use for the rpc request notification.

View Source
var TinkerbellBMCHTTPMethod = Flag[string]{
	Name:  "tinkerbell-bmc-http-method",
	Usage: "The HTTP method used for the RPC BMC interactions",
}

TinkerbellBMCHTTPMethod is a Rufio RPC provider option. The HTTP method to use for the rpc request notification.

View Source
var TinkerbellBMCPrefixSigDisabled = Flag[bool]{
	Name:  "tinkerbell-bmc-prefix-sig-disabled",
	Usage: "This disables prefixing the signature with the algorithm type used in RPC BMC interactions",
}

TinkerbellBMCPrefixSigDisabled is a Rufio RPC provider option. Example: sha256=abc123 ; Determines whether the algorithm will be prefixed to the signature.

View Source
var TinkerbellBMCSigHeaderName = Flag[string]{
	Name:  "tinkerbell-bmc-sig-header-name",
	Usage: "The HTTP header name for the HMAC signature used in RPC BMC interactions",
}

TinkerbellBMCSigHeaderName is a Rufio RPC provider option. The header name that should contain the signature(s). Example: X-BMCLIB-Signature .

View Source
var TinkerbellBMCSigIncludedPayloadHeaders = Flag[[]string]{
	Name:  "tinkerbell-bmc-sig-included-payload-headers",
	Usage: "The HTTP headers to be included in the HMAC signature payload used in RPC BMC interactions",
}

TinkerbellBMCSigIncludedPayloadHeaders is a Rufio RPC provider option. The headers whose values will be included in the signature payload. Example: given these headers in a request: X-My-Header=123,X-Another=456, and IncludedPayloadHeaders := []string{"X-Another"}, the value of "X-Another" will be included in the signature payload (comma separated).

View Source
var TinkerbellBMCStaticHeaders = Flag[Header]{
	Name:  "tinkerbell-bmc-static-headers",
	Usage: "Static HTTP headers added to all RPC BMC interactions",
}

TinkerbellBMCStaticHeaders is a Rufio RPC provider option. Predefined headers that will be added to every request (comma separated, values are semicolon separated) Example: "X-My-Header=1;2;3,X-Custom-Header=abc;def" .

View Source
var TinkerbellBMCTimestampHeader = Flag[string]{
	Name:  "tinkerbell-bmc-timestamp-header",
	Usage: "The HTTP timestamp header used for the RPC BMC interactions",
}

TinkerbellBMCTimestampHeader is a Rufio RPC provider option. The the header name that should contain the timestamp. Example: X-BMCLIB-Timestamp (in RFC3339 format) .

View Source
var TinkerbellBootstrapIP = Flag[string]{
	Name:  "tinkerbell-bootstrap-ip",
	Usage: "The IP used to expose the Tinkerbell stack from the bootstrap cluster",
}

TinkerbellBootstrapIP is used to override the Tinkerbell IP for serving a Tinkerbell stack from an admin machine.

Functions

func Bool

func Bool(f Flag[bool], dst *bool, fs *pflag.FlagSet)

Bool applies f to fs and writes the value to dst.

func HTTPHeader

func HTTPHeader(f Flag[Header], dst *Header, fs *pflag.FlagSet)

HTTPHeader applies f to fs and writes the value to dst.

func MarkHidden

func MarkHidden(set *pflag.FlagSet, flags ...string)

MarkHidden is a helper to mark flags hidden on cmd. If a flag does not exist, it panics.

func MarkRequired

func MarkRequired(set *pflag.FlagSet, flags ...string)

MarkRequired is a helper to mark flags required on cmd. If a flag does not exist, it panics.

func String

func String(f Flag[string], dst *string, fs *pflag.FlagSet)

String applies f to fs and writes the value to dst.

func StringSlice

func StringSlice(f Flag[[]string], dst *[]string, fs *pflag.FlagSet)

StringSlice applies f to fs and writes the value to dst.

func StringString

func StringString(f Flag[map[string]string], dst *map[string]string, fs *pflag.FlagSet)

StringString applies f to fs and writes the value to dst.

Types

type Flag

type Flag[T any] struct {
	Name    string
	Short   string
	Usage   string
	Default T
}

Flag defines a CLI flag.

type Header http.Header

Header Value.

func NewHeader

func NewHeader(h *http.Header) *Header

NewHeader returns a new Header pointer.

func (*Header) Set

func (h *Header) Set(val string) error

Set sets the value of the Header. Format: "a=1;2,b=2;4;5".

func (*Header) String

func (h *Header) String() string

String returns the string representation of the Header.

func (*Header) Type

func (h *Header) Type() string

Type returns the flag type.

Jump to

Keyboard shortcuts

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