Documentation
¶
Overview ¶
Package util provides shared utilities for the CLI.
Index ¶
- func CELExpressionReferencesFields(celCmd string, fieldNames []string, options ...cel.EnvOption) (bool, error)
- func GetClient(ctx context.Context) (*api.Client, error)
- func GetClientCertificate() (tls.Certificate, error)
- func GetContext() (context.Context, context.CancelFunc)
- func GetHTTPClient() (*http.Client, error)
- func InitCELProgram(celCmd string, options ...cel.EnvOption) (*cel.Program, error)
- func ReadPassword(prompt string) (string, error)
- func SaveSessionKeysAndLogout(ctx context.Context, client *api.Client)
- type ColumnAlias
- type ColumnAliasResolver
- type PermissionJSONOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CELExpressionReferencesFields ¶ added in v0.4.0
func CELExpressionReferencesFields(celCmd string, fieldNames []string, options ...cel.EnvOption) (bool, error)
CELExpressionReferencesFields checks if a CEL expression references any of the given field names. Returns true if the expression references at least one of the specified fields.
func GetClientCertificate ¶ added in v0.3.2
func GetClientCertificate() (tls.Certificate, error)
func GetContext ¶
func GetContext() (context.Context, context.CancelFunc)
func GetHTTPClient ¶ added in v0.4.2
func InitCELProgram ¶ added in v0.3.0
InitCELProgram - Initialize a CEL program with given CEL command and a set of environments
func ReadPassword ¶ added in v0.2.0
ReadPassword reads a Password interactively or via Pipe
Types ¶
type ColumnAlias ¶ added in v0.5.0
ColumnAlias declares a canonical column name together with the legacy input forms that should resolve to it. Used by list commands to accept snake_case (canonical), PascalCase, and lowercased-concat forms uniformly in --column and --filter flags.
type ColumnAliasResolver ¶ added in v0.5.0
type ColumnAliasResolver struct {
// contains filtered or unexported fields
}
ColumnAliasResolver normalizes user-supplied column names to their canonical form via case-insensitive lookup against name+aliases.
func NewColumnAliasResolver ¶ added in v0.5.0
func NewColumnAliasResolver(specs []ColumnAlias) *ColumnAliasResolver
func (*ColumnAliasResolver) Canonical ¶ added in v0.5.0
func (r *ColumnAliasResolver) Canonical() []string
Canonical returns the canonical column names in declaration order. Useful for building --column flag help text and default value slices.
func (*ColumnAliasResolver) Normalize ¶ added in v0.5.0
func (r *ColumnAliasResolver) Normalize(input string) (string, error)
Normalize maps an input column name to its canonical form. Returns an error listing the valid canonical names if the input matches nothing.
func (*ColumnAliasResolver) NormalizeAll ¶ added in v0.5.0
func (r *ColumnAliasResolver) NormalizeAll(inputs []string) ([]string, error)
NormalizeAll normalizes a slice of input column names, returning the canonical-name slice or the first error encountered.
type PermissionJSONOutput ¶ added in v0.4.2
type PermissionJSONOutput struct {
ID *string `json:"id,omitempty"`
Aco *string `json:"aco,omitempty"`
AcoForeignKey *string `json:"aco_foreign_key,omitempty"`
Aro *string `json:"aro,omitempty"`
AroForeignKey *string `json:"aro_foreign_key,omitempty"`
Type *int `json:"type,omitempty"`
CreatedTimestamp *time.Time `json:"created_timestamp,omitempty"`
ModifiedTimestamp *time.Time `json:"modified_timestamp,omitempty"`
}