controller

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

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

func NewWithDependencies

func NewWithDependencies(ctx context.Context, config configuration.Config, db DB, c com.Provider) (*Controller, error)

func (*Controller) AdminListResourceIds added in v0.0.9

func (this *Controller) AdminListResourceIds(tokenStr string, topicId string, options model.ListOptions) (ids []string, err error, code int)

func (*Controller) CheckMultiplePermissions

func (this *Controller) CheckMultiplePermissions(tokenStr string, topicId string, ids []string, permissions ...model.Permission) (access map[string]bool, err error, code int)

func (*Controller) CheckPermission

func (this *Controller) CheckPermission(tokenStr string, topicId string, id string, permissions ...model.Permission) (access bool, err error, code int)

func (*Controller) GetResource

func (this *Controller) GetResource(tokenStr string, topicId string, id string) (result model.Resource, err error, code int)

func (*Controller) GetTopic

func (this *Controller) GetTopic(tokenStr string, id string) (result model.Topic, err error, code int)

func (*Controller) HandleReaderError

func (this *Controller) HandleReaderError(topic model.Topic, err error)

func (*Controller) HandleReceivedCommand

func (this *Controller) HandleReceivedCommand(topic model.Topic, resource model.Resource, t time.Time) error

func (*Controller) HandleResourceDelete

func (this *Controller) HandleResourceDelete(topic model.Topic, id string) error

func (*Controller) HandleResourceUpdate

func (this *Controller) HandleResourceUpdate(topic model.Topic, id string, owner string) error

func (*Controller) ListAccessibleResourceIds

func (this *Controller) ListAccessibleResourceIds(tokenStr string, topicId string, options model.ListOptions, permission ...model.Permission) (ids []string, err error, code int)

func (*Controller) ListResourcesWithAdminPermission

func (this *Controller) ListResourcesWithAdminPermission(tokenStr string, topicId string, options model.ListOptions) (result []model.Resource, err error, code int)

func (*Controller) ListTopics

func (this *Controller) ListTopics(tokenStr string, options model.ListOptions) (result []model.Topic, err error, code int)

func (*Controller) RemoveResource added in v0.0.5

func (this *Controller) RemoveResource(tokenStr string, topicId string, id string) (err error, code int)

func (*Controller) RemoveTopic

func (this *Controller) RemoveTopic(tokenStr string, id string) (err error, code int)

func (*Controller) SetPermission

func (this *Controller) SetPermission(tokenStr string, topicId string, id string, permissions model.ResourcePermissions, options model.SetPermissionOptions) (result model.ResourcePermissions, err error, code int)

func (*Controller) SetTopic

func (this *Controller) SetTopic(tokenStr string, topic model.Topic) (result model.Topic, err error, code int)

type DB

type DB = database.Database

type Done

type Done struct {
	ResourceKind string `json:"resource_kind"`
	ResourceId   string `json:"resource_id"`
	Handler      string `json:"handler"` // == github.com/SENERGY-Platform/permission-search
	Command      string `json:"command"` // PUT | DELETE | RIGHTS
}

type LogNotifier

type LogNotifier struct{}

func (LogNotifier) SendMessage

func (this LogNotifier) SendMessage(message client.Message) error

type TopicHandler added in v0.0.13

type TopicHandler struct {
	model.Topic
	// contains filtered or unexported fields
}

func (*TopicHandler) Close added in v0.0.13

func (this *TopicHandler) Close() (err error)

func (*TopicHandler) SendPermissions added in v0.0.13

func (this *TopicHandler) SendPermissions(ctx context.Context, id string, permissions model.ResourcePermissions) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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