commands

package
v0.0.0-alpha5 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2022 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BranchNode

type BranchNode struct {
	Kind     NodeKind                `json:"kind"`
	Target   tuple.EntityAndRelation `json:"target"`
	Children []Node                  `json:"children"`
	Err      error                   `json:"-"`
}

BranchNode -

func (BranchNode) Error

func (e BranchNode) Error() error

Error -

func (BranchNode) GetKind

func (BranchNode) GetKind() NodeKind

GetKind -

type BuildCombiner

type BuildCombiner func(ctx context.Context, functions []BuildFunction) BuildStatementResult

BuildCombiner .

type BuildFunction

type BuildFunction func(ctx context.Context, resultChan chan<- BuildStatementResult)

BuildFunction -

type BuildStatementResult

type BuildStatementResult struct {
	Query query
	Err   errors.Error `json:"err"`
}

BuildStatementResult -

type CheckCombiner

type CheckCombiner func(ctx context.Context, functions []CheckFunction) CheckDecision

CheckCombiner .

type CheckCommand

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

CheckCommand -

func NewCheckCommand

NewCheckCommand -

func (*CheckCommand) Execute

func (command *CheckCommand) Execute(ctx context.Context, q *CheckQuery, child schema.Child) (response CheckResponse, err errors.Error)

Execute -

type CheckDecision

type CheckDecision struct {
	Prefix string       `json:"prefix"`
	Can    bool         `json:"can"`
	Err    errors.Error `json:"-"`
}

CheckDecision -

type CheckFunction

type CheckFunction func(ctx context.Context, decisionChan chan<- CheckDecision)

CheckFunction -

type CheckQuery

type CheckQuery struct {
	Entity  tuple.Entity
	Subject tuple.Subject
	// contains filtered or unexported fields
}

CheckQuery -

func (*CheckQuery) LoadVisits

func (r *CheckQuery) LoadVisits() map[string]interface{}

func (*CheckQuery) SetDepth

func (r *CheckQuery) SetDepth(i int32)

SetDepth -

func (*CheckQuery) SetVisit

func (r *CheckQuery) SetVisit(key string, decision CheckDecision)

type CheckResponse

type CheckResponse struct {
	Can            bool
	Visits         map[string]interface{}
	RemainingDepth int32
}

CheckResponse -

type ExpandCombiner

type ExpandCombiner func(ctx context.Context, requests []ExpandFunction) Node

ExpandCombiner .

type ExpandCommand

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

ExpandCommand -

func NewExpandCommand

NewExpandCommand -

func (*ExpandCommand) Execute

func (command *ExpandCommand) Execute(ctx context.Context, q *ExpandQuery, child schema.Child) (response ExpandResponse, err errors.Error)

Execute -

type ExpandFunction

type ExpandFunction func(ctx context.Context, expandChan chan<- Node)

ExpandFunction -

type ExpandNode

type ExpandNode struct {
	Kind      NodeKind      `json:"kind"`
	Operation schema.OPType `json:"operation"`
	Children  []Node        `json:"children"`
	Err       error         `json:"-"`
}

ExpandNode -

func (ExpandNode) Error

func (e ExpandNode) Error() error

Error -

func (ExpandNode) GetKind

func (ExpandNode) GetKind() NodeKind

GetKind -

type ExpandQuery

type ExpandQuery struct {
	Entity tuple.Entity
}

ExpandQuery -

type ExpandResponse

type ExpandResponse struct {
	Tree Node
}

ExpandResponse -

type ICheckCommand

type ICheckCommand interface {
	Execute(ctx context.Context, q *CheckQuery, child schema.Child) (response CheckResponse, err errors.Error)
}

ICheckCommand -

type IExpandCommand

type IExpandCommand interface {
	Execute(ctx context.Context, q *ExpandQuery, child schema.Child) (response ExpandResponse, err errors.Error)
}

IExpandCommand -

type ILookupQueryCommand

type ILookupQueryCommand interface {
	Execute(ctx context.Context, q *LookupQueryQuery, child schema.Child) (response LookupQueryResponse, err errors.Error)
}

ILookupQueryCommand -

type ISchemaLookupCommand

type ISchemaLookupCommand interface {
	Execute(ctx context.Context, q *SchemaLookupQuery, actions []schema.Action) (response SchemaLookupResponse, err errors.Error)
}

ISchemaLookupCommand -

type LeafNode

type LeafNode struct {
	Kind    NodeKind      `json:"kind"`
	Subject tuple.Subject `json:"subject"`
	Err     error         `json:"-"`
}

LeafNode -

func (LeafNode) Error

func (e LeafNode) Error() error

Error -

func (LeafNode) GetKind

func (LeafNode) GetKind() NodeKind

GetKind -

type LookupQueryCommand

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

LookupQueryCommand -

func NewLookupQueryCommand

NewLookupQueryCommand -

func (*LookupQueryCommand) Execute

func (command *LookupQueryCommand) Execute(ctx context.Context, q *LookupQueryQuery, child schema.Child) (response LookupQueryResponse, err errors.Error)

Execute -

type LookupQueryQuery

type LookupQueryQuery struct {
	EntityType string
	Action     string
	Subject    tuple.Subject
	// contains filtered or unexported fields
}

LookupQueryQuery -

func (*LookupQueryQuery) SetSchema

func (l *LookupQueryQuery) SetSchema(sch schema.Schema)

type LookupQueryResponse

type LookupQueryResponse struct {
	Results []BuildStatementResult
	Query   string
	Table   string
}

LookupQueryResponse -

type Node

type Node interface {
	GetKind() NodeKind
	Error() error
}

Node -

type NodeKind

type NodeKind string
const (
	EXPAND NodeKind = "expand"
	LEAF   NodeKind = "leaf"
	BRANCH NodeKind = "branch"
)

type ResolverFunction

type ResolverFunction func() []string

ResolverFunction -

type SchemaLookupCombiner

type SchemaLookupCombiner func(ctx context.Context, functions []SchemaLookupFunction) SchemaLookupDecision

SchemaLookupCombiner .

type SchemaLookupCommand

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

SchemaLookupCommand -

func NewSchemaLookupCommand

func NewSchemaLookupCommand(l logger.Interface) *SchemaLookupCommand

NewSchemaLookupCommand -

func (*SchemaLookupCommand) Execute

func (command *SchemaLookupCommand) Execute(ctx context.Context, q *SchemaLookupQuery, actions []schema.Action) (response SchemaLookupResponse, err errors.Error)

Execute -

type SchemaLookupDecision

type SchemaLookupDecision struct {
	Prefix string       `json:"prefix"`
	Can    bool         `json:"can"`
	Err    errors.Error `json:"-"`
}

SchemaLookupDecision -

type SchemaLookupFunction

type SchemaLookupFunction func(ctx context.Context, lookupChan chan<- SchemaLookupDecision)

SchemaLookupFunction -

type SchemaLookupQuery

type SchemaLookupQuery struct {
	Relations []string
}

SchemaLookupQuery -

type SchemaLookupResponse

type SchemaLookupResponse struct {
	ActionNames []string
}

SchemaLookupResponse -

Jump to

Keyboard shortcuts

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