typeurl

package module
v0.0.0-...-f694355 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

README

typeurl

Build Status

codecov

A Go package for managing the registration, marshaling, and unmarshaling of encoded types.

This package helps when types are sent over a GRPC API and marshaled as a protobuf.Any.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

func Is

func Is(any *types.Any, v interface{}) bool

Is returns true if the type of the Any is the same as v

func MarshalAny

func MarshalAny(v interface{}) (*types.Any, error)

MarshalAny marshals the value v into an any with the correct TypeUrl

func Register

func Register(v interface{}, args ...string)

Register a type with the base url of the type

func TypeURL

func TypeURL(v interface{}) (string, error)

TypeURL returns the type url for a registred type

func UnmarshalAny

func UnmarshalAny(any *types.Any) (interface{}, error)

UnmarshalAny unmarshals the any type into a concrete type

Types

This section is empty.

Jump to

Keyboard shortcuts

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