trait

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTraitNotFound      = errors.New("trait not found")
	ErrTraitAlreadyExists = errors.New("trait already exists")
)

Functions

This section is empty.

Types

type Service

type Service interface {
	CreateTrait(ctx context.Context, namespaceName string, t *openchoreov1alpha1.Trait) (*openchoreov1alpha1.Trait, error)
	UpdateTrait(ctx context.Context, namespaceName string, t *openchoreov1alpha1.Trait) (*openchoreov1alpha1.Trait, error)
	ListTraits(ctx context.Context, namespaceName string, opts services.ListOptions) (*services.ListResult[openchoreov1alpha1.Trait], error)
	GetTrait(ctx context.Context, namespaceName, traitName string) (*openchoreov1alpha1.Trait, error)
	DeleteTrait(ctx context.Context, namespaceName, traitName string) error
	GetTraitSchema(ctx context.Context, namespaceName, traitName string) (map[string]any, error)
}

Service defines the trait service interface.

func NewService

func NewService(k8sClient client.Client, logger *slog.Logger) Service

NewService creates a new trait service without authorization.

func NewServiceWithAuthz

func NewServiceWithAuthz(k8sClient client.Client, authzPDP authz.PDP, logger *slog.Logger) Service

NewServiceWithAuthz creates a trait service with authorization checks.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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