http

package
v0.0.0-...-4b058fe Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package http provides HTTP handler to give other services access to to permission service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Health

func Health(mux *http.ServeMux, router allrouter)

Health registers a handler, that tells, if the service is running.

It also returns all known collections and actions.

func IsAllowed

func IsAllowed(mux *http.ServeMux, provider IsAlloweder)

IsAllowed registers a handler, to connect to the IsAllowed method.

It returns the string `true` or `false` that can be encoded as json.

If an error happens, a json-error-string is returned with status code 500.

Types

type IsAlloweder

type IsAlloweder interface {
	IsAllowed(ctx context.Context, name string, userID int, dataList [](map[string]json.RawMessage)) (bool, error)
}

IsAlloweder provides the IsAllowed method.

Jump to

Keyboard shortcuts

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