commands

package
v0.0.0-alpha7 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2022 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildCombiner

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

BuildCombiner .

type BuildFunction

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

BuildFunction -

type BuilderNodeKind

type BuilderNodeKind string
const (
	QUERY BuilderNodeKind = "query"
	LOGIC BuilderNodeKind = "logic"
)

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 *base.Child) (response CheckResponse, err error)

Execute -

func (*CheckCommand) GetRelationTupleRepository

func (command *CheckCommand) GetRelationTupleRepository() repositories.IRelationTupleRepository

GetRelationTupleRepository -

type CheckDecision

type CheckDecision struct {
	Exclusion bool  `json:"exclusion,omitempty"`
	Can       bool  `json:"can"`
	Err       error `json:"-"`
}

CheckDecision -

type CheckFunction

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

CheckFunction -

type CheckQuery

type CheckQuery struct {
	Entity  *base.Entity
	Subject *base.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         any
	RemainingDepth int32
}

CheckResponse -

type ExpandCombiner

type ExpandCombiner func(ctx context.Context, functions []ExpandFunction, expand ...*base.Expand) *base.Expand

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 *base.Child) (response ExpandResponse, err error)

Execute -

func (*ExpandCommand) GetRelationTupleRepository

func (command *ExpandCommand) GetRelationTupleRepository() repositories.IRelationTupleRepository

GetRelationTupleRepository -

type ExpandFunction

type ExpandFunction func(ctx context.Context, expandChan chan<- *base.Expand)

ExpandFunction -

type ExpandQuery

type ExpandQuery struct {
	Entity *base.Entity
}

ExpandQuery -

type ExpandResponse

type ExpandResponse struct {
	Tree *base.Expand `json:"tree"`
}

ExpandResponse -

type IBuilderNode

type IBuilderNode interface {
	GetKind() BuilderNodeKind
	Error() error
}

IBuilderNode -

type ICheckCommand

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

ICheckCommand -

type ICommand

type ICommand interface {
	GetRelationTupleRepository() repositories.IRelationTupleRepository
}

type IExpandCommand

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

IExpandCommand -

type ILookupQueryCommand

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

ILookupQueryCommand -

type ISchemaLookupCommand

type ISchemaLookupCommand interface {
	Execute(ctx context.Context, q *SchemaLookupQuery, actions map[string]*base.ActionDefinition) (response SchemaLookupResponse, err error)
}

ISchemaLookupCommand -

type LogicNode

type LogicNode struct {
	Operation base.Rewrite_Operation
	Children  []IBuilderNode
	Err       error
}

LogicNode -

func (LogicNode) Error

func (e LogicNode) Error() error

Error -

func (LogicNode) GetKind

func (LogicNode) GetKind() BuilderNodeKind

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 *base.Child) (response LookupQueryResponse, err error)

Execute -

func (*LookupQueryCommand) GetRelationTupleRepository

func (command *LookupQueryCommand) GetRelationTupleRepository() repositories.IRelationTupleRepository

GetRelationTupleRepository -

type LookupQueryQuery

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

LookupQueryQuery -

func (*LookupQueryQuery) SetSchema

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

SetSchema -

type LookupQueryResponse

type LookupQueryResponse struct {
	Node  IBuilderNode
	Query string
	Args  []string
}

LookupQueryResponse -

func NewLookupQueryResponse

func NewLookupQueryResponse(node IBuilderNode, table string) (LookupQueryResponse, error)

NewLookupQueryResponse -

type QueryNode

type QueryNode struct {
	Key       string          `json:"condition"`
	Join      map[string]join `json:"join"`
	Args      []string        `json:"vars"`
	Exclusion bool            `json:"exclusion"`
	Err       error           `json:"-"`
	// contains filtered or unexported fields
}

QueryNode -

func (QueryNode) Error

func (e QueryNode) Error() error

Error -

func (QueryNode) GetKind

func (QueryNode) GetKind() BuilderNodeKind

GetKind -

type ResolverFunction

type ResolverFunction func() ([]string, error)

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 map[string]*base.ActionDefinition) (response SchemaLookupResponse, err error)

Execute -

type SchemaLookupDecision

type SchemaLookupDecision struct {
	Exclusion bool  `json:"exclusion"`
	Can       bool  `json:"can"`
	Err       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 -

type StatementBuilder

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

StatementBuilder -

Jump to

Keyboard shortcuts

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