dto

package
v0.0.5-alpha05 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthAPIKeyStr                   string = "api_key"
	AuthAWSSigningv4Str             string = "aws_signing_v4"
	AuthAzureDefaultStr             string = "azure_default"
	AuthBasicStr                    string = "basic"
	AuthBearerStr                   string = "bearer"
	AuthCustomStr                   string = "custom"
	AuthInteractiveStr              string = "interactive"
	AuthServiceAccountStr           string = "service_account"
	AuthNullStr                     string = "null_auth"
	DryRunFlagKey                   string = "dryrun"
	ExecutionConcurrencyLimitKey    string = "execution.concurrency.limit"
	AuthCtxKey                      string = "auth"
	APIRequestTimeoutKey            string = "apirequesttimeout"
	CacheKeyCountKey                string = "cachekeycount"
	CacheTTLKey                     string = "metadatattl"
	ClientCredentialsStr            string = "client_credentials"
	ColorSchemeKey                  string = "colorscheme" // deprecated
	ConfigFilePathKey               string = "configfile"
	CPUProfileKey                   string = "cpuprofile"
	CSVHeadersDisableKey            string = "hideheaders"
	DelimiterKey                    string = "delimiter"
	ErrorPresentationKey            string = "errorpresentation"
	IndirectDepthMaxKey             string = "indirect.depth.max"
	DataflowDependencyMaxKey        string = "dataflow.dependency.max"
	DataflowComponentsMaxKey        string = "dataflow.components.max"
	HTTPLogEnabledKey               string = "http.log.enabled"
	HTTPMaxResultsKey               string = "http.response.maxResults"
	HTTPPAgeLimitKey                string = "http.response.pageLimit"
	HTTPProxyHostKey                string = "http.proxy.host"
	HTTPProxyPasswordKey            string = "http.proxy.password" //nolint:gosec // no hardcoded credentials
	HTTPProxyPortKey                string = "http.proxy.port"
	HTTPProxySchemeKey              string = "http.proxy.scheme"
	HTTPProxyUserKey                string = "http.proxy.user"
	CABundleKey                     string = "tls.CABundle"
	AllowInsecureKey                string = "tls.allowInsecure"
	InfilePathKey                   string = "infile"
	LogLevelStrKey                  string = "loglevel"
	OAuth2Str                       string = "oauth2"
	OutfilePathKey                  string = "outfile"
	OutputFormatKey                 string = "output"
	ApplicationFilesRootPathKey     string = "approot"
	ApplicationFilesRootPathModeKey string = "approotfilemode"
	PgSrvAddressKey                 string = "pgsrv.address"
	ExportAliasKey                  string = "export.alias"
	PgSrvLogLevelKey                string = "pgsrv.loglevel"
	PgSrvPortKey                    string = "pgsrv.port"
	PgSrvRawTLSCfgKey               string = "pgsrv.tls"
	ProviderStrKey                  string = "provider"
	QueryCacheSizeKey               string = "querycachesize"
	RegistryRawKey                  string = "registry"
	SessionCtxKey                   string = "session"
	GCCfgRawKey                     string = "gc"
	ACIDCfgRawKey                   string = "acid"
	NamespaceCfgRawKey              string = "namespaces"
	SQLBackendCfgRawKey             string = "sqlBackend"
	DBInternalCfgRawKey             string = "dbInternal"
	StoreTxnCfgRawKey               string = "store.txn"
	TemplateCtxFilePathKey          string = "iqldata"
	TestWithoutAPICallsKey          string = "TestWithoutAPICalls"
	UseNonPreferredAPIsKEy          string = "usenonpreferredapis"
	VarListKey                      string = "var"
	VerboseFlagKey                  string = "verbose"
	ViperCfgFileNameKey             string = "viperconfigfilename"
	WorkOfflineKey                  string = "offline"
)

Variables

This section is empty.

Functions

func GetNamespaceCfg

func GetNamespaceCfg(s string) (map[string]NamespaceCfg, error)

Types

type AuthContexts

type AuthContexts map[string]*AuthCtx

func (AuthContexts) Clone

func (as AuthContexts) Clone() AuthContexts

type AuthCtx

type AuthCtx struct {
	Scopes                  []string       `json:"scopes,omitempty" yaml:"scopes,omitempty"`
	SQLCfg                  *SQLBackendCfg `json:"sqlDataSource" yaml:"sqlDataSource"`
	Type                    string         `json:"type" yaml:"type"`
	ValuePrefix             string         `json:"valuePrefix" yaml:"valuePrefix"`
	ID                      string         `json:"-" yaml:"-"`
	KeyID                   string         `json:"keyID" yaml:"keyID"`
	KeyIDEnvVar             string         `json:"keyIDenvvar" yaml:"keyIDenvvar"`
	KeyFilePath             string         `json:"credentialsfilepath" yaml:"credentialsfilepath"`
	KeyFilePathEnvVar       string         `json:"credentialsfilepathenvvar" yaml:"credentialsfilepathenvvar"`
	KeyEnvVar               string         `json:"credentialsenvvar" yaml:"credentialsenvvar"`
	APIKeyStr               string         `json:"api_key" yaml:"api_key"`
	APISecretStr            string         `json:"api_secret" yaml:"api_secret"`
	Username                string         `json:"username" yaml:"username"`
	Password                string         `json:"password" yaml:"password"`
	EnvVarAPIKeyStr         string         `json:"api_key_var" yaml:"api_key_var"`
	EnvVarAPISecretStr      string         `json:"api_secret_var" yaml:"api_secret_var"`
	EnvVarUsername          string         `json:"username_var" yaml:"username_var"`
	EnvVarPassword          string         `json:"password_var" yaml:"password_var"`
	EncodedBasicCredentials string         `json:"-" yaml:"-"`
	Successor               *AuthCtx       `json:"successor" yaml:"successor"`
	Subject                 string         `json:"sub" yaml:"sub"`
	Active                  bool           `json:"-" yaml:"-"`
	Location                string         `json:"location" yaml:"location"`
	Name                    string         `json:"name" yaml:"name"`
	TokenURL                string         `json:"token_url" yaml:"token_url"`
	GrantType               string         `json:"grant_type" yaml:"grant_type"`
	ClientID                string         `json:"client_id" yaml:"client_id"`
	ClientSecret            string         `json:"client_secret" yaml:"client_secret"`
	ClientIDEnvVar          string         `json:"client_id_env_var" yaml:"client_id_env_var"`
	ClientSecretEnvVar      string         `json:"client_secret_env_var" yaml:"client_secret_env_var"`
	Values                  url.Values     `json:"values" yaml:"values"`
	AuthStyle               int            `json:"auth_style" yaml:"auth_style"`
	AccountID               string         `json:"account_id" yaml:"account_id"`
	AccoountIDEnvVar        string         `json:"account_id_env_var" yaml:"account_id_var"`
}

func GetAuthCtx

func GetAuthCtx(scopes []string, keyFilePath string, keyFileType string) *AuthCtx

func (*AuthCtx) Clone

func (ac *AuthCtx) Clone() *AuthCtx

func (*AuthCtx) GetAuthStyle

func (ac *AuthCtx) GetAuthStyle() int

func (*AuthCtx) GetAwsSessionTokenString

func (ac *AuthCtx) GetAwsSessionTokenString() (string, error)

func (*AuthCtx) GetClientID

func (ac *AuthCtx) GetClientID() (string, error)

func (*AuthCtx) GetClientSecret

func (ac *AuthCtx) GetClientSecret() (string, error)

func (*AuthCtx) GetCredentialsBytes

func (ac *AuthCtx) GetCredentialsBytes() ([]byte, error)

func (*AuthCtx) GetCredentialsSourceDescriptorString

func (ac *AuthCtx) GetCredentialsSourceDescriptorString() string

func (*AuthCtx) GetGrantType

func (ac *AuthCtx) GetGrantType() string

func (*AuthCtx) GetInlineBasicCredentials

func (ac *AuthCtx) GetInlineBasicCredentials() string

func (*AuthCtx) GetKeyIDString

func (ac *AuthCtx) GetKeyIDString() (string, error)

func (*AuthCtx) GetSQLCfg

func (ac *AuthCtx) GetSQLCfg() (SQLBackendCfg, bool)

func (*AuthCtx) GetSuccessor

func (ac *AuthCtx) GetSuccessor() (*AuthCtx, bool)

func (*AuthCtx) GetTokenURL

func (ac *AuthCtx) GetTokenURL() string

func (*AuthCtx) GetValues

func (ac *AuthCtx) GetValues() url.Values

func (*AuthCtx) HasKey

func (ac *AuthCtx) HasKey() bool

func (*AuthCtx) InferAuthType

func (ac *AuthCtx) InferAuthType(authTypeRequested string) string

type DBMSInternalCfg

type DBMSInternalCfg struct {
	ShowRegex   string `json:"showRegex" yaml:"showRegex"`
	TableRegex  string `json:"tableRegex" yaml:"tableRegex"`
	SchemaRegex string `json:"schemaRegex" yaml:"schemaRegex"`
	FuncRegex   string `json:"funcRegex" yaml:"funcRegex"`
}

func GetDBMSInternalCfg

func GetDBMSInternalCfg(s string) (DBMSInternalCfg, error)

type DataFlowCfg

type DataFlowCfg interface {
	GetMaxDependencies() int
	GetMaxComponents() int
}

func NewDataFlowCfg

func NewDataFlowCfg(maxDependencies int, maxComponents int) DataFlowCfg

type GCCfg

type GCCfg struct {
	IsEager bool `json:"isEager" yaml:"isEager"`
}

func GetGCCfg

func GetGCCfg(s string) (GCCfg, error)

type KStoreCfg

type KStoreCfg struct {
	IsPlaceholder bool `json:"isPlaceholder" yaml:"isPlaceholder"`
}

func GetKStoreCfg

func GetKStoreCfg(s string) (KStoreCfg, error)

type NamespaceCfg

type NamespaceCfg struct {
	RegexpStr         string `json:"regex" yaml:"regex"`
	TTL               int    `json:"ttl" yaml:"ttl"`
	NamespaceTemplate string `json:"template" yaml:"template"`
}

func (NamespaceCfg) GetRegex

func (nc NamespaceCfg) GetRegex() (*regexp.Regexp, error)

func (NamespaceCfg) GetTemplate

func (nc NamespaceCfg) GetTemplate() (*template.Template, error)

type OutputPacket

type OutputPacket interface {
	GetRows() map[string]map[string]interface{}
	GetRawRows() map[int]map[int]interface{}
	GetColumnNames() []string
	GetColumnOIDs() []oid.Oid
	GetMessages() []string
}

func NewStandardOutputPacket

func NewStandardOutputPacket(
	rowMaps map[string]map[string]interface{},
	rawRows map[int]map[int]interface{},
	columnNames []string,
	columnOIDs []oid.Oid,
	messages []string,
) OutputPacket

type PgTLSCfg

type PgTLSCfg struct {
	KeyFilePath  string   `json:"keyFilePath" yaml:"keyFilePath"`
	CertFilePath string   `json:"certFilePath" yaml:"certFilePath"`
	KeyContents  string   `json:"keyContents" yaml:"keyContents"`
	CertContents string   `json:"certContents" yaml:"certContents"`
	ClientCAs    []string `json:"clientCAs" yaml:"clientCAs"`
}

func (PgTLSCfg) GetKeyPair

func (pc PgTLSCfg) GetKeyPair() (tls.Certificate, error)

type RuntimeCtx

type RuntimeCtx struct {
	APIRequestTimeout            int
	AuthRaw                      string
	CABundle                     string
	AllowInsecure                bool
	CacheKeyCount                int
	CacheTTL                     int
	ConfigFilePath               string
	CPUProfile                   string
	CSVHeadersDisable            bool
	Delimiter                    string
	DryRunFlag                   bool
	ErrorPresentation            string
	ExecutionConcurrencyLimit    int
	HTTPLogEnabled               bool
	HTTPMaxResults               int
	HTTPPageLimit                int
	HTTPProxyHost                string
	HTTPProxyPassword            string
	HTTPProxyPort                int
	HTTPProxyScheme              string
	HTTPProxyUser                string
	IndirectDepthMax             int
	DataflowComponentsMax        int
	DataflowDependencyMax        int
	InfilePath                   string
	LogLevelStr                  string
	OutfilePath                  string
	OutputFormat                 string
	ApplicationFilesRootPath     string
	ApplicationFilesRootPathMode uint32
	PGSrvAddress                 string
	PGSrvLogLevel                string
	PGSrvPort                    int
	PGSrvRawTLSCfg               string
	ExportAlias                  string
	ProviderStr                  string
	RegistryRaw                  string
	SessionCtxRaw                string
	SQLBackendCfgRaw             string
	DBInternalCfgRaw             string
	NamespaceCfgRaw              string
	StoreTxnCfgRaw               string
	GCCfgRaw                     string
	ACIDCfgRaw                   string
	QueryCacheSize               int
	TemplateCtxFilePath          string
	TestWithoutAPICalls          bool
	UseNonPreferredAPIs          bool
	VarList                      []string
	VerboseFlag                  bool
	ViperCfgFileName             string
	WorkOffline                  bool
}

func (RuntimeCtx) Copy

func (rc RuntimeCtx) Copy() RuntimeCtx

func (*RuntimeCtx) Set

func (rc *RuntimeCtx) Set(key string, val string) error

type SQLBackendCfg

type SQLBackendCfg struct {
	DBEngine              string             `json:"dbEngine" yaml:"dbEngine"`
	DSN                   string             `json:"dsn" yaml:"dsn"`
	DSNEnvVar             string             `json:"dsnEnvVar" yaml:"dsnEnvVar"`
	Schemata              SQLBackendSchemata `json:"schemata" yaml:"schemata"`
	DbInitFilePath        string             `json:"dbInitFilepath" yaml:"dbInitFilepath"` //nolint:stylecheck,lll // parity with JSON key
	SQLSystem             string             `json:"sqlDialect" yaml:"sqlDialect"`
	SchemaType            string             `json:"schemaType" yaml:"schemaType"`
	InitMaxRetries        int                `json:"initMaxRetries" yaml:"initMaxRetries"`
	InitRetryInitialDelay int                `json:"initRetryInitialDelay" yaml:"initRetryInitialDelay"`
}

func GetSQLBackendCfg

func GetSQLBackendCfg(s string) (SQLBackendCfg, error)

func (SQLBackendCfg) GetDSN

func (sqlCfg SQLBackendCfg) GetDSN() string

func (SQLBackendCfg) GetDatabaseName

func (sqlCfg SQLBackendCfg) GetDatabaseName() (string, error)

func (SQLBackendCfg) GetIntelViewSchemaName

func (sqlCfg SQLBackendCfg) GetIntelViewSchemaName() string

func (SQLBackendCfg) GetOpsViewSchemaName

func (sqlCfg SQLBackendCfg) GetOpsViewSchemaName() string

func (SQLBackendCfg) GetSQLDialect

func (sqlCfg SQLBackendCfg) GetSQLDialect() string

func (SQLBackendCfg) GetSchemaType

func (sqlCfg SQLBackendCfg) GetSchemaType() string

func (SQLBackendCfg) GetTableSchemaName

func (sqlCfg SQLBackendCfg) GetTableSchemaName() string

type SQLBackendSchemata

type SQLBackendSchemata struct {
	TableSchema     string `json:"tableSchema" yaml:"tableSchema"`
	IntelViewSchema string `json:"intelViewSchema" yaml:"intelViewSchema"`
	OpsViewSchema   string `json:"opsViewSchema" yaml:"opsViewSchema"`
}

type SessionContext

type SessionContext interface {
	Clone() SessionContext
	GetIsolationLevel() constants.IsolationLevel
	UpdateIsolationLevel(string) error
	GetRollbackType() constants.RollbackType
	UpdateRollbackType(string) error
}

func NewSessionContext

func NewSessionContext(cfgStr string) (SessionContext, error)

type SessionCtxConfig

type SessionCtxConfig struct {
	IsolationLevel string `json:"isolation_level" yaml:"isolation_level"`
	RollbackType   string `json:"rollback_type" yaml:"rollback_type"`
}

type TxnCoordinatorCfg

type TxnCoordinatorCfg struct {
	MaxTxnDepth *int `json:"maxTransactionDepth" yaml:"maxTransactionDepth"`
}

func GetTxnCoordinatorCfgCfg

func GetTxnCoordinatorCfgCfg(s string) (TxnCoordinatorCfg, error)

func (TxnCoordinatorCfg) GetMaxTxnDepth

func (t TxnCoordinatorCfg) GetMaxTxnDepth() int

Jump to

Keyboard shortcuts

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