openfga

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: MIT Imports: 7 Imported by: 0

README

OpenFGA

支持的数据存储引擎:PostgreSQL、MySQL。

开发时支持内存存储引擎,但是一旦服务关机重启,数据将会丢失。

Docker安装

docker pull openfga/openfga:latest

docker run -itd --name openfga-server `
  -p 8080:8080 `
  -p 8081:8081 `
  -p 3000:3000 `
  openfga/openfga:latest run

参考资料

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(opts ...ClientOption) *Client

func (*Client) CreateAuthorizationModel

func (c *Client) CreateAuthorizationModel(ctx context.Context, writeAuthorizationModelRequestString string) (string, error)

func (*Client) CreateRelationTuple

func (c *Client) CreateRelationTuple(ctx context.Context, object, relation, subject string) error

func (*Client) CreateStore

func (c *Client) CreateStore(ctx context.Context, name string) error

func (*Client) DeleteRelationTuple

func (c *Client) DeleteRelationTuple(ctx context.Context, object, relation, subject string) error

func (*Client) DeleteStore

func (c *Client) DeleteStore() error

func (*Client) ExpandRelationTuple

func (c *Client) ExpandRelationTuple(ctx context.Context, object, relation string) error

func (*Client) GetCheck

func (c *Client) GetCheck(ctx context.Context, object, relation, subject string) (bool, error)

func (*Client) GetStore

func (c *Client) GetStore(ctx context.Context) string

func (*Client) ListStore

func (c *Client) ListStore(ctx context.Context) (*[]openfga.Store, error)

func (*Client) SetStoreId

func (c *Client) SetStoreId(id string) error

type ClientOption added in v1.0.2

type ClientOption func(o *Client)

func WithApiUrl added in v1.0.2

func WithApiUrl(apiUrl string) ClientOption

func WithClientId added in v1.0.2

func WithClientId(clientId, clientSecret, apiAudience, apiTokenIssuer string) ClientOption

func WithStoreId added in v1.0.2

func WithStoreId(storeId string) ClientOption

func WithToken added in v1.0.2

func WithToken(token string) ClientOption

Jump to

Keyboard shortcuts

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