protoutil

package
v0.0.0-...-683b059 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package protoutil provides utils to deal with protobuf.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeFromShillValMap

func DecodeFromShillValMap(conf ShillValMap) (map[string]interface{}, error)

DecodeFromShillValMap converts a ShillValMap to a (key, value) map.

func FromShillVal

func FromShillVal(v *wifi.ShillVal) (interface{}, error)

FromShillVal converts a ShillVal to a common golang type.

func ToShillVal

func ToShillVal(i interface{}) (*wifi.ShillVal, error)

ToShillVal converts a common golang type to a ShillVal .

Types

type ShillPropertyChangedSignalList

type ShillPropertyChangedSignalList []*wifi.ShillPropertyChangedSignal

ShillPropertyChangedSignalList a type alias of []*network.ShillPropertyChangedSignal. It can be sent through protobuf.

func EncodeToShillPropertyChangedSignalList

func EncodeToShillPropertyChangedSignalList(conf []ShillPropertyHolder) (ShillPropertyChangedSignalList, error)

EncodeToShillPropertyChangedSignalList converts a list of network.ShillPropertyChangedSignal that contains supported value type to protocol buffer network.ShillVal.

type ShillPropertyHolder

type ShillPropertyHolder struct {
	Name  string
	Value interface{}
}

ShillPropertyHolder holds the parameters of shill "PropertyChanged" signal.

func DecodeFromShillPropertyChangedSignalList

func DecodeFromShillPropertyChangedSignalList(conf ShillPropertyChangedSignalList) ([]ShillPropertyHolder, error)

DecodeFromShillPropertyChangedSignalList converts a PropertyChangedSignalList to a []ShillPropertyHolder.

type ShillValMap

type ShillValMap map[string]*wifi.ShillVal

ShillValMap is a type alias of map[string]*network.ShillVal. It can be sent through protobuf.

func EncodeToShillValMap

func EncodeToShillValMap(conf map[string]interface{}) (ShillValMap, error)

EncodeToShillValMap converts a map that contains supported value type to protocol buffer network.ShillVal.

Jump to

Keyboard shortcuts

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