resource

package
v0.62.4 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package resource contains the upgraded remote resolution framework. It is equivalent to `pkg/resolution/resource`. This was necessary to ensure backwards compatibility with the existing framework.

This package is subject to further refactoring and changes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicRequest

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

func (*BasicRequest) ResolverPayload

func (req *BasicRequest) ResolverPayload() ResolverPayload

Params are the map of parameters associated with this request

type CRDRequester

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

CRDRequester implements the Requester interface using ResolutionRequest CRDs.

func NewCRDRequester

func NewCRDRequester(clientset rrclient.Interface, lister rrlisters.ResolutionRequestLister) *CRDRequester

NewCRDRequester returns an implementation of Requester that uses ResolutionRequest CRD objects to mediate between the caller who wants a resource (e.g. Tekton Pipelines) and the responder who can fetch it (e.g. the gitresolver)

func (*CRDRequester) Submit

func (r *CRDRequester) Submit(ctx context.Context, resolver ResolverName, req Request) (ResolvedResource, error)

Submit constructs a ResolutionRequest object and submits it to the kubernetes cluster, returning any errors experienced while doing so. If ResolutionRequest is succeeded then it returns the resolved data.

type OwnedRequest

type OwnedRequest = common.OwnedRequest

OwnedRequest is implemented by any type implementing Request that also needs to express a Kubernetes OwnerRef relationship as part of the request being made.

type Request

type Request interface {
	ResolverPayload() ResolverPayload
}

Request is implemented by any type that represents a single request for a remote resource. Implementing this interface gives the underlying type an opportunity to control properties such as whether the name of a request has particular properties, whether the request should be made to a specific namespace, and precisely which parameters should be included.

func NewRequest

func NewRequest(resolverPayload ResolverPayload) Request

NewRequest returns an instance of a BasicRequestV2 with the given resolverPayload.

type RequestRemoteResource

type RequestRemoteResource interface {
	ResolverPayload() ResolverPayload
}

RequestRemoteResource is implemented by any type that represents a single request for a remote resource. Implementing this interface gives the underlying type an opportunity to control properties such as whether the name of a request has particular properties, whether the request should be made to a specific namespace, and precisely which parameters should be included.

type Requester

type Requester interface {
	// Submit accepts the name of a resolver to submit a request to
	// along with the request itself.
	Submit(ctx context.Context, name ResolverName, req Request) (ResolvedResource, error)
}

Requester is the interface implemented by a type that knows how to submit requests for remote resources.

type ResolutionRequester

type ResolutionRequester interface {
	// SubmitResolutionRequest accepts the name of a resolver to submit a request to
	// along with the request itself.
	SubmitResolutionRequest(ctx context.Context, name ResolverName, req RequestRemoteResource) (ResolvedResource, error)
}

ResolutionRequester is the interface implemented by a type that knows how to submit requests for remote resources.

type ResolvedResource

type ResolvedResource = common.ResolvedResource

ResolvedResource is implemented by any type that offers a read-only view of the data and metadata of a resolved remote resource.

type ResolverName

type ResolverName = common.ResolverName

ResolverName is the type used for a resolver's name and is mostly used to ensure the function signatures that accept it are clear on the purpose for the given string.

type ResolverPayload

type ResolverPayload struct {
	Name           string
	Namespace      string
	ResolutionSpec *v1beta1.ResolutionRequestSpec
}

ResolverPayload is the struct which holds the payload to create the Resolution Request CRD.

Jump to

Keyboard shortcuts

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