Documentation
¶
Index ¶
- Variables
- func IsMemberFunc(_ context.Context, resultCh chan<- Result)
- func NotMemberFunc(_ context.Context, resultCh chan<- Result)
- func UnknownMemberFunc(_ context.Context, resultCh chan<- Result)
- type CheckFunc
- type Checkgroup
- type Edge
- type Factory
- type Membership
- type Pool
- type Result
- type Transformation
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ResultIsMember = Result{Membership: IsMember} ResultNotMember = Result{Membership: NotMember} )
View Source
var DefaultFactory = NewConcurrent
Functions ¶
func IsMemberFunc ¶
func NotMemberFunc ¶
func UnknownMemberFunc ¶
Types ¶
type Checkgroup ¶
type Checkgroup interface { // Done returns true if a result is available. Done() bool // Add adds the CheckFunc to the checkgroup and starts running it. Add(check CheckFunc) // SetIsMember makes the checkgroup emit "IsMember" directly. SetIsMember() // Result returns the result, possibly blocking. Result() Result // CheckFunc returns a CheckFunc that writes the result to the result // channel. CheckFunc() CheckFunc }
func New ¶
func New(ctx context.Context) Checkgroup
func NewConcurrent ¶
func NewConcurrent(ctx context.Context) Checkgroup
type Edge ¶
type Edge struct { Tuple relationtuple.RelationTuple Type ketoapi.TreeNodeType }
type Factory ¶
type Factory = func(ctx context.Context) Checkgroup
type Membership ¶
type Membership int
const ( MembershipUnknown Membership = iota IsMember NotMember )
func (Membership) String ¶
func (i Membership) String() string
type Pool ¶
type Pool interface { // Add adds the function to the pool and schedules it. The function will // only be run if there is a free worker available in the pool, thus // limiting the concurrent workloads in flight. Add(check func()) // TryAdd tries to add the check function if the pool has capacity. // Otherwise, it returns false and does not add the check. TryAdd(check func()) bool }
type Result ¶
type Result struct { Membership Membership Tree *ketoapi.Tree[*relationtuple.RelationTuple] Err error }
type Transformation ¶
type Transformation int
Click to show internal directories.
Click to hide internal directories.