Documentation
¶
Index ¶
- Constants
- func BuildConfigContextInfo(context *api.Context) (configContextName, clusterName, userName string, err error)
- func BuildFilterString(opts FilterOptions) string
- func FormatAge(t *metav1.Time, c clockwork.Clock) string
- func ValidateLabels(labels string) error
- type FilterOptions
- type Params
- type ResultsParams
- func (p *ResultsParams) APIPath() string
- func (p *ResultsParams) Host() string
- func (p *ResultsParams) KubeConfigPath() string
- func (p *ResultsParams) KubeContext() string
- func (p *ResultsParams) Namespace() string
- func (p *ResultsParams) RESTClient() *client.RESTClient
- func (p *ResultsParams) SetAPIPath(path string)
- func (p *ResultsParams) SetHost(host string)
- func (p *ResultsParams) SetKubeConfigPath(path string)
- func (p *ResultsParams) SetKubeContext(context string)
- func (p *ResultsParams) SetNamespace(ns string)
- func (p *ResultsParams) SetRESTClient(client *client.RESTClient)
- func (p *ResultsParams) SetSkipTLSVerify(skip bool)
- func (p *ResultsParams) SetToken(token string)
- func (p *ResultsParams) SkipTLSVerify() bool
- func (p *ResultsParams) Token() string
- type Stream
Constants ¶
const ( // ResourceTypeTaskRun is the string representation of a TaskRun resource ResourceTypeTaskRun = "taskrun" // ResourceTypePipelineRun is the string representation of a PipelineRun resource ResourceTypePipelineRun = "pipelinerun" // ListFields is the string used to fetch partial response // for the list command in the API calls ListFields = "" /* 134-byte string literal not displayed */ // NameUIDAndDataField is the string used to fetch name, UID and Data NameUIDAndDataField = "records.name,records.uid,records.data.value" // AllNamespacesResultsParent is the parent path used for listing results across all namespaces. AllNamespacesResultsParent = "-/results/-" )
Variables ¶
This section is empty.
Functions ¶
func BuildConfigContextInfo ¶ added in v0.17.0
func BuildConfigContextInfo(context *api.Context) (configContextName, clusterName, userName string, err error)
BuildConfigContextInfo extracts cluster name, username, and constructs the config context name from a Kubernetes context.
Parameters:
- context: The Kubernetes context object from kubeconfig
Returns:
- configContextName: The config context name in format "tekton-results-config/{cluster}/{user}".
- clusterName: The cluster name from the context.
- userName: The extracted username (part before "/" if present).
- error: An error if the context is missing cluster/user information.
func BuildFilterString ¶
func BuildFilterString(opts FilterOptions) string
BuildFilterString constructs the filter string for the ListRecordsRequest
func FormatAge ¶
FormatAge returns a human-readable string representation of how long ago a timestamp occurred. The output format varies based on duration: seconds (<1m), minutes (<1h), hours (<24h), or days.
func ValidateLabels ¶
ValidateLabels validates the format of the provided labels string. Labels should be in the format "key=value" or "key=value,key2=value2". Returns an error if the format is invalid.
Types ¶
type FilterOptions ¶
type FilterOptions interface {
GetLabel() string
GetResourceName() string
GetPipelineRun() string
GetResourceType() string
GetUID() string
}
FilterOptions defines the interface for filter options
type Params ¶
type Params interface {
// SetKubeConfigPath uses the kubeconfig path to instantiate tekton
// returned by Clientset function
SetKubeConfigPath(string)
KubeConfigPath() string
// SetKubeContext extends the specificity of the above SetKubeConfigPath
// by using a context other than the default context in the given kubeconfig
SetKubeContext(string)
KubeContext() string
// SetNamespace can be used to store the namespace parameter that is needed
// by most commands
SetNamespace(string)
Namespace() string
// SetHost can be used to store the host parameter that is needed
// by most commands
SetHost(string)
Host() string
// SetToken can be used to store the token parameter that is needed
// by most commands
SetToken(string)
Token() string
// SetApiPath can be used to store the api-path parameter that is needed
// by most commands
SetAPIPath(string)
APIPath() string
// SetSkipTlsVerify can be used to store the api-path parameter that is needed
// by most commands
SetSkipTLSVerify(bool)
SkipTLSVerify() bool
// Client access method for dependency injection
// Returns REST client - from which log/record clients are created
SetRESTClient(client *client.RESTClient)
RESTClient() *client.RESTClient
}
Params interface provides
type ResultsParams ¶
type ResultsParams struct {
// contains filtered or unexported fields
}
ResultsParams holds configuration parameters for interacting with Kubernetes and API endpoints.
func (*ResultsParams) APIPath ¶
func (p *ResultsParams) APIPath() string
APIPath returns the API path prefix.
func (*ResultsParams) Host ¶
func (p *ResultsParams) Host() string
Host returns the API server host address.
func (*ResultsParams) KubeConfigPath ¶
func (p *ResultsParams) KubeConfigPath() string
KubeConfigPath returns the path to the Kubernetes configuration file.
func (*ResultsParams) KubeContext ¶
func (p *ResultsParams) KubeContext() string
KubeContext returns the Kubernetes context name.
func (*ResultsParams) Namespace ¶
func (p *ResultsParams) Namespace() string
Namespace returns the current Kubernetes namespace.
func (*ResultsParams) RESTClient ¶ added in v0.17.0
func (p *ResultsParams) RESTClient() *client.RESTClient
RESTClient returns the injected REST client
func (*ResultsParams) SetAPIPath ¶
func (p *ResultsParams) SetAPIPath(path string)
SetAPIPath sets the API path prefix.
Parameters:
- path: The API path prefix to set.
func (*ResultsParams) SetHost ¶
func (p *ResultsParams) SetHost(host string)
SetHost sets the API server host address.
Parameters:
- host: The host address to set.
func (*ResultsParams) SetKubeConfigPath ¶
func (p *ResultsParams) SetKubeConfigPath(path string)
SetKubeConfigPath sets the path to the Kubernetes configuration file.
Parameters:
- path: The file path to the Kubernetes configuration.
func (*ResultsParams) SetKubeContext ¶
func (p *ResultsParams) SetKubeContext(context string)
SetKubeContext sets the Kubernetes context name.
Parameters:
- context: The name of the Kubernetes context to use.
func (*ResultsParams) SetNamespace ¶
func (p *ResultsParams) SetNamespace(ns string)
SetNamespace sets the Kubernetes namespace.
Parameters:
- ns: The namespace to set. If empty, the default namespace from kubeconfig will be used.
func (*ResultsParams) SetRESTClient ¶ added in v0.17.0
func (p *ResultsParams) SetRESTClient(client *client.RESTClient)
SetRESTClient injects a REST client
func (*ResultsParams) SetSkipTLSVerify ¶
func (p *ResultsParams) SetSkipTLSVerify(skip bool)
SetSkipTLSVerify sets whether TLS verification should be skipped.
Parameters:
- skip: Whether to skip TLS verification.
func (*ResultsParams) SetToken ¶
func (p *ResultsParams) SetToken(token string)
SetToken sets the authentication token.
Parameters:
- token: The authentication token to set.
func (*ResultsParams) SkipTLSVerify ¶
func (p *ResultsParams) SkipTLSVerify() bool
SkipTLSVerify returns whether TLS verification should be skipped.
func (*ResultsParams) Token ¶
func (p *ResultsParams) Token() string
Token returns the authentication token.