Documentation ¶
Index ¶
- Variables
- type MethodInfo
- func (mi MethodInfo) AdditionalRepo(msg proto.Message) (*gitalypb.Repository, error)
- func (mi MethodInfo) FullMethodName() string
- func (mi MethodInfo) NewRequest() proto.Message
- func (mi MethodInfo) SetStorage(msg proto.Message, storage string) error
- func (mi MethodInfo) Storage(msg proto.Message) (string, error)
- func (mi MethodInfo) TargetRepo(msg proto.Message) (*gitalypb.Repository, error)
- func (mi MethodInfo) UnmarshalRequestProto(b []byte) (proto.Message, error)
- type OpType
- type Registry
- type Scope
Constants ¶
This section is empty.
Variables ¶
var ErrRepositoryFieldNotFound = errors.New("repository field not found")
ErrRepositoryFieldNotFound indicates that the repository field could not be found.
Functions ¶
This section is empty.
Types ¶
type MethodInfo ¶
MethodInfo contains metadata about the RPC method. Refer to documentation for message type "OperationMsg" shared.proto in ./proto for more documentation.
func (MethodInfo) AdditionalRepo ¶
func (mi MethodInfo) AdditionalRepo(msg proto.Message) (*gitalypb.Repository, error)
AdditionalRepo returns the additional repository for a Protobuf message that needs a storage rewritten if it exists.
func (MethodInfo) FullMethodName ¶
func (mi MethodInfo) FullMethodName() string
func (MethodInfo) NewRequest ¶ added in v16.2.0
func (mi MethodInfo) NewRequest() proto.Message
NewRequest instantiates a new instance of the method's request type.
func (MethodInfo) SetStorage ¶
func (mi MethodInfo) SetStorage(msg proto.Message, storage string) error
SetStorage sets the storage name for a protobuf message
func (MethodInfo) Storage ¶
func (mi MethodInfo) Storage(msg proto.Message) (string, error)
Storage returns the storage name for a protobuf message if it exists
func (MethodInfo) TargetRepo ¶
func (mi MethodInfo) TargetRepo(msg proto.Message) (*gitalypb.Repository, error)
TargetRepo returns the target repository for a protobuf message if it exists
func (MethodInfo) UnmarshalRequestProto ¶
func (mi MethodInfo) UnmarshalRequestProto(b []byte) (proto.Message, error)
UnmarshalRequestProto will unmarshal the bytes into the method's request message type
type OpType ¶
type OpType int
OpType represents the operation type for a RPC method
const ( // OpUnknown = unknown operation type OpUnknown OpType = iota // OpAccessor = accessor operation type (ready only) OpAccessor // OpMutator = mutator operation type (modifies a repository) OpMutator // OpMaintenance is an operation which performs maintenance-tasks on the repository. It // shouldn't ever result in a user-visible change in behaviour, except that it may repair // corrupt data. OpMaintenance )
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry contains info about RPC methods
var GitalyProtoPreregistered *Registry
GitalyProtoPreregistered is a proto registry pre-registered with all gitalypb.GitalyProtos proto files.
func New ¶
func New(protos ...*descriptorpb.FileDescriptorProto) (*Registry, error)
New creates a new ProtoRegistry with info from one or more descriptor.FileDescriptorProto
func NewFromPaths ¶
NewFromPaths returns a new Registry, initialized with the contents of the provided files.
func (*Registry) IsInterceptedMethod ¶
IsInterceptedMethod returns whether Praefect intercepts the method call instead of proxying it.
func (*Registry) LookupMethod ¶
func (pr *Registry) LookupMethod(fullMethodName string) (MethodInfo, error)
LookupMethod looks up an MethodInfo by service and method name
func (*Registry) Methods ¶
func (pr *Registry) Methods() []MethodInfo
Methods returns all registered methods