options

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAuthEnvVar = "YDB_TOKEN"

	DefaultStaticPasswordEnvVar = "YDB_PASSWORD"
	DefaultStaticUserEnvVar     = "YDB_USER"

	DefaultServiceAccountKeyFile = "SA_KEY_FILE"

	DefaultAuthIAMEndpoint = "iam.api.cloud.yandex.net"
)
View Source
const (
	GRPCDefaultTimeoutSeconds = 60
	GRPCDefaultPort           = 2135
)
View Source
const (
	DefaultMaxStaticNodeID = 50000
)

Variables

View Source
var AvailabilityModes = []string{"strong", "weak", "force"}

Functions

func Validate

func Validate(options ...Options) error

Types

type AdditionalFlag added in v0.0.3

type AdditionalFlag func(fs *pflag.FlagSet)

AdditionalFlag allows adding extra flags not defined in command

This behavior can be used if some additional parameters are added outside of some Option

TODO(shmel1k@): improve comment

type AuthIAMCreds

type AuthIAMCreds struct {
	KeyFilename string
	Endpoint    string
}

func (*AuthIAMCreds) DefineFlags

func (a *AuthIAMCreds) DefineFlags(fs *pflag.FlagSet)

func (*AuthIAMCreds) Validate

func (a *AuthIAMCreds) Validate() error

type AuthIAMMetadataCredentials added in v0.0.4

type AuthIAMMetadataCredentials struct {
	Enabled bool
}

func (*AuthIAMMetadataCredentials) DefineFlags added in v0.0.4

func (a *AuthIAMMetadataCredentials) DefineFlags(fs *pflag.FlagSet)

func (*AuthIAMMetadataCredentials) Validate added in v0.0.4

func (a *AuthIAMMetadataCredentials) Validate() error

type AuthIAMToken

type AuthIAMToken struct {
	TokenFile string
	Token     string
}

func (*AuthIAMToken) DefineFlags

func (a *AuthIAMToken) DefineFlags(fs *pflag.FlagSet)

func (*AuthIAMToken) Validate

func (a *AuthIAMToken) Validate() error

type AuthNone

type AuthNone struct{}

func (*AuthNone) DefineFlags

func (an *AuthNone) DefineFlags(_ *pflag.FlagSet)

func (*AuthNone) Validate

func (an *AuthNone) Validate() error

type AuthOptions

type AuthOptions struct {
	Creds Options
	Type  AuthType
}

func (*AuthOptions) DefineFlags

func (o *AuthOptions) DefineFlags(fs *pflag.FlagSet)

func (*AuthOptions) Validate

func (o *AuthOptions) Validate() error

type AuthStatic

type AuthStatic struct {
	User         string
	PasswordFile string
	Password     string
	NoPassword   bool
}

func (*AuthStatic) DefineFlags

func (a *AuthStatic) DefineFlags(fs *pflag.FlagSet)

func (*AuthStatic) Validate

func (a *AuthStatic) Validate() error

type AuthType

type AuthType string
const (
	Unset          AuthType = "unset"
	None           AuthType = "none"
	Static         AuthType = "static"
	IamToken       AuthType = "iam-token"
	IamCreds       AuthType = "iam-creds"
	IamMetadata    AuthType = "iam-metadata"
	MultipleAtOnce AuthType = "multiple-at-once"
)

type GRPC

type GRPC struct {
	Endpoint       string
	CaFile         string
	GRPCSecure     bool
	GRPCPort       int
	GRPCSkipVerify bool
	TimeoutSeconds int
}

func (*GRPC) DefineFlags

func (o *GRPC) DefineFlags(fs *pflag.FlagSet)

func (*GRPC) Validate

func (o *GRPC) Validate() error

type MajorMinorPatchVersion added in v0.0.5

type MajorMinorPatchVersion struct {
	Sign  string
	Major int
	Minor int
	Patch int
}

func (MajorMinorPatchVersion) Satisfies added in v0.0.5

func (v MajorMinorPatchVersion) Satisfies(otherVersion string) (bool, error)

func (MajorMinorPatchVersion) String added in v0.0.5

func (v MajorMinorPatchVersion) String() string

type Options

type Options interface {
	DefineFlags(fs *pflag.FlagSet)
	Validate() error
}

Options is an interface to defile options flags and validation logic

type RawVersion added in v0.0.5

type RawVersion struct {
	Sign string
	Raw  string
}

func (RawVersion) Satisfies added in v0.0.5

func (v RawVersion) Satisfies(otherVersion string) (bool, error)

func (RawVersion) String added in v0.0.5

func (v RawVersion) String() string

type StartedTime

type StartedTime struct {
	Timestamp time.Time
	Direction rune
}

type TargetingOptions added in v0.0.14

type TargetingOptions struct {
	AvailabilityMode string
	Datacenters      []string
	Hosts            []string
	ExcludeHosts     []string
	Version          string

	StartedTime *StartedTime
	VersionSpec VersionSpec

	Storage    bool
	Tenant     bool
	TenantList []string

	KubeconfigPath string
	K8sNamespace   string

	MaxStaticNodeID int
}

func (*TargetingOptions) DefineFlags added in v0.0.14

func (o *TargetingOptions) DefineFlags(fs *pflag.FlagSet)

func (*TargetingOptions) GetAvailabilityMode added in v0.0.14

func (o *TargetingOptions) GetAvailabilityMode() Ydb_Maintenance.AvailabilityMode

func (*TargetingOptions) Validate added in v0.0.14

func (o *TargetingOptions) Validate() error

type VersionSpec

type VersionSpec interface {
	Satisfies(otherVersion string) (bool, error)
	String() string
}

Jump to

Keyboard shortcuts

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