datastore

package module
v0.0.0-...-bd58473 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

README

ladon-datastore Go Report Card Build Status Coverage Status

Google Datastore backend for ory/ladon

TODO:

  • Write tests

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LadonPolicyMatcher

type LadonPolicyMatcher struct {
	Template string `datastore:"t"`
	HasRegex bool   `datastore:"h"`
}

LadonPolicyMatcher is used to represent Policy matching templates

type Manager

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

Manager is a Google Datastore implementation for Manager to store policies persistently.

func NewManager

func NewManager(ctx context.Context, client *datastore.Client, namespace string) *Manager

NewManager initializes a new Manager with the given client

func (*Manager) Create

func (m *Manager) Create(policy ladon.Policy) (err error)

Create inserts a new policy

func (*Manager) Delete

func (m *Manager) Delete(id string) error

Delete removes a policy.

func (*Manager) FindRequestCandidates

func (m *Manager) FindRequestCandidates(r *ladon.Request) (ladon.Policies, error)

FindRequestCandidates returns candidates that could match the request object. It either returns a set that exactly matches the request, or a superset of it. If an error occurs, it returns nil and the error.

func (*Manager) Get

func (m *Manager) Get(id string) (ladon.Policy, error)

Get retrieves a policy.

func (*Manager) GetAll

func (m *Manager) GetAll(limit, offset int64) (ladon.Policies, error)

GetAll returns all policies

func (*Manager) Update

func (m *Manager) Update(policy ladon.Policy) error

Update updates an existing policy.

Jump to

Keyboard shortcuts

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