protoutil

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2021 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Overview

Package protoutil contains functions for working with protobuf types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAnyBool

func NewAnyBool(v bool) *anypb.Any

NewAnyBool creates a new any type from a bool.

func NewAnyBytes

func NewAnyBytes(v []byte) *anypb.Any

NewAnyBytes creates a new any type from bytes.

func NewAnyDouble

func NewAnyDouble(v float64) *anypb.Any

NewAnyDouble creates a new any type from a float64.

func NewAnyFloat

func NewAnyFloat(v float32) *anypb.Any

NewAnyFloat creates a new any type from a float32.

func NewAnyInt32

func NewAnyInt32(v int32) *anypb.Any

NewAnyInt32 creates a new any type from an int32.

func NewAnyInt64

func NewAnyInt64(v int64) *anypb.Any

NewAnyInt64 creates a new any type from an int64.

func NewAnyNull

func NewAnyNull() *anypb.Any

NewAnyNull creates a new any type from a null struct.

func NewAnyString

func NewAnyString(v string) *anypb.Any

NewAnyString creates a new any type from a string.

func NewAnyUInt32

func NewAnyUInt32(v uint32) *anypb.Any

NewAnyUInt32 creates a new any type from an uint32.

func NewAnyUInt64

func NewAnyUInt64(v uint64) *anypb.Any

NewAnyUInt64 creates a new any type from an uint64.

func NewStructBool

func NewStructBool(v bool) *structpb.Value

NewStructBool creates a new bool struct value.

func NewStructList

func NewStructList(vs ...*structpb.Value) *structpb.Value

NewStructList creates a new list struct value.

func NewStructMap

func NewStructMap(v map[string]*structpb.Value) *structpb.Value

NewStructMap creates a new map struct value.

func NewStructNull

func NewStructNull() *structpb.Value

NewStructNull creates a new null struct value.

func NewStructNumber

func NewStructNumber(v float64) *structpb.Value

NewStructNumber creates a new number struct value.

func NewStructString

func NewStructString(v string) *structpb.Value

NewStructString creates a new string struct value.

func ToAny

func ToAny(value interface{}) *anypb.Any

ToAny converts any type into an any value.

func ToStruct

func ToStruct(value interface{}) *structpb.Value

ToStruct converts any value into a structpb Value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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