cmd

package
v1.20.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	LakectlInteractive     = "LAKECTL_INTERACTIVE"
	DeathMessage           = "{{.Error|red}}\nError executing command.\n"
	DeathMessageWithFields = "{{.Message|red}}\n{{.Status}}\n"
	WarnMessage            = "{{.Warning|yellow}}\n\n"
)
View Source
const (
	AutoConfirmFlagName     = "yes"
	AutoConfigFlagShortName = "y"
	AutoConfirmFlagHelp     = "Automatically say yes to all confirmations"

	StdinFileName = "-"
)
View Source
const (
	DefaultBranch = "main"
)
View Source
const (
	DefaultMaxIdleConnsPerHost = 100
)
View Source
const (
	ParentNumberFlagName = "parent-number"
)
View Source
const (
	PathDelimiter = "/"
)

Variables

View Source
var ErrCommitNotFound = errors.New("commit not found")
View Source
var ErrTaskNotCompleted = errors.New("task not completed")
View Source
var (
	ErrUnknownOperation = errors.New("unknown operation")
)

Functions

func AssignAutoConfirmFlag added in v0.31.0

func AssignAutoConfirmFlag(flags *pflag.FlagSet)

func BisectRemove added in v0.99.0

func BisectRemove() error

func Confirm added in v0.31.0

func Confirm(flags *pflag.FlagSet, question string) (bool, error)

func Die

func Die(errMsg string, code int)

func DieErr

func DieErr(err error)

func DieFmt

func DieFmt(msg string, args ...interface{})

func DieOnErrorOrUnexpectedStatusCode added in v0.60.1

func DieOnErrorOrUnexpectedStatusCode(response interface{}, err error, expectedStatusCode int)

func DieOnHTTPError added in v0.58.0

func DieOnHTTPError(httpResponse *http.Response)

func DisableColors

func DisableColors()

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func FmtDiff

func FmtDiff(d apigen.Diff, withDirection bool)

func IsValidAccessKeyID added in v0.60.0

func IsValidAccessKeyID(accessKeyID string) bool

func IsValidSecretAccessKey added in v0.60.0

func IsValidSecretAccessKey(secretAccessKey string) bool

func ListRepositoriesAndAnalyze added in v0.60.0

func ListRepositoriesAndAnalyze(ctx context.Context) error

func Must added in v0.105.0

func Must[T any](v T, err error) T

Must return the call value or die with error if err is not nil

func MustParseBranchURI added in v0.63.0

func MustParseBranchURI(name, s string) *uri.URI

func MustParsePathURI added in v0.40.0

func MustParsePathURI(name, s string) *uri.URI

func MustParseRefURI added in v0.40.0

func MustParseRefURI(name, s string) *uri.URI

func MustParseRepoURI added in v0.40.0

func MustParseRepoURI(name, s string) *uri.URI

func OpenByPath added in v0.33.0

func OpenByPath(path string) (io.ReadSeekCloser, error)

OpenByPath returns a reader from the given path. If the path is "-", it consumes Stdin and opens a readable copy that is either deleted (POSIX) or will delete itself on close (non-POSIX, notably WINs).

func PrintTable

func PrintTable(rows [][]interface{}, headers []interface{}, paginator *apigen.Pagination, amount int)

func RetrieveError added in v0.53.0

func RetrieveError(response interface{}, err error) error

func ValidArgsRepository added in v0.83.3

func ValidArgsRepository(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

func Warning added in v1.15.0

func Warning(message string)

func Write

func Write(tpl string, data interface{})

func WriteIfVerbose added in v0.62.0

func WriteIfVerbose(tpl string, data interface{})

func WriteTo

func WriteTo(tpl string, data interface{}, w io.Writer)

Types

type APIError

type APIError interface {
	GetPayload() *apigen.Error
}

type Bisect added in v0.99.0

type Bisect struct {
	Created    time.Time        `json:"created"`
	Repository string           `json:"repository"`
	BadCommit  string           `json:"badCommit,omitempty"`
	GoodCommit string           `json:"goodCommit,omitempty"`
	Commits    []*apigen.Commit `json:"commits,omitempty"`
}

func (*Bisect) Load added in v0.99.0

func (b *Bisect) Load() error

func (*Bisect) PrintStatus added in v0.99.0

func (b *Bisect) PrintStatus()

func (*Bisect) Save added in v0.99.0

func (b *Bisect) Save() error

func (*Bisect) SaveSelect added in v0.99.0

func (b *Bisect) SaveSelect(sel BisectSelect) error

func (*Bisect) Update added in v0.99.0

type BisectSelect added in v0.99.0

type BisectSelect int
const (
	BisectSelectGood BisectSelect = iota
	BisectSelectBad
)

type Configuration added in v0.107.0

type Configuration struct {
	Credentials struct {
		AccessKeyID     lakefsconfig.OnlyString `mapstructure:"access_key_id"`
		SecretAccessKey lakefsconfig.OnlyString `mapstructure:"secret_access_key"`
	} `mapstructure:"credentials"`
	Server struct {
		EndpointURL lakefsconfig.OnlyString `mapstructure:"endpoint_url"`
	} `mapstructure:"server"`
	Metastore struct {
		Type lakefsconfig.OnlyString `mapstructure:"type"`
		Hive struct {
			URI           lakefsconfig.OnlyString `mapstructure:"uri"`
			DBLocationURI lakefsconfig.OnlyString `mapstructure:"db_location_uri"`
		} `mapstructure:"hive"`
		Glue struct {
			// TODO(ariels): Refactor credentials to share with server side.
			Profile         lakefsconfig.OnlyString `mapstructure:"profile"`
			CredentialsFile lakefsconfig.OnlyString `mapstructure:"credentials_file"`
			DBLocationURI   lakefsconfig.OnlyString `mapstructure:"db_location_uri"`
			Credentials     *struct {
				AccessKeyID     lakefsconfig.OnlyString `mapstructure:"access_key_id"`
				AccessSecretKey lakefsconfig.OnlyString `mapstructure:"access_secret_key"`
				SessionToken    lakefsconfig.OnlyString `mapstructure:"session_token"`
			} `mapstructure:"credentials"`

			Region    lakefsconfig.OnlyString `mapstructure:"region"`
			CatalogID lakefsconfig.OnlyString `mapstructure:"catalog_id"`
		} `mapstructure:"glue"`
		// setting FixSparkPlaceholder to true will change spark placeholder with the actual location. for more information see https://github.com/treeverse/lakeFS/issues/2213
		FixSparkPlaceholder bool `mapstructure:"fix_spark_placeholder"`
	}
}

Configuration is the user-visible configuration structure in Golang form. When editing, make sure *all* fields have a `mapstructure:"..."` tag, to simplify future refactoring.

type CredentialsError added in v0.60.0

type CredentialsError struct {
	Message string
	Details string
}

func (*CredentialsError) Error added in v0.60.0

func (e *CredentialsError) Error() string

func (*CredentialsError) GetDetails added in v0.60.0

func (e *CredentialsError) GetDetails() string

type Detailed added in v0.60.0

type Detailed interface {
	GetDetails() string
}

type FromTo added in v0.31.0

type FromTo struct {
	FromRef string
	ToRef   string
}

type FromToBase added in v0.94.1

type FromToBase struct {
	BaseRef string
	FromRef string
	ToRef   string
}

type LocalOperation added in v0.108.0

type LocalOperation string

type Pagination

type Pagination struct {
	Amount  int
	HasNext bool
	After   string
}

type PresignMode added in v1.7.0

type PresignMode struct {
	Enabled   bool
	Multipart bool
}

type StatementDoc

type StatementDoc struct {
	Statement []apigen.Statement `json:"statement"`
}

type Table

type Table struct {
	Headers []interface{}
	Rows    [][]interface{}
}

type UnknownConfigError added in v0.60.0

type UnknownConfigError struct {
	Message string
	Details string
}

func (*UnknownConfigError) Error added in v0.60.0

func (e *UnknownConfigError) Error() string

func (*UnknownConfigError) GetDetails added in v0.60.0

func (e *UnknownConfigError) GetDetails() string

type UserMessage added in v0.60.0

type UserMessage struct {
	Message string
}

type WrongEndpointURIError added in v0.60.0

type WrongEndpointURIError struct {
	Message string
	Details string
}

func (*WrongEndpointURIError) Error added in v0.60.0

func (e *WrongEndpointURIError) Error() string

func (*WrongEndpointURIError) GetDetails added in v0.60.0

func (e *WrongEndpointURIError) GetDetails() string

Source Files

Jump to

Keyboard shortcuts

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