controller

package
v0.0.3 Latest Latest
Warning

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

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

Documentation

Overview

* Copyright 2020 InfAI (CC SES) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *

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 New

func New(config config.Config, db database.Database, security Security, producer Producer) (ctrl *Controller, err error)

func (*Controller) CheckAccessToImportType

func (this *Controller) CheckAccessToImportType(jwt auth.Token, id string, action model.AuthAction) (err error, errCode int)

func (*Controller) CreateImportType

func (this *Controller) CreateImportType(importType model.ImportType, jwt auth.Token) (result model.ImportType, err error, code int)

func (*Controller) DeleteImportType

func (this *Controller) DeleteImportType(id string, jwt auth.Token) (err error, errCode int)

func (*Controller) DeleteImportTypeFromDB

func (this *Controller) DeleteImportTypeFromDB(id string) (err error)

func (*Controller) DeleteUser

func (this *Controller) DeleteUser(userId string) error

func (*Controller) ReadImportType

func (this *Controller) ReadImportType(id string, jwt auth.Token) (result model.ImportType, err error, errCode int)

func (*Controller) Republish

func (this *Controller) Republish() error

func (*Controller) SetImportType

func (this *Controller) SetImportType(importType model.ImportType, jwt auth.Token) (err error, errCode int)

func (*Controller) SetImportTypeInDB

func (this *Controller) SetImportTypeInDB(importType model.ImportType) (err error)

func (*Controller) ValidateImportType

func (this *Controller) ValidateImportType(jwt auth.Token, importType model.ImportType) (err error, code int)

type Producer

type Producer interface {
	PublishImportTypeDelete(id string, owner string) error
	PublishImportType(hub model.ImportType, owner string) (err error)
	PublishDeleteUserRights(resource string, id string, userId string) error
}

type Security

type Security interface {
	CheckBool(jwt auth.Token, kind string, id string, action model.AuthAction) (allowed bool, err error)
	CheckMultiple(jwt auth.Token, kind string, ids []string, action model.AuthAction) (map[string]bool, error)
	GetAsUser(jwt auth.Token, url string, result *[]interface{}) (err error)
}

Jump to

Keyboard shortcuts

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