Documentation ¶
Index ¶
- Variables
- func Decode(encoded *v1.Cursor) (*impl.DecodedCursor, error)
- func DecodeToDispatchCursor(encoded *v1.Cursor, callAndParameterHash string) (*dispatch.Cursor, error)
- func DecodeToDispatchRevision(encoded *v1.Cursor, ds revisionDecoder) (datastore.Revision, error)
- func Encode(decoded *impl.DecodedCursor) (*v1.Cursor, error)
- func EncodeFromDispatchCursor(dispatchCursor *dispatch.Cursor, callAndParameterHash string, ...) (*v1.Cursor, error)
- func NewInvalidCursorErr(err error) error
- type ErrInvalidCursor
Constants ¶
This section is empty.
Variables ¶
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.
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 ¶
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
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.