openfga

package
v0.6.8 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ConnMaxLifetime = 15 * time.Minute
	MaxIdleConns    = 3
	MaxOpenConns    = 5
)
View Source
var SQLMigration = []string{
	`CREATE TABLE IF NOT EXISTS user_list
(
	id    text  not null
		constraint user_list_pk
			primary key,
	alias jsonb not null,
	details jsonb
);

create index IF NOT EXISTS user_list_alias_index
	on user_list USING gin (alias);`,
}

Functions

This section is empty.

Types

type Alias

type Alias []string

func (*Alias) Scan

func (a *Alias) Scan(val interface{}) error

func (*Alias) Value

func (a *Alias) Value() (driver.Value, error)

type CreateUserRequest

type CreateUserRequest struct {
	Alias []string `json:"alias"`
}

type CreateUserResponse

type CreateUserResponse struct {
	ID string `json:"id"`
}

type Database

type Database struct {
	Postgres string `cfg:"postgres"`
}

type DeleteUserRequest

type DeleteUserRequest struct {
	ID string `json:"id" query:"id"`
}

type ErrorResponse

type ErrorResponse struct {
	Error string `json:"error,omitempty"`
}

type GetUserRequest

type GetUserRequest struct {
	ID    string `json:"id"    query:"id"`
	Alias string `json:"alias" query:"alias"`
}

type OpenFGA

type OpenFGA struct {
	PrefixPath         string   `cfg:"prefix_path"`
	SharedKey          string   `cfg:"shared_key"`
	APIURL             string   `cfg:"api_url"`
	InsecureSkipVerify bool     `cfg:"insecure_skip_verify"`
	Database           Database `cfg:"database"`
	// contains filtered or unexported fields
}

func (*OpenFGA) CreateUser

func (m *OpenFGA) CreateUser(c echo.Context) error

func (*OpenFGA) DSL2JSON

func (m *OpenFGA) DSL2JSON(c echo.Context) error

func (*OpenFGA) DeleteUser

func (m *OpenFGA) DeleteUser(c echo.Context) error

func (*OpenFGA) GetUser

func (m *OpenFGA) GetUser(c echo.Context) error

func (*OpenFGA) GetUsers

func (m *OpenFGA) GetUsers(c echo.Context) error

func (*OpenFGA) Internal

func (m *OpenFGA) Internal(c echo.Context, trimPath string) error

func (*OpenFGA) JSON2DSL

func (m *OpenFGA) JSON2DSL(c echo.Context) error

func (*OpenFGA) Middleware

func (m *OpenFGA) Middleware(ctx context.Context, _ string) (echo.MiddlewareFunc, error)

func (*OpenFGA) Migration

func (m *OpenFGA) Migration(ctx context.Context) error

func (*OpenFGA) PatchUser

func (m *OpenFGA) PatchUser(c echo.Context) error

func (*OpenFGA) Proxy

func (m *OpenFGA) Proxy(c echo.Context, trimPath string) error

func (*OpenFGA) PutUser

func (m *OpenFGA) PutUser(c echo.Context) error

func (*OpenFGA) SetFs

func (m *OpenFGA) SetFs() (echo.MiddlewareFunc, error)

type PatchUserRequest

type PatchUserRequest struct {
	ID    string   `json:"id"`
	Alias []string `json:"alias"`
}

type PutUserRequest

type PutUserRequest PatchUserRequest

type User

type User struct {
	ID    string `json:"id"    db:"id"    query:"id"`
	Alias Alias  `json:"alias" db:"alias" query:"alias"`
}

Jump to

Keyboard shortcuts

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