protoregistry

package
v1.47.3 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// OpUnknown = unknown operation type
	OpUnknown = iota
	// OpAccessor = accessor operation type (ready only)
	OpAccessor
	// OpMutator = mutator operation type (modifies a repository)
	OpMutator
)

Variables

View Source
var GitalyProtoFileDescriptors []*descriptor.FileDescriptorProto

GitalyProtoFileDescriptors is a slice of all gitaly registered file descriptors

Functions

This section is empty.

Types

type MethodInfo

type MethodInfo struct {
	Operation OpType
	// contains filtered or unexported fields
}

MethodInfo contains metadata about the RPC method. Refer to documentation for message type "OperationMsg" shared.proto in gitlab-org/gitaly-proto for more documentation.

func (MethodInfo) TargetRepo added in v1.43.0

func (mi MethodInfo) TargetRepo(msg proto.Message) (*gitalypb.Repository, error)

TargetRepo returns the target repository for a protobuf message if it exists

type OpType

type OpType int

OpType represents the operation type for a RPC method

type Registry

type Registry struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Registry contains info about RPC methods

func New

func New() *Registry

New creates a new ProtoRegistry

func (*Registry) LookupMethod

func (pr *Registry) LookupMethod(service, method string) (MethodInfo, error)

LookupMethod looks up an MethodInfo by service and method name

func (*Registry) RegisterFiles

func (pr *Registry) RegisterFiles(protos ...*descriptor.FileDescriptorProto) error

RegisterFiles takes one or more descriptor.FileDescriptorProto and populates the registry with its info

Jump to

Keyboard shortcuts

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