Documentation
¶
Index ¶
- Variables
- type Bag
- func (pb *Bag) Current() *PageState
- func (pb *Bag) Marshal() (string, error)
- func (pb *Bag) Next(pageToken string) error
- func (pb *Bag) NextToken(pageToken string) (string, error)
- func (pb *Bag) PageToken() string
- func (pb *Bag) Pop() *PageState
- func (pb *Bag) Push(state PageState)
- func (pb *Bag) ResourceID() string
- func (pb *Bag) ResourceTypeID() string
- func (pb *Bag) Unmarshal(input string) error
- type GenBag
- type PageState
- type StreamState
- type StreamToken
- type Token
Constants ¶
This section is empty.
Variables ¶
var ErrNoToken = fmt.Errorf("pagination token cannot be nil")
Functions ¶
This section is empty.
Types ¶
type Bag ¶
type Bag struct {
// contains filtered or unexported fields
}
Bag holds pagination states that can be serialized for use as page tokens. It acts as a stack that you can push and pop pagination operations from.
func (*Bag) NextToken ¶
Next pops the current token, and pushes a copy of it with an updated page token.
func (*Bag) ResourceID ¶
ResourceID returns the resource ID for the current state.
func (*Bag) ResourceTypeID ¶
ResourceTypeID returns the resource type id for the current state.
type GenBag ¶ added in v0.2.64
type GenBag[T any] struct { // contains filtered or unexported fields }
GenBag holds pagination states that can be serialized for use as page tokens. It acts as a stack that you can push and pop pagination operations from. This is a generic version of the Bag struct.
func GenBagFromToken ¶ added in v0.2.64
func (*GenBag[T]) Current ¶ added in v0.2.64
func (pb *GenBag[T]) Current() *T
Current returns the current page state for the bag.
func (*GenBag[T]) Pop ¶ added in v0.2.64
func (pb *GenBag[T]) Pop() *T
Pop returns the current page action, and makes the top of the stack the current.