structs

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package structs simplifies the specification of protobuf's struct literals. This package has nothing to do with Go's structs, or protobufs in general.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(v bool) *structpb.Value

Bool converts a boolean value into a proto struct value.

func Null

func Null() *structpb.Value

Null returns a proto struct value's null.

func Number

func Number(v float64) *structpb.Value

Number converts a float64 into a proto struct value.

func String

func String(v string) *structpb.Value

String converts a string into a proto struct value.

Types

type List

type List []*structpb.Value

List is used to specify a proto list. It can be used either as a literal, or like you would a normal slice. Call L() or V() when finished constructing to retrieve the type you want.

func (List) L

func (l List) L() *structpb.ListValue

L converts a List into a proto struct list.

func (List) V

func (l List) V() *structpb.Value

V converts a List into a proto struct value.

type Struct

type Struct map[string]*structpb.Value

Struct is used to specify a proto struct. It can be used either as a literal, or like you would a normal map. Call S() or V() when finished constructing to retrieve the type you want.

func (Struct) S

func (s Struct) S() *structpb.Struct

S converts a Struct into a proto struct struct.

func (Struct) V

func (s Struct) V() *structpb.Value

V converts a Struct into a proto struct value.

Jump to

Keyboard shortcuts

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