datastoreadapter

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

README

datastore-adapter

A GCP datastore adapter for Casbin

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAdapter

func NewAdapter(db *datastore.Client) persist.Adapter

NewAdapter is the constructor for Adapter. A valid datastore client must be provided.

func NewAdapterWithConfig

func NewAdapterWithConfig(db *datastore.Client, config AdapterConfig) persist.Adapter

NewAdapter is the constructor for Adapter. A valid datastore client must be provided.

Types

type AdapterConfig

type AdapterConfig struct {
	// Datastore kind name.
	// Optional. (Default: "casbin")
	Kind string
	// Datastore namespace.
	// Optional. (Default: "")
	Namespace string
}

type CasbinRule

type CasbinRule struct {
	PType string `datastore:"p_type"`
	V0    string `datastore:"v0"`
	V1    string `datastore:"v1"`
	V2    string `datastore:"v2"`
	V3    string `datastore:"v3"`
	V4    string `datastore:"v4"`
	V5    string `datastore:"v5"`
}

CasbinRule represents a rule in Casbin.

Jump to

Keyboard shortcuts

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