Documentation ¶
Index ¶
- func DoJSONArray(strs []string) string
- func FromGOB(data []byte, dto interface{})
- func FromJSON(bytes []byte, dto interface{})
- func FromJSONStr(str string, dto interface{})
- func JSONArray(strs ...string) string
- func ToGOB(dto interface{}) []byte
- func ToJSON(dto interface{}) string
- func ToJSONBytes(dto interface{}) []byte
- type Data
- type Err
- type ErrorJSON
- type Result
- func (r Result) Bytes() []byte
- func (r Result) Err() error
- func (r Result) ErrCode() int
- func (r Result) Error() string
- func (r Result) Handle() int
- func (r *Result) SetBytes(bytes []byte)
- func (r *Result) SetErr(e error)
- func (r *Result) SetErrCode(c int)
- func (r *Result) SetErrorJSON(jsonString string)
- func (r *Result) SetHandle(h int)
- func (r *Result) SetStr1(s string)
- func (r *Result) SetStr2(s string)
- func (r *Result) SetStr3(s string)
- func (r *Result) SetU64(v uint64)
- func (r *Result) SetYes(v bool)
- func (r Result) Str1() string
- func (r Result) Str2() string
- func (r *Result) Str3() string
- func (r Result) String() string
- func (r *Result) Uint64() uint64
- func (r Result) Yes() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoJSONArray ¶
DoJSONArray returns a JSON array in string from strings given.
func FromGOB ¶
func FromGOB(data []byte, dto interface{})
FromGOB reads object from bytes. Remember pass a pointer to preallocated object of the right type.
p := &PSM{} dto.FromGOB(d, p) return p
func FromJSON ¶
func FromJSON(bytes []byte, dto interface{})
FromJSON is a helper to convert byte JSON to a data object.
func FromJSONStr ¶
func FromJSONStr(str string, dto interface{})
FromJSONStr is a helper to convert object from a JSON string.
func ToJSONBytes ¶
func ToJSONBytes(dto interface{}) []byte
ToJSONBytes is a helper to convert dto to JSON byte data.
Types ¶
type Data ¶
type Data struct { Handle int `json:"handle,omitempty"` Str1 string `json:"str_1,omitempty"` Str2 string `json:"str_2,omitempty"` Str3 string `json:"str_3,omitempty"` U64 uint64 `json:"u_64,omitempty"` Bytes []byte `json:"bytes,omitempty"` Yes bool `json:"yes,omitempty"` }
Data is the actual data from wrapper function's return values when function call is successful.
type ErrorJSON ¶
type ErrorJSON struct { Backtrace string `json:"backtrace,omitempty"` Message string `json:"message"` }
ErrorJSON is wrapper struct for libindy's corresponding JSON type.
func NewErrorJSON ¶
NewErrorJSON creates a new ErrorJSON
type Result ¶
Result is the return type result of the wrapper functions
func (*Result) SetErrorJSON ¶
SetErrorJSON sets error data from json string of the Result.