dto

package
v0.2.70 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 6 Imported by: 22

Documentation

Overview

Package dto is for data transfer objects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoJSONArray

func DoJSONArray(strs []string) string

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 JSONArray

func JSONArray(strs ...string) string

JSONArray returns a JSON array in string from strings given.

func ToGOB

func ToGOB(dto interface{}) []byte

ToGOB returns bytes of the object in GOB format.

func ToJSON

func ToJSON(dto interface{}) string

ToJSON is a helper to convert dto to JSON string.

func ToJSONBytes

func ToJSONBytes(dto interface{}) []byte

ToJSONBytes is a helper to convert dto to JSON byte data.

Types

This section is empty.

Jump to

Keyboard shortcuts

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