targetref

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTarget

func GetTarget(ctx context.Context, c client.Client, target userv1.TargetRef) (client.Object, error)

GetTarget returns the target object for the given TargetRef. Returns an error if the target is not supported.

func NewObjectFromRef added in v0.20.0

func NewObjectFromRef(target userv1.TargetRef) (client.Object, error)

NewObjectFromRef returns a new object for the given TargetRef or an error if the target is not supported.

Types

type UserAccessor

type UserAccessor interface {
	// EnsureUser adds the user to the object if it is not already present.
	// Returns true if the user was added.
	// Uses the prefix where applicable.
	EnsureUser(prefix, user string) (added bool)
	// HasUser returns true if the user is present in the object.
	// Uses the prefix where applicable.
	HasUser(prefix, user string) bool
}

UserAccessor is an interface for accessing users from objects supported by this project.

func NewUserAccessor

func NewUserAccessor(obj client.Object) (UserAccessor, error)

NewUserAccessor returns a UserAccessor for the given object or an error if the object is not supported.

Jump to

Keyboard shortcuts

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