worker

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitEventHandling

func InitEventHandling(ctx context.Context, config configuration.Config, worker *Worker) (err error)

func UseJsonPath

func UseJsonPath(msg []byte, feature configuration.Feature) (result interface{}, err error)

Types

type Query

type Query interface {
	GetClient() *opensearch.Client
	GetResourceEntry(kind string, resource string) (result model.Entry, version model.ResourceVersion, err error)
	ResourceExists(kind string, resource string) (exists bool, err error)
}

type Worker

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

func New

func New(ctx context.Context, config configuration.Config, query Query) (result *Worker, err error)

func (*Worker) DeleteFeatures

func (this *Worker) DeleteFeatures(kind string, command model.CommandWrapper) (err error)

func (*Worker) DeleteGroupRight

func (this *Worker) DeleteGroupRight(kind string, resource string, group string) (err error)

func (*Worker) DeleteUserRight

func (this *Worker) DeleteUserRight(kind string, resource string, user string) (err error)

func (*Worker) GetAnnotationHandler

func (this *Worker) GetAnnotationHandler(annotationTopic string, resources []string) func(delivery []byte) error

func (*Worker) GetClient

func (this *Worker) GetClient() *opensearch.Client

func (*Worker) GetQuery

func (this *Worker) GetQuery() Query

func (*Worker) GetResourceCommandHandler

func (this *Worker) GetResourceCommandHandler(resourceName string) func(delivery []byte) error

func (*Worker) HandleAnnotationMsg

func (this *Worker) HandleAnnotationMsg(annotationTopic string, resource string, msg []byte) error

func (*Worker) HandlePermissionCommand

func (this *Worker) HandlePermissionCommand(msg []byte) (err error)

func (*Worker) MsgToAnnotations

func (this *Worker) MsgToAnnotations(kind string, annotationTopic string, msg []byte) (result map[string]interface{}, err error)

func (*Worker) MsgToFeatures

func (this *Worker) MsgToFeatures(kind string, msg []byte) (result map[string]interface{}, err error)

func (*Worker) MsgToRights

func (this *Worker) MsgToRights(msg []byte) (result *model.ResourceRightsBase, err error)

func (*Worker) SendDone

func (this *Worker) SendDone(msg model.Done) error

func (*Worker) SetGroupRight

func (this *Worker) SetGroupRight(kind string, resource string, group string, rights string) (err error)

func (*Worker) SetUserRight

func (this *Worker) SetUserRight(kind string, resource string, user string, rights string) (err error)

func (*Worker) UpdateFeatures

func (this *Worker) UpdateFeatures(kind string, msg []byte, command model.CommandWrapper) (err error)

func (*Worker) UpdateRights

func (this *Worker) UpdateRights(kind string, msg []byte, command model.CommandWrapper) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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