result

package
v0.0.0-...-9ffe791 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 4 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Callback

type Callback func(result *Result)

Callback is the prototype for functions that need to handle the result associated with changes to keys.

type Result

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

Reesult represents a result from an operation on a key. The zero value is not valid.

func New

func New(key *key.Key, tag uint64, errorCode int64, errorDesc string,
	value any) *Result

New creates a new Result with the given parameters.

func NewFromJSON

func NewFromJSON(jsonData []byte) *Result

NewFromJSON creates a new Result from the given JSON data. Any errors are reported in the Result itself and should be handled by anyone that cares about it.

func (*Result) ErrorCode

func (r *Result) ErrorCode() int64

ErrorCode returns the error code associated with this result.

func (*Result) ErrorDesc

func (r *Result) ErrorDesc() string

ErrorDesc returns the error description associated with this result.

func (*Result) Key

func (r *Result) Key() *key.Key

Key returns the key associated with this result.

func (*Result) MarshalJSON

func (r *Result) MarshalJSON() ([]byte, error)

func (*Result) String

func (r *Result) String() string

String returns a string representation of this result.

func (*Result) Succeeded

func (r *Result) Succeeded() bool

Succeeded returns true if this result represents a successful operation.

func (*Result) Tag

func (r *Result) Tag() uint64

Tag returns the tag associated with this result.

func (*Result) UnmarshalJSON

func (r *Result) UnmarshalJSON(data []byte) error

func (*Result) Value

func (r *Result) Value() any

Value returns the value associated with this result.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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