Help us shape the future of Go! Take the 2026 Go Developer Survey

common

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2025 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
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 */
	// NameAndUIDField is the string used to fetch only name and
	// UID in an API call
	NameAndUIDField = "records.name,records.uid"
	// AllNamespacesResultsParent is the parent path used for listing results across all namespaces.
	AllNamespacesResultsParent = "-/results/-"
)

Variables

This section is empty.

Functions

func BuildFilterString

func BuildFilterString(opts FilterOptions) string

BuildFilterString constructs the filter string for the ListRecordsRequest

func FormatAge

func FormatAge(t *metav1.Time, c clockwork.Clock) string

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

func ValidateLabels(labels string) error

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
}

Params interface provides

type Response

type Response struct {
	// contains filtered or unexported fields
}

Response represents a generic API response containing the raw body bytes.

func NewResponse

func NewResponse(body []byte) *Response

NewResponse creates a new Response with the given body bytes.

func (*Response) Body

func (r *Response) Body() []byte

Body returns the raw response body as a byte slice.

func (*Response) ProtoUnmarshal

func (r *Response) ProtoUnmarshal(out proto.Message) error

ProtoUnmarshal unmarshals the response body into the provided proto.Message.

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 endpoint path.

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) SetAPIPath

func (p *ResultsParams) SetAPIPath(apiPath string)

SetAPIPath sets the API endpoint path.

Parameters:

  • apiPath: The API endpoint path 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) SetSkipTLSVerify

func (p *ResultsParams) SetSkipTLSVerify(skipTLSVerify bool)

SetSkipTLSVerify sets whether TLS certificate verification should be skipped.

Parameters:

  • skipTLSVerify: Boolean indicating whether to skip TLS verification.

func (*ResultsParams) SetToken

func (p *ResultsParams) SetToken(token string)

SetToken sets the authentication token for API requests.

Parameters:

  • token: The authentication token to set.

func (*ResultsParams) SkipTLSVerify

func (p *ResultsParams) SkipTLSVerify() bool

SkipTLSVerify returns whether TLS certificate verification should be skipped.

func (*ResultsParams) Token

func (p *ResultsParams) Token() string

Token returns the authentication token for API requests.

type Stream

type Stream struct {
	In  io.Reader
	Out io.Writer
	Err io.Writer
}

Stream for input and output

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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