Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodePageToken ¶
DecodePageToken retrieves raw token from a PageToken.
Types ¶
type Criteria ¶
Criteria set of parameters used to indicate conditions (e.g. filters, offset, cursor, limit) to a Reader -or Repository- when fetching data.
type PageToken ¶
type PageToken []byte
PageToken custom-type representing the page to fetch by a storage system.
This type obfuscates raw tokens through a codec to be later served to system users securely.
Depending on the underlying storage engine, the token might represent an offset, cursor (identifier of an item) or similar.
func NewPageToken ¶
NewPageToken allocates a new instance of PageToken based on src.
type Reader ¶
type Reader[T any] interface { Get(ctx context.Context, id string) (*T, error) Find(ctx context.Context, cr Criteria) (items []T, nextPage PageToken, err error) }
Reader reads data from an underlying storage engine.
type Repository ¶
Repository writes and reads data using an underlying storage engine.