protoutil

package
v0.0.0-...-5a762db Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package protoutil contains utilities for manipulation of MediFor protocol buffers.

Index

Constants

This section is empty.

Variables

View Source
var FieldNotFound = fmt.Errorf("field not found")

FieldNotFound error thrown when field not found

Functions

func MessageStringField

func MessageStringField(msg proto.Message, fieldName string) (string, error)

MessageStringField gets the string value of a particular field in a message.

func RewriteOutDir

func RewriteOutDir(val proto.Message, f URIRewriter) error

RewriteOutDir looks for an OutDir in the top level of the message and rewrites it.

func RewriteURIs

func RewriteURIs(val interface{}, f URIRewriter) error

RewriteURIs recursively looks through all fields of the given message, and attempts to rewrite URI fields in any Resource types it encounters, using the given URI rewrite function to apply the transformation.

func SetMessageStringField

func SetMessageStringField(msg proto.Message, fieldName, value string) error

SetMessageStringField sets the value of a string field in a given message.

Types

type URIRewriter

type URIRewriter func(src string) (string, error)

URIRewriter class to rewrite UR as proper resolved local or remote file paths

Jump to

Keyboard shortcuts

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