options

package
v1.23.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: Apache-2.0 Imports: 3 Imported by: 6

Documentation

Overview

Code generated by github.com/ecordell/optgen. DO NOT EDIT.

Index

Constants

This section is empty.

Variables

View Source
var (

	// LimitOne is a constant *uint64 that can be used with WithLimit requests.
	LimitOne = &one
)

Functions

This section is empty.

Types

type Cursor

type Cursor *core.RelationTuple

type QueryOptions

type QueryOptions struct {
	Limit    *uint64                   `debugmap:"visible"`
	Usersets []*core.ObjectAndRelation `debugmap:"visible"`
	Sort     SortOrder                 `debugmap:"visible"`
	After    Cursor                    `debugmap:"visible"`
}

QueryOptions are the options that can affect the results of a normal forward query.

func NewQueryOptionsWithOptions

func NewQueryOptionsWithOptions(opts ...QueryOptionsOption) *QueryOptions

NewQueryOptionsWithOptions creates a new QueryOptions with the passed in options set

func NewQueryOptionsWithOptionsAndDefaults added in v1.22.0

func NewQueryOptionsWithOptionsAndDefaults(opts ...QueryOptionsOption) *QueryOptions

NewQueryOptionsWithOptionsAndDefaults creates a new QueryOptions with the passed in options set starting from the defaults

func QueryOptionsWithOptions

func QueryOptionsWithOptions(q *QueryOptions, opts ...QueryOptionsOption) *QueryOptions

QueryOptionsWithOptions configures an existing QueryOptions with the passed in options set

func (QueryOptions) DebugMap added in v1.22.0

func (q QueryOptions) DebugMap() map[string]any

DebugMap returns a map form of QueryOptions for debugging

func (*QueryOptions) ToOption

func (q *QueryOptions) ToOption() QueryOptionsOption

ToOption returns a new QueryOptionsOption that sets the values from the passed in QueryOptions

func (*QueryOptions) WithOptions added in v1.22.0

func (q *QueryOptions) WithOptions(opts ...QueryOptionsOption) *QueryOptions

WithOptions configures the receiver QueryOptions with the passed in options set

type QueryOptionsOption

type QueryOptionsOption func(q *QueryOptions)

func SetUsersets

func SetUsersets(usersets []*v1.ObjectAndRelation) QueryOptionsOption

SetUsersets returns an option that can set Usersets on a QueryOptions

func WithAfter

func WithAfter(after Cursor) QueryOptionsOption

WithAfter returns an option that can set After on a QueryOptions

func WithLimit

func WithLimit(limit *uint64) QueryOptionsOption

WithLimit returns an option that can set Limit on a QueryOptions

func WithSort

func WithSort(sort SortOrder) QueryOptionsOption

WithSort returns an option that can set Sort on a QueryOptions

func WithUsersets

func WithUsersets(usersets *v1.ObjectAndRelation) QueryOptionsOption

WithUsersets returns an option that can append Usersetss to QueryOptions.Usersets

type RWTOptions added in v1.22.0

type RWTOptions struct {
	DisableRetries bool `debugmap:"visible"`
}

RWTOptions are options that can affect the way a read-write transaction is executed.

func NewRWTOptionsWithOptions added in v1.22.0

func NewRWTOptionsWithOptions(opts ...RWTOptionsOption) *RWTOptions

NewRWTOptionsWithOptions creates a new RWTOptions with the passed in options set

func NewRWTOptionsWithOptionsAndDefaults added in v1.22.0

func NewRWTOptionsWithOptionsAndDefaults(opts ...RWTOptionsOption) *RWTOptions

NewRWTOptionsWithOptionsAndDefaults creates a new RWTOptions with the passed in options set starting from the defaults

func RWTOptionsWithOptions added in v1.22.0

func RWTOptionsWithOptions(r *RWTOptions, opts ...RWTOptionsOption) *RWTOptions

RWTOptionsWithOptions configures an existing RWTOptions with the passed in options set

func (RWTOptions) DebugMap added in v1.22.0

func (r RWTOptions) DebugMap() map[string]any

DebugMap returns a map form of RWTOptions for debugging

func (*RWTOptions) ToOption added in v1.22.0

func (r *RWTOptions) ToOption() RWTOptionsOption

ToOption returns a new RWTOptionsOption that sets the values from the passed in RWTOptions

func (*RWTOptions) WithOptions added in v1.22.0

func (r *RWTOptions) WithOptions(opts ...RWTOptionsOption) *RWTOptions

WithOptions configures the receiver RWTOptions with the passed in options set

type RWTOptionsOption added in v1.22.0

type RWTOptionsOption func(r *RWTOptions)

func WithDisableRetries added in v1.22.0

func WithDisableRetries(disableRetries bool) RWTOptionsOption

WithDisableRetries returns an option that can set DisableRetries on a RWTOptions

type ResourceRelation

type ResourceRelation struct {
	Namespace string
	Relation  string
}

ResourceRelation combines a resource object type and relation.

type ReverseQueryOptions

type ReverseQueryOptions struct {
	ResRelation *ResourceRelation `debugmap:"visible"`

	LimitForReverse *uint64   `debugmap:"visible"`
	SortForReverse  SortOrder `debugmap:"visible"`
	AfterForReverse Cursor    `debugmap:"visible"`
}

ReverseQueryOptions are the options that can affect the results of a reverse query.

func NewReverseQueryOptionsWithOptions

func NewReverseQueryOptionsWithOptions(opts ...ReverseQueryOptionsOption) *ReverseQueryOptions

NewReverseQueryOptionsWithOptions creates a new ReverseQueryOptions with the passed in options set

func NewReverseQueryOptionsWithOptionsAndDefaults added in v1.22.0

func NewReverseQueryOptionsWithOptionsAndDefaults(opts ...ReverseQueryOptionsOption) *ReverseQueryOptions

NewReverseQueryOptionsWithOptionsAndDefaults creates a new ReverseQueryOptions with the passed in options set starting from the defaults

func ReverseQueryOptionsWithOptions

func ReverseQueryOptionsWithOptions(r *ReverseQueryOptions, opts ...ReverseQueryOptionsOption) *ReverseQueryOptions

ReverseQueryOptionsWithOptions configures an existing ReverseQueryOptions with the passed in options set

func (ReverseQueryOptions) DebugMap added in v1.22.0

func (r ReverseQueryOptions) DebugMap() map[string]any

DebugMap returns a map form of ReverseQueryOptions for debugging

func (*ReverseQueryOptions) ToOption

ToOption returns a new ReverseQueryOptionsOption that sets the values from the passed in ReverseQueryOptions

func (*ReverseQueryOptions) WithOptions added in v1.22.0

WithOptions configures the receiver ReverseQueryOptions with the passed in options set

type ReverseQueryOptionsOption

type ReverseQueryOptionsOption func(r *ReverseQueryOptions)

func WithAfterForReverse

func WithAfterForReverse(afterForReverse Cursor) ReverseQueryOptionsOption

WithAfterForReverse returns an option that can set AfterForReverse on a ReverseQueryOptions

func WithLimitForReverse

func WithLimitForReverse(limitForReverse *uint64) ReverseQueryOptionsOption

WithLimitForReverse returns an option that can set LimitForReverse on a ReverseQueryOptions

func WithResRelation

func WithResRelation(resRelation *ResourceRelation) ReverseQueryOptionsOption

WithResRelation returns an option that can set ResRelation on a ReverseQueryOptions

func WithSortForReverse

func WithSortForReverse(sortForReverse SortOrder) ReverseQueryOptionsOption

WithSortForReverse returns an option that can set SortForReverse on a ReverseQueryOptions

type SortOrder

type SortOrder int8

SortOrder is an enum which represents the order in which the caller would like the data returned.

const (
	// Unsorted lets the underlying datastore choose the order, or no order at all
	Unsorted SortOrder = iota

	// ByResource sorts the relationships by the resource component first
	ByResource

	// BySubject sorts the relationships by the subject component first. Note that
	// BySubject might be quite a bit slower than ByResource, as relationships are
	// indexed by resource.
	BySubject
)

Jump to

Keyboard shortcuts

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