cmd

package
v0.69.1 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: Apache-2.0 Imports: 57 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"
)
View Source
const (
	AutoConfirmFlagName     = "yes"
	AutoConfigFlagShortName = "y"
	AutoConfirmFlagHelp     = "Automatically say yes to all confirmations"

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

const values used by lakectl commands

Variables

View Source
var ErrInvalidValueInList = errors.New("empty string in list")

ErrInvalidValueInList is an error returned when a parameter of type list contains an empty string

Functions

func AssignAutoConfirmFlag added in v0.31.0

func AssignAutoConfirmFlag(flags *pflag.FlagSet)

func Confirm added in v0.31.0

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

func CreateBranch added in v0.61.0

func CreateBranch(ctx context.Context, repository, sourceBranch, destinationBranch string)

CreateBranch creates a new branch with the given repository, and source and destination branch names

func DBTDebug added in v0.61.0

func DBTDebug(projectRoot string, schemaRegex *regexp.Regexp, executor Executor) (string, error)

func DBTRun added in v0.61.0

func DBTRun(projectRoot, schema, schemaEnvVarIdentifier string, selectValues []string, executor Executor) (string, error)

func Die

func Die(err 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 ExecuteCommand added in v0.61.0

func ExecuteCommand(cmd *exec.Cmd) ([]byte, error)

func ExtractRepoAndBranchFromDBName added in v0.61.0

func ExtractRepoAndBranchFromDBName(ctx context.Context, dbName string, client metastore.Client) (string, string, error)

ExtractRepoAndBranchFromDBName extracts the repository and branch in which the metastore resides

func Fmt

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

func FmtDiff

func FmtDiff(diff api.Diff, withDirection bool)

func IsBase64 added in v0.60.0

func IsBase64(s string) 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 MustBool added in v0.33.0

func MustBool(v bool, err error) bool

func MustInt added in v0.33.0

func MustInt(v int, err error) int

func MustInt64 added in v0.62.0

func MustInt64(v int64, err error) int64

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 MustSliceNonEmptyString added in v0.54.0

func MustSliceNonEmptyString(list string, v []string) []string

func MustString added in v0.33.0

func MustString(v string, err error) string

func MustStringSlice added in v0.54.0

func MustStringSlice(v []string, err error) []string

func OpenByPath added in v0.33.0

func OpenByPath(path string) io.ReadSeekCloser

OpenByPath returns a reader from the given path. If 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 *api.Pagination, amount int)

func RetrieveError added in v0.53.0

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

func ValidateGenerateSchemaMacro added in v0.61.0

func ValidateGenerateSchemaMacro(projectRoot, macrosDirName, generateSchemaFileName, schemaIdentifier string) error

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() *api.Error
}

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 DBTResource added in v0.61.0

type DBTResource struct {
	Schema string `json:"schema"`
	Alias  string `json:"alias"`
}

func DBTLsToJSON added in v0.61.0

func DBTLsToJSON(projectRoot, resourceType string, selectValues []string, executor Executor) ([]DBTResource, error)

type Detailed added in v0.60.0

type Detailed interface {
	GetDetails() string
}

type Executor added in v0.61.0

type Executor func(*exec.Cmd) ([]byte, error)

type FromTo added in v0.31.0

type FromTo struct {
	FromRef, ToRef string
}

type Pagination

type Pagination struct {
	Amount  int
	HasNext bool
	After   string
}

type StatementDoc

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

type StatusCoder added in v0.40.0

type StatusCoder interface {
	StatusCode() int
}

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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