controller

package
v0.0.0-...-3e0463f Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal

func Marshal(data interface{}, typ DataFormat) []byte

Marshal data of a specified type

func NewController

func NewController() *controller

NewController constructs a Controller

func Unmarshal

func Unmarshal(data []byte, typ DataFormat, target interface{})

Unmarshal data of a specified type into the target, which must be a pointer

Types

type DataFormat

type DataFormat uint

DataFormat is the type of data being received or sent

const (
	GOB DataFormat = iota
	JSON
)

String and JSON are the only supported data types

func StringToDataFormat

func StringToDataFormat(str string) DataFormat

StringToDataFormat returns the DataFormat for a string

func (DataFormat) String

func (t DataFormat) String() string

String is DataFormat Stringer

type DataType

type DataType uint

DataType describes all types of data

const (
	CustomerType DataType = iota
)

DataType constants

func StringToDataType

func StringToDataType(str string) DataType

StringToDataType returns the DataType for a string

func (DataType) String

func (dt DataType) String() string

String is DataType Stringer

Jump to

Keyboard shortcuts

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