transflect

package
v0.4.14 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package transflect contains utilities for getting FileDescriptorSet for given gRPC server address with enabled Reflection API.break

Index

Constants

This section is empty.

Variables

View Source
var LogAttempt = func(ctx context.Context, attempt int, err error) {}

LogAttempt is a hook for custom, possibly structured logging. It defaults to a no-op.

Functions

func AnnotateHTTPRule

func AnnotateHTTPRule(fd *descriptorpb.FileDescriptorProto, httpPathPrefix string)

AnnotateHTTPRule adds /api/<pkg>.<service>/<method> as HTTP URL path to methods without http option provided in proto definition.

func Base64Proto

func Base64Proto(m proto.Message) (string, error)

Base64Proto marshals and base64 encodes Proto message.

func GetFileDescriptorSet

func GetFileDescriptorSet(ctx context.Context, addr string, httpPathPrefix string, opts ...grpc.DialOption) (*descriptorpb.FileDescriptorSet, []string, error)

GetFileDescriptorSet returns the combined FileDescriptorProtos and transitive dependencies of all services running on address. The gRPC Reflection API must be available on the given address.

Types

type MutexMap added in v0.4.2

type MutexMap struct {
	// contains filtered or unexported fields
}

MutexMap is map of mutexes. Access to items can be locked by name.

func (*MutexMap) Lock added in v0.4.2

func (nm *MutexMap) Lock(name string)

Lock acquires a lock for a given name.

func (*MutexMap) Remove added in v0.4.2

func (nm *MutexMap) Remove(name string)

Remove deletes the lock entry for a given name.

func (*MutexMap) Unlock added in v0.4.2

func (nm *MutexMap) Unlock(name string)

Unlock releases the lock for the given name.

Jump to

Keyboard shortcuts

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