cursor

package
v1.25.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrHashMismatch = errors.New("the cursor provided does not have the same arguments as the original API call; please ensure you are making the same API call, with the exact same parameters (besides the cursor)")

ErrHashMismatch is returned as the base error when a mismatching hash was given to the decoder.

View Source
var ErrNilCursor = errors.New("cursor pointer was nil")

ErrNilCursor is returned as the base error when nil is provided as the cursor argument to Decode

Functions

func Decode

func Decode(encoded *v1.Cursor) (*impl.DecodedCursor, error)

Decode converts an encoded cursor to its decoded version.

func DecodeToDispatchCursor

func DecodeToDispatchCursor(encoded *v1.Cursor, callAndParameterHash string) (*dispatch.Cursor, error)

DecodeToDispatchCursor decodes an encoded API cursor into an internal dispatching cursor, ensuring that the provided call context matches that encoded into the API cursor. The call hash should contain all the parameters of the calling API function, as well as its revision and name.

func DecodeToDispatchRevision

func DecodeToDispatchRevision(encoded *v1.Cursor, ds revisionDecoder) (datastore.Revision, error)

DecodeToDispatchRevision decodes an encoded API cursor into an internal dispatch revision. NOTE: this method does *not* verify the caller's method signature.

func Encode

func Encode(decoded *impl.DecodedCursor) (*v1.Cursor, error)

Encode converts a decoded cursor to its opaque version.

func EncodeFromDispatchCursor

func EncodeFromDispatchCursor(dispatchCursor *dispatch.Cursor, callAndParameterHash string, revision datastore.Revision) (*v1.Cursor, error)

EncodeFromDispatchCursor encodes an internal dispatching cursor into a V1 cursor for external consumption, including the provided call context to ensure the API cursor reflects the calling API method. The call hash should contain all the parameters of the calling API function, as well as its revision and name.

func NewInvalidCursorErr added in v1.25.0

func NewInvalidCursorErr(err error) error

NewInvalidCursorErr creates and returns a new invalid cursor error.

Types

type ErrInvalidCursor added in v1.25.0

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

ErrInvalidCursor occurs when a cursor could not be decoded.

func (ErrInvalidCursor) GRPCStatus added in v1.25.0

func (err ErrInvalidCursor) GRPCStatus() *status.Status

GRPCStatus implements retrieving the gRPC status for the error.

Jump to

Keyboard shortcuts

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