tuple

package
v0.271.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 26 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package tuple implements `ofga tuples`: write, delete, read relationship tuples and follow the changelog.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeTuple added in v0.268.0

func DecodeTuple(raw []byte) (openfga.TupleKey, error)

DecodeTuple decodes one raw JSON tuple (a tuples-file entry: user, relation, object and an optional condition, strictly) into a validated TupleKey, with the same rules `tuples write --file` applies.

func LoadTupleFile added in v0.268.0

func LoadTupleFile(path string, stdin io.Reader) ([]openfga.TupleKey, error)

LoadTupleFile reads tuples from path ("-" reads stdin) using the same format inference, shapes and strict decoding as `tuples write --file`. Errors keep their exit code; invalid content is also tagged as a validation error naming the source.

func OutputTypes added in v0.268.0

func OutputTypes() map[string]any

OutputTypes maps each tuple command's full path to what it prints under --json. Write and delete are hand-written: their output is a dry-run preview, a single-tuple count or a bulk result depending on the flags.

Types

type Command

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

Command is the `tuple` command group.

func New

func New(cli *cli.CLI) *Command

New builds the tuple command group.

func (*Command) Command

func (c *Command) Command() *cobra.Command

Command returns the cobra command.

func (*Command) RegisterSubCommands

func (c *Command) RegisterSubCommands()

RegisterSubCommands wires the tuple sub-commands.

Jump to

Keyboard shortcuts

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