repository

package
v0.0.0-...-b8c384c Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2022 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Credential

type Credential struct {
	// TODO: support different credential types
	Data map[string][]byte
}

type CredentialResolver

type CredentialResolver interface {
	ResolveCredential(ctx context.Context, namespace, name string) (Credential, error)
}

type Function

type Function interface {
	Name() string
	GetFunction() (*v1alpha1.Function, error)
}

Function is an abstract function.

type FunctionRepository

type FunctionRepository interface {
	// TODO: Should repository understand functions, or just packages (and function is just a package in an OCI repo?)
	ListFunctions(ctx context.Context) ([]Function, error)
}

type PackageDraft

type PackageDraft interface {
	UpdateResources(ctx context.Context, new *v1alpha1.PackageRevisionResources, task *v1alpha1.Task) error
	// Updates desired lifecycle of the package. The lifecycle is applied on Close.
	UpdateLifecycle(ctx context.Context, new v1alpha1.PackageRevisionLifecycle) error
	// Finish round of updates.
	Close(ctx context.Context) (PackageRevision, error)
}

type PackageResources

type PackageResources struct {
	Contents map[string]string
}

TODO: "sigs.k8s.io/kustomize/kyaml/filesys" FileSystem?

type PackageRevision

type PackageRevision interface {
	Name() string
	GetPackageRevision() (*v1alpha1.PackageRevision, error)
	// TODO: return PackageResources or filesystem abstraction?
	GetResources(ctx context.Context) (*v1alpha1.PackageRevisionResources, error)
	GetUpstreamLock() (kptfile.Upstream, kptfile.UpstreamLock, error)
}

PackageRevision is an abstract package version. We have a single object for both Revision and Resources, because conceptually they are one object. The best way we've found (so far) to represent them in k8s is as two resources, but they map to the same object. Interesting reading: https://github.com/zecke/Kubernetes/blob/master/docs/devel/api-conventions.md#differing-representations

type Repository

type Repository interface {
	ListPackageRevisions(ctx context.Context) ([]PackageRevision, error)

	// CreatePackageRevision creates a new package revision
	CreatePackageRevision(ctx context.Context, obj *v1alpha1.PackageRevision) (PackageDraft, error)

	// DeletePackageRevision deletes a package revision
	DeletePackageRevision(ctx context.Context, old PackageRevision) error

	// UpdatePackage updates a package
	UpdatePackage(ctx context.Context, old PackageRevision) (PackageDraft, error)
}

Repository is the interface for interacting with packages in repositories TODO: we may need interface to manage repositories too. Stay tuned.

type ResourceItem

type ResourceItem struct {
	Path     string
	Contents string
}

type Resources

type Resources struct {
	Items []*ResourceItem
}

func (*Resources) AsResourceList

func (r *Resources) AsResourceList() (map[string]string, error)

type UserInfo

type UserInfo struct {
	Name  string
	Email string
}

type UserInfoProvider

type UserInfoProvider interface {
	// GetUserInfo returns the information about the user on whose behalf the request is being
	// processed, if any. If user cannot be determnined, returns nil.
	GetUserInfo(ctx context.Context) *UserInfo
}

UserInfoProvider providers name of the authenticated user on whose behalf the request is being processed.

Jump to

Keyboard shortcuts

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