Help us shape the future of Go! Take the 2026 Go Developer Survey

cursor

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package cursor seals pagination positions and message references to one client and one request shape, so a caller can hand them back but never read, forge or reuse them elsewhere, and seals media references to one message.

Index

Constants

View Source
const (
	MaxCursor   = 256
	MaxRef      = 640
	MaxMediaRef = 2048
	RefPrefix   = "m1_"
)

Variables

View Source
var (
	ErrInvalid = errors.New("invalid cursor")
)

Functions

This section is empty.

Types

type Binding

type Binding struct {
	Client   string
	Endpoint string
	Filter   string
	Query    string
}

type Position

type Position [3]int64

type Ref

type Ref struct {
	Chat   string
	ID     string
	Sender string
}

type Retired added in v1.0.0

type Retired struct {
	Key []byte
	ID  string
}

type Sealer

type Sealer struct {
	// contains filtered or unexported fields
}

func New

func New(key []byte, keyID string, retired ...Retired) (*Sealer, error)

func NewRef added in v1.0.0

func NewRef(key []byte, keyID string, retired ...Retired) (*Sealer, error)

func (*Sealer) Cursor

func (s *Sealer) Cursor(b Binding, p Position) (string, error)

func (*Sealer) OpenCursor

func (s *Sealer) OpenCursor(b Binding, text string) (Position, error)

func (*Sealer) OpenMedia added in v1.2.0

func (s *Sealer) OpenMedia(id, text string) ([]byte, error)

func (*Sealer) OpenRef

func (s *Sealer) OpenRef(client, text string) (Ref, error)

func (*Sealer) SealMedia added in v1.2.0

func (s *Sealer) SealMedia(id string, pt []byte) (string, error)

func (*Sealer) SealRef

func (s *Sealer) SealRef(client string, r Ref) (string, error)

Jump to

Keyboard shortcuts

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