common

package
v1.28.2 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureListOptions added in v1.25.0

func EnsureListOptions(options *entity.ListOptions) *entity.ListOptions

func EnsurePaginated

func EnsurePaginated(filter *entity.Paginated)

func EnsurePaginatedX

func EnsurePaginatedX(filter *entity.PaginatedX)

func FinalizePagination

func FinalizePagination[T entity.HasCursor](results []T, filter *entity.Paginated, options *entity.ListOptions) (*entity.PageInfo, []T)

func GetCurrentUserId

func GetCurrentUserId(ctx context.Context, db database.Database) (int64, error)

func GetCursorPages

func GetCursorPages(firstCursor *string, cursors []string, pageSize int) ([]entity.Page, entity.Page)

func GetPageInfo

func GetPageInfo[T entity.HasCursor](res []T, ids []int64, pageSize int, currentCursor int64) *entity.PageInfo

func GetPageInfoX

func GetPageInfoX[T entity.HasCursor](res []T, cursors []string, pageSize int, currentCursor *string) *entity.PageInfo

func GetPages

func GetPages(firstCursor *string, ids []int64, pageSize int) ([]entity.Page, entity.Page)

func NewAdminContext added in v1.26.0

func NewAdminContext() context.Context

func PreparePagination

func PreparePagination(filter *entity.Paginated, options *entity.ListOptions)

Types

type HandlerContext added in v1.24.0

type HandlerContext struct {
	DB       database.Database
	EventReg event.EventRegistry
	Cache    cache.Cache
	Authz    openfga.Authorization
}

Jump to

Keyboard shortcuts

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