api

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: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRouter

func GetRouter(config configuration.Config, query Query, p *rigthsproducer.Producer) (handler http.Handler, err error)

func Health

func Health(router *httprouter.Router, config configuration.Config, q Query, p *rigthsproducer.Producer) bool

func RightsProducerEndpoints

func RightsProducerEndpoints(router *httprouter.Router, config configuration.Config, q Query, p *rigthsproducer.Producer) bool

func Start

func Start(ctx context.Context, config configuration.Config, query Query, p *rigthsproducer.Producer) (err error)

func V1Endpoints

func V1Endpoints(router *httprouter.Router, config configuration.Config, q Query, p *rigthsproducer.Producer) bool

func V2Endpoints

func V2Endpoints(router *httprouter.Router, config configuration.Config, q Query, p *rigthsproducer.Producer) bool

func V3Endpoints

func V3Endpoints(router *httprouter.Router, config configuration.Config, q Query, p *rigthsproducer.Producer) bool

Types

type Query

type Query interface {
	//v1
	ResourceExists(kind string, resource string) (exists bool, err error)
	GetRightsToAdministrate(kind string, user string, groups []string) (result []model.ResourceRights, err error)
	GetFullListForUserOrGroup(kind string, user string, groups []string, rights string) (result []map[string]interface{}, err error)
	GetListForUserOrGroup(kind string, user string, groups []string, rights string, limitStr string, offsetStr string) (result []map[string]interface{}, err error)
	GetListForUser(kind string, user string, rights string) (result []string, err error)
	CheckUser(kind string, resource string, user string, rights string) (err error)
	GetListForGroup(kind string, groups []string, rights string) (result []string, err error)
	CheckGroups(kind string, resource string, groups []string, rights string) (err error)
	SearchRightsToAdministrate(kind string, user string, groups []string, query string, limitStr string, offsetStr string) (result []model.ResourceRights, err error)
	SearchListAll(kind string, query string, user string, groups []string, rights string) (result []map[string]interface{}, err error)
	SelectByFieldAll(kind string, field string, value string, user string, groups []string, rights string) (result []map[string]interface{}, err error)

	// SearchList does a text search with query on the feature_search index
	// the function allows optionally additional filtering with the selection parameter. when unneeded this parameter may be nil.
	SearchList(token auth.Token, kind string, query string, queryCommons model.QueryListCommons, selection *model.Selection) (result []map[string]interface{}, err error)
	GetList(token auth.Token, kind string, queryCommons model.QueryListCommons) (result []map[string]interface{}, err error)
	GetListFromIds(token auth.Token, kind string, ids []string, queryCommons model.QueryListCommons) (result []map[string]interface{}, err error)
	GetListWithSelection(token auth.Token, kind string, queryCommons model.QueryListCommons, selection model.Selection) (result []map[string]interface{}, err error)
	SelectByFeature(token auth.Token, kind string, feature string, value string, queryCommons model.QueryListCommons) (result []map[string]interface{}, err error)

	CheckListUserOrGroup(token auth.Token, kind string, ids []string, rights string) (allowed map[string]bool, err error)

	//v3
	V3

	//migration
	Import(imports map[string][]model.ResourceRights) (err error)
	Export() (exports map[string][]model.ResourceRights, err error)
}

type V3

type V3 interface {
	Query(token string, query model.QueryMessage) (result interface{}, code int, err error)
	List(token string, kind string, options model.ListOptions) (result []map[string]interface{}, err error)
	Total(token string, kind string, options model.ListOptions) (result int64, err error)

	CheckUserOrGroup(token string, kind string, resource string, rights string) (err error)

	GetRights(token string, kind string, resource string) (result model.ResourceRights, err error)

	GetTermAggregation(token string, kind string, rights string, field string, limit int) (result []model.TermAggregationResultElement, err error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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