Documentation ¶
Index ¶
- Constants
- Variables
- func AgentMDFromRawContext(ctx context.Context) (*api.AgentMD, error)
- func InjectLogger(ctx context.Context, log *zap.Logger) context.Context
- func IsStatusError(err error) bool
- func LoggerFromContext(ctx context.Context) *zap.Logger
- func MetaToValuesMap(meta metadata.MD) map[string]*prototool.Values
- func NewTokenCredentials(token api.AgentToken, insecure bool) credentials.PerRPCCredentials
- func RequestCanceled(err error) bool
- func StartServer(stage stager.Stage, server *grpc.Server, interceptorsCancel context.CancelFunc, ...)
- func StreamClientCtxAugmentingInterceptor(f ContextAugmenter) grpc.StreamClientInterceptor
- func StreamClientLimitingInterceptor(limiter ClientLimiter) grpc.StreamClientInterceptor
- func StreamClientValidatingInterceptor(parentCtx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, ...) (grpc.ClientStream, error)
- func StreamServerAgentMDInterceptor() grpc.StreamServerInterceptor
- func StreamServerCtxAugmentingInterceptor(f ContextAugmenter) grpc.StreamServerInterceptor
- func StreamServerLimitingInterceptor(limiter ServerLimiter) grpc.StreamServerInterceptor
- func StreamServerLoggerInterceptor(log *zap.Logger) grpc.StreamServerInterceptor
- func UnaryClientCtxAugmentingInterceptor(f ContextAugmenter) grpc.UnaryClientInterceptor
- func UnaryClientLimitingInterceptor(limiter ClientLimiter) grpc.UnaryClientInterceptor
- func UnaryClientValidatingInterceptor(parentCtx context.Context, method string, req, reply interface{}, ...) error
- func UnaryServerAgentMDInterceptor() grpc.UnaryServerInterceptor
- func UnaryServerCtxAugmentingInterceptor(f ContextAugmenter) grpc.UnaryServerInterceptor
- func UnaryServerLimitingInterceptor(limiter ServerLimiter) grpc.UnaryServerInterceptor
- func UnaryServerLoggerInterceptor(log *zap.Logger) grpc.UnaryServerInterceptor
- func ValuesMapToMeta(vals map[string]*prototool.Values) metadata.MD
- type API
- type ClientLimiter
- type ContextAugmenter
- type DialListener
- type EOFCallback
- type HttpDo
- type HttpRequest
- func (*HttpRequest) Descriptor() ([]byte, []int)deprecated
- func (x *HttpRequest) GetData() *HttpRequest_Data
- func (x *HttpRequest) GetHeader() *HttpRequest_Header
- func (m *HttpRequest) GetMessage() isHttpRequest_Message
- func (x *HttpRequest) GetTrailer() *HttpRequest_Trailer
- func (*HttpRequest) ProtoMessage()
- func (x *HttpRequest) ProtoReflect() protoreflect.Message
- func (x *HttpRequest) Reset()
- func (x *HttpRequest) String() string
- func (m *HttpRequest) Validate() error
- type HttpRequestValidationError
- func (e HttpRequestValidationError) Cause() error
- func (e HttpRequestValidationError) Error() string
- func (e HttpRequestValidationError) ErrorName() string
- func (e HttpRequestValidationError) Field() string
- func (e HttpRequestValidationError) Key() bool
- func (e HttpRequestValidationError) Reason() string
- type HttpRequest_Data
- func (*HttpRequest_Data) Descriptor() ([]byte, []int)deprecated
- func (x *HttpRequest_Data) GetData() []byte
- func (*HttpRequest_Data) ProtoMessage()
- func (x *HttpRequest_Data) ProtoReflect() protoreflect.Message
- func (x *HttpRequest_Data) Reset()
- func (x *HttpRequest_Data) String() string
- func (m *HttpRequest_Data) Validate() error
- type HttpRequest_DataValidationError
- func (e HttpRequest_DataValidationError) Cause() error
- func (e HttpRequest_DataValidationError) Error() string
- func (e HttpRequest_DataValidationError) ErrorName() string
- func (e HttpRequest_DataValidationError) Field() string
- func (e HttpRequest_DataValidationError) Key() bool
- func (e HttpRequest_DataValidationError) Reason() string
- type HttpRequest_Data_
- type HttpRequest_Header
- func (*HttpRequest_Header) Descriptor() ([]byte, []int)deprecated
- func (x *HttpRequest_Header) GetExtra() *any.Any
- func (x *HttpRequest_Header) GetRequest() *prototool.HttpRequest
- func (*HttpRequest_Header) ProtoMessage()
- func (x *HttpRequest_Header) ProtoReflect() protoreflect.Message
- func (x *HttpRequest_Header) Reset()
- func (x *HttpRequest_Header) String() string
- func (m *HttpRequest_Header) Validate() error
- type HttpRequest_HeaderValidationError
- func (e HttpRequest_HeaderValidationError) Cause() error
- func (e HttpRequest_HeaderValidationError) Error() string
- func (e HttpRequest_HeaderValidationError) ErrorName() string
- func (e HttpRequest_HeaderValidationError) Field() string
- func (e HttpRequest_HeaderValidationError) Key() bool
- func (e HttpRequest_HeaderValidationError) Reason() string
- type HttpRequest_Header_
- type HttpRequest_Trailer
- func (*HttpRequest_Trailer) Descriptor() ([]byte, []int)deprecated
- func (*HttpRequest_Trailer) ProtoMessage()
- func (x *HttpRequest_Trailer) ProtoReflect() protoreflect.Message
- func (x *HttpRequest_Trailer) Reset()
- func (x *HttpRequest_Trailer) String() string
- func (m *HttpRequest_Trailer) Validate() error
- type HttpRequest_TrailerValidationError
- func (e HttpRequest_TrailerValidationError) Cause() error
- func (e HttpRequest_TrailerValidationError) Error() string
- func (e HttpRequest_TrailerValidationError) ErrorName() string
- func (e HttpRequest_TrailerValidationError) Field() string
- func (e HttpRequest_TrailerValidationError) Key() bool
- func (e HttpRequest_TrailerValidationError) Reason() string
- type HttpRequest_Trailer_
- type HttpResponse
- func (*HttpResponse) Descriptor() ([]byte, []int)deprecated
- func (x *HttpResponse) GetData() *HttpResponse_Data
- func (x *HttpResponse) GetHeader() *HttpResponse_Header
- func (m *HttpResponse) GetMessage() isHttpResponse_Message
- func (x *HttpResponse) GetTrailer() *HttpResponse_Trailer
- func (*HttpResponse) ProtoMessage()
- func (x *HttpResponse) ProtoReflect() protoreflect.Message
- func (x *HttpResponse) Reset()
- func (x *HttpResponse) String() string
- func (m *HttpResponse) Validate() error
- type HttpResponseValidationError
- func (e HttpResponseValidationError) Cause() error
- func (e HttpResponseValidationError) Error() string
- func (e HttpResponseValidationError) ErrorName() string
- func (e HttpResponseValidationError) Field() string
- func (e HttpResponseValidationError) Key() bool
- func (e HttpResponseValidationError) Reason() string
- type HttpResponse_Data
- func (*HttpResponse_Data) Descriptor() ([]byte, []int)deprecated
- func (x *HttpResponse_Data) GetData() []byte
- func (*HttpResponse_Data) ProtoMessage()
- func (x *HttpResponse_Data) ProtoReflect() protoreflect.Message
- func (x *HttpResponse_Data) Reset()
- func (x *HttpResponse_Data) String() string
- func (m *HttpResponse_Data) Validate() error
- type HttpResponse_DataValidationError
- func (e HttpResponse_DataValidationError) Cause() error
- func (e HttpResponse_DataValidationError) Error() string
- func (e HttpResponse_DataValidationError) ErrorName() string
- func (e HttpResponse_DataValidationError) Field() string
- func (e HttpResponse_DataValidationError) Key() bool
- func (e HttpResponse_DataValidationError) Reason() string
- type HttpResponse_Data_
- type HttpResponse_Header
- func (*HttpResponse_Header) Descriptor() ([]byte, []int)deprecated
- func (x *HttpResponse_Header) GetResponse() *prototool.HttpResponse
- func (*HttpResponse_Header) ProtoMessage()
- func (x *HttpResponse_Header) ProtoReflect() protoreflect.Message
- func (x *HttpResponse_Header) Reset()
- func (x *HttpResponse_Header) String() string
- func (m *HttpResponse_Header) Validate() error
- type HttpResponse_HeaderValidationError
- func (e HttpResponse_HeaderValidationError) Cause() error
- func (e HttpResponse_HeaderValidationError) Error() string
- func (e HttpResponse_HeaderValidationError) ErrorName() string
- func (e HttpResponse_HeaderValidationError) Field() string
- func (e HttpResponse_HeaderValidationError) Key() bool
- func (e HttpResponse_HeaderValidationError) Reason() string
- type HttpResponse_Header_
- type HttpResponse_Trailer
- func (*HttpResponse_Trailer) Descriptor() ([]byte, []int)deprecated
- func (*HttpResponse_Trailer) ProtoMessage()
- func (x *HttpResponse_Trailer) ProtoReflect() protoreflect.Message
- func (x *HttpResponse_Trailer) Reset()
- func (x *HttpResponse_Trailer) String() string
- func (m *HttpResponse_Trailer) Validate() error
- type HttpResponse_TrailerValidationError
- func (e HttpResponse_TrailerValidationError) Cause() error
- func (e HttpResponse_TrailerValidationError) Error() string
- func (e HttpResponse_TrailerValidationError) ErrorName() string
- func (e HttpResponse_TrailerValidationError) Field() string
- func (e HttpResponse_TrailerValidationError) Key() bool
- func (e HttpResponse_TrailerValidationError) Reason() string
- type HttpResponse_Trailer_
- type InboundGrpcToOutboundHttp
- type InboundGrpcToOutboundHttpStream
- type InvalidTransitionCallback
- type JWTAuther
- type JwtCredentials
- type MessageCallback
- type RawCodec
- type RawCodecWithProtoFallback
- type RawFrame
- type ServerLimiter
- type Stream
- type StreamVisitor
- type StreamVisitorOption
- func WithCallback(transitionTo protoreflect.FieldNumber, cb MessageCallback) StreamVisitorOption
- func WithEOFCallback(cb EOFCallback) StreamVisitorOption
- func WithInvalidTransitionCallback(cb InvalidTransitionCallback) StreamVisitorOption
- func WithStartState(startState protoreflect.FieldNumber) StreamVisitorOption
Constants ¶
const (
MetadataAuthorization = "authorization"
)
Variables ¶
var File_internal_tool_grpctool_grpctool_proto protoreflect.FileDescriptor
Functions ¶
func IsStatusError ¶
func NewTokenCredentials ¶
func NewTokenCredentials(token api.AgentToken, insecure bool) credentials.PerRPCCredentials
func RequestCanceled ¶
func StartServer ¶
func StreamClientCtxAugmentingInterceptor ¶
func StreamClientCtxAugmentingInterceptor(f ContextAugmenter) grpc.StreamClientInterceptor
StreamClientLimitingInterceptor returns a new stream server interceptor that augments connection context.
func StreamClientLimitingInterceptor ¶
func StreamClientLimitingInterceptor(limiter ClientLimiter) grpc.StreamClientInterceptor
StreamClientLimitingInterceptor returns a new stream server interceptor that performs rate limiting on the request.
func StreamClientValidatingInterceptor ¶
func StreamClientValidatingInterceptor(parentCtx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error)
StreamClientValidatingInterceptor is a stream client interceptor that performs response stream validation.
func StreamServerAgentMDInterceptor ¶
func StreamServerAgentMDInterceptor() grpc.StreamServerInterceptor
StreamServerAgentMDInterceptor is a gRPC server-side interceptor that populates context with api.AgentMD for streaming RPCs.
func StreamServerCtxAugmentingInterceptor ¶
func StreamServerCtxAugmentingInterceptor(f ContextAugmenter) grpc.StreamServerInterceptor
StreamServerCtxAugmentingInterceptor returns a new stream server interceptor that augments connection context.
func StreamServerLimitingInterceptor ¶
func StreamServerLimitingInterceptor(limiter ServerLimiter) grpc.StreamServerInterceptor
StreamServerLimitingInterceptor returns a new stream server interceptor that performs limiting based on the given context
func StreamServerLoggerInterceptor ¶
func StreamServerLoggerInterceptor(log *zap.Logger) grpc.StreamServerInterceptor
StreamServerLoggerInterceptor returns a new stream server interceptor that augments connection context with a logger. The logger gets a correlation id field from the context, gRPC service and gRPC method.
func UnaryClientCtxAugmentingInterceptor ¶
func UnaryClientCtxAugmentingInterceptor(f ContextAugmenter) grpc.UnaryClientInterceptor
UnaryClientCtxAugmentingInterceptor returns a new unary client interceptor that augments connection context.
func UnaryClientLimitingInterceptor ¶
func UnaryClientLimitingInterceptor(limiter ClientLimiter) grpc.UnaryClientInterceptor
UnaryClientLimitingInterceptor returns a new unary client interceptor that performs request rate limiting.
func UnaryClientValidatingInterceptor ¶
func UnaryClientValidatingInterceptor(parentCtx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error
UnaryClientValidatingInterceptor is a unary client interceptor that performs response validation.
func UnaryServerAgentMDInterceptor ¶
func UnaryServerAgentMDInterceptor() grpc.UnaryServerInterceptor
UnaryServerAgentMDInterceptor is a gRPC server-side interceptor that populates context with api.AgentMD for unary RPCs.
func UnaryServerCtxAugmentingInterceptor ¶
func UnaryServerCtxAugmentingInterceptor(f ContextAugmenter) grpc.UnaryServerInterceptor
UnaryServerCtxAugmentingInterceptor returns a new unary server interceptor that augments connection context.
func UnaryServerLimitingInterceptor ¶
func UnaryServerLimitingInterceptor(limiter ServerLimiter) grpc.UnaryServerInterceptor
UnaryServerLimitingInterceptor returns a new unary server interceptor that performs limiting based on the given context
func UnaryServerLoggerInterceptor ¶
func UnaryServerLoggerInterceptor(log *zap.Logger) grpc.UnaryServerInterceptor
UnaryServerLoggerInterceptor returns a new unary server interceptor that augments connection context with a logger. The logger gets a correlation id field from the context, gRPC service and gRPC method.
Types ¶
type API ¶
type API interface { HandleProcessingError(ctx context.Context, log *zap.Logger, msg string, err error) HandleSendError(log *zap.Logger, msg string, err error) error }
API is a reduced version on modshared.API. It's here to avoid the dependency.
type ClientLimiter ¶
type ClientLimiter interface { // Wait blocks until limiter permits an event to happen. // It returns an error if the Context is // canceled, or the expected wait time exceeds the Context's Deadline. Wait(context.Context) error }
ClientLimiter defines the interface to perform client-side request rate limiting. You can use golang.org/x/time/rate.Limiter as an implementation of this interface.
type ContextAugmenter ¶
func JoinContexts ¶
func JoinContexts(aux context.Context) ContextAugmenter
JoinContexts returns a ContextAugmenter that alters the main context to propagate cancellation from the aux context. The returned context uses main as the parent context to inherit attached values.
This helper is used here to propagate done signal from both gRPC stream's context (stream is closed/broken) and main program's context (program needs to stop). Polling should stop when one of this conditions happens so using only one of these two contexts is not good enough.
type DialListener ¶
type DialListener struct {
// contains filtered or unexported fields
}
func NewDialListener ¶
func NewDialListener() *DialListener
func (*DialListener) Addr ¶
func (l *DialListener) Addr() net.Addr
func (*DialListener) Close ¶
func (l *DialListener) Close() error
func (*DialListener) DialContext ¶
type EOFCallback ¶
type EOFCallback func() error
type HttpRequest ¶
type HttpRequest struct { // Types that are assignable to Message: // *HttpRequest_Header_ // *HttpRequest_Data_ // *HttpRequest_Trailer_ Message isHttpRequest_Message `protobuf_oneof:"message"` // contains filtered or unexported fields }
func (*HttpRequest) Descriptor
deprecated
func (*HttpRequest) Descriptor() ([]byte, []int)
Deprecated: Use HttpRequest.ProtoReflect.Descriptor instead.
func (*HttpRequest) GetData ¶
func (x *HttpRequest) GetData() *HttpRequest_Data
func (*HttpRequest) GetHeader ¶
func (x *HttpRequest) GetHeader() *HttpRequest_Header
func (*HttpRequest) GetMessage ¶
func (m *HttpRequest) GetMessage() isHttpRequest_Message
func (*HttpRequest) GetTrailer ¶
func (x *HttpRequest) GetTrailer() *HttpRequest_Trailer
func (*HttpRequest) ProtoMessage ¶
func (*HttpRequest) ProtoMessage()
func (*HttpRequest) ProtoReflect ¶
func (x *HttpRequest) ProtoReflect() protoreflect.Message
func (*HttpRequest) Reset ¶
func (x *HttpRequest) Reset()
func (*HttpRequest) String ¶
func (x *HttpRequest) String() string
func (*HttpRequest) Validate ¶
func (m *HttpRequest) Validate() error
Validate checks the field values on HttpRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type HttpRequestValidationError ¶
type HttpRequestValidationError struct {
// contains filtered or unexported fields
}
HttpRequestValidationError is the validation error returned by HttpRequest.Validate if the designated constraints aren't met.
func (HttpRequestValidationError) Cause ¶
func (e HttpRequestValidationError) Cause() error
Cause function returns cause value.
func (HttpRequestValidationError) Error ¶
func (e HttpRequestValidationError) Error() string
Error satisfies the builtin error interface
func (HttpRequestValidationError) ErrorName ¶
func (e HttpRequestValidationError) ErrorName() string
ErrorName returns error name.
func (HttpRequestValidationError) Field ¶
func (e HttpRequestValidationError) Field() string
Field function returns field value.
func (HttpRequestValidationError) Key ¶
func (e HttpRequestValidationError) Key() bool
Key function returns key value.
func (HttpRequestValidationError) Reason ¶
func (e HttpRequestValidationError) Reason() string
Reason function returns reason value.
type HttpRequest_Data ¶
type HttpRequest_Data struct { Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*HttpRequest_Data) Descriptor
deprecated
func (*HttpRequest_Data) Descriptor() ([]byte, []int)
Deprecated: Use HttpRequest_Data.ProtoReflect.Descriptor instead.
func (*HttpRequest_Data) GetData ¶
func (x *HttpRequest_Data) GetData() []byte
func (*HttpRequest_Data) ProtoMessage ¶
func (*HttpRequest_Data) ProtoMessage()
func (*HttpRequest_Data) ProtoReflect ¶
func (x *HttpRequest_Data) ProtoReflect() protoreflect.Message
func (*HttpRequest_Data) Reset ¶
func (x *HttpRequest_Data) Reset()
func (*HttpRequest_Data) String ¶
func (x *HttpRequest_Data) String() string
func (*HttpRequest_Data) Validate ¶
func (m *HttpRequest_Data) Validate() error
Validate checks the field values on HttpRequest_Data with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type HttpRequest_DataValidationError ¶
type HttpRequest_DataValidationError struct {
// contains filtered or unexported fields
}
HttpRequest_DataValidationError is the validation error returned by HttpRequest_Data.Validate if the designated constraints aren't met.
func (HttpRequest_DataValidationError) Cause ¶
func (e HttpRequest_DataValidationError) Cause() error
Cause function returns cause value.
func (HttpRequest_DataValidationError) Error ¶
func (e HttpRequest_DataValidationError) Error() string
Error satisfies the builtin error interface
func (HttpRequest_DataValidationError) ErrorName ¶
func (e HttpRequest_DataValidationError) ErrorName() string
ErrorName returns error name.
func (HttpRequest_DataValidationError) Field ¶
func (e HttpRequest_DataValidationError) Field() string
Field function returns field value.
func (HttpRequest_DataValidationError) Key ¶
func (e HttpRequest_DataValidationError) Key() bool
Key function returns key value.
func (HttpRequest_DataValidationError) Reason ¶
func (e HttpRequest_DataValidationError) Reason() string
Reason function returns reason value.
type HttpRequest_Data_ ¶
type HttpRequest_Data_ struct {
Data *HttpRequest_Data `protobuf:"bytes,2,opt,name=data,proto3,oneof"`
}
type HttpRequest_Header ¶
type HttpRequest_Header struct { Request *prototool.HttpRequest `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` Extra *any.Any `protobuf:"bytes,2,opt,name=extra,proto3" json:"extra,omitempty"` // contains filtered or unexported fields }
func (*HttpRequest_Header) Descriptor
deprecated
func (*HttpRequest_Header) Descriptor() ([]byte, []int)
Deprecated: Use HttpRequest_Header.ProtoReflect.Descriptor instead.
func (*HttpRequest_Header) GetExtra ¶
func (x *HttpRequest_Header) GetExtra() *any.Any
func (*HttpRequest_Header) GetRequest ¶
func (x *HttpRequest_Header) GetRequest() *prototool.HttpRequest
func (*HttpRequest_Header) ProtoMessage ¶
func (*HttpRequest_Header) ProtoMessage()
func (*HttpRequest_Header) ProtoReflect ¶
func (x *HttpRequest_Header) ProtoReflect() protoreflect.Message
func (*HttpRequest_Header) Reset ¶
func (x *HttpRequest_Header) Reset()
func (*HttpRequest_Header) String ¶
func (x *HttpRequest_Header) String() string
func (*HttpRequest_Header) Validate ¶
func (m *HttpRequest_Header) Validate() error
Validate checks the field values on HttpRequest_Header with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type HttpRequest_HeaderValidationError ¶
type HttpRequest_HeaderValidationError struct {
// contains filtered or unexported fields
}
HttpRequest_HeaderValidationError is the validation error returned by HttpRequest_Header.Validate if the designated constraints aren't met.
func (HttpRequest_HeaderValidationError) Cause ¶
func (e HttpRequest_HeaderValidationError) Cause() error
Cause function returns cause value.
func (HttpRequest_HeaderValidationError) Error ¶
func (e HttpRequest_HeaderValidationError) Error() string
Error satisfies the builtin error interface
func (HttpRequest_HeaderValidationError) ErrorName ¶
func (e HttpRequest_HeaderValidationError) ErrorName() string
ErrorName returns error name.
func (HttpRequest_HeaderValidationError) Field ¶
func (e HttpRequest_HeaderValidationError) Field() string
Field function returns field value.
func (HttpRequest_HeaderValidationError) Key ¶
func (e HttpRequest_HeaderValidationError) Key() bool
Key function returns key value.
func (HttpRequest_HeaderValidationError) Reason ¶
func (e HttpRequest_HeaderValidationError) Reason() string
Reason function returns reason value.
type HttpRequest_Header_ ¶
type HttpRequest_Header_ struct {
Header *HttpRequest_Header `protobuf:"bytes,1,opt,name=header,proto3,oneof"`
}
type HttpRequest_Trailer ¶
type HttpRequest_Trailer struct {
// contains filtered or unexported fields
}
func (*HttpRequest_Trailer) Descriptor
deprecated
func (*HttpRequest_Trailer) Descriptor() ([]byte, []int)
Deprecated: Use HttpRequest_Trailer.ProtoReflect.Descriptor instead.
func (*HttpRequest_Trailer) ProtoMessage ¶
func (*HttpRequest_Trailer) ProtoMessage()
func (*HttpRequest_Trailer) ProtoReflect ¶
func (x *HttpRequest_Trailer) ProtoReflect() protoreflect.Message
func (*HttpRequest_Trailer) Reset ¶
func (x *HttpRequest_Trailer) Reset()
func (*HttpRequest_Trailer) String ¶
func (x *HttpRequest_Trailer) String() string
func (*HttpRequest_Trailer) Validate ¶
func (m *HttpRequest_Trailer) Validate() error
Validate checks the field values on HttpRequest_Trailer with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type HttpRequest_TrailerValidationError ¶
type HttpRequest_TrailerValidationError struct {
// contains filtered or unexported fields
}
HttpRequest_TrailerValidationError is the validation error returned by HttpRequest_Trailer.Validate if the designated constraints aren't met.
func (HttpRequest_TrailerValidationError) Cause ¶
func (e HttpRequest_TrailerValidationError) Cause() error
Cause function returns cause value.
func (HttpRequest_TrailerValidationError) Error ¶
func (e HttpRequest_TrailerValidationError) Error() string
Error satisfies the builtin error interface
func (HttpRequest_TrailerValidationError) ErrorName ¶
func (e HttpRequest_TrailerValidationError) ErrorName() string
ErrorName returns error name.
func (HttpRequest_TrailerValidationError) Field ¶
func (e HttpRequest_TrailerValidationError) Field() string
Field function returns field value.
func (HttpRequest_TrailerValidationError) Key ¶
func (e HttpRequest_TrailerValidationError) Key() bool
Key function returns key value.
func (HttpRequest_TrailerValidationError) Reason ¶
func (e HttpRequest_TrailerValidationError) Reason() string
Reason function returns reason value.
type HttpRequest_Trailer_ ¶
type HttpRequest_Trailer_ struct {
Trailer *HttpRequest_Trailer `protobuf:"bytes,3,opt,name=trailer,proto3,oneof"`
}
type HttpResponse ¶
type HttpResponse struct { // Types that are assignable to Message: // *HttpResponse_Header_ // *HttpResponse_Data_ // *HttpResponse_Trailer_ Message isHttpResponse_Message `protobuf_oneof:"message"` // contains filtered or unexported fields }
func (*HttpResponse) Descriptor
deprecated
func (*HttpResponse) Descriptor() ([]byte, []int)
Deprecated: Use HttpResponse.ProtoReflect.Descriptor instead.
func (*HttpResponse) GetData ¶
func (x *HttpResponse) GetData() *HttpResponse_Data
func (*HttpResponse) GetHeader ¶
func (x *HttpResponse) GetHeader() *HttpResponse_Header
func (*HttpResponse) GetMessage ¶
func (m *HttpResponse) GetMessage() isHttpResponse_Message
func (*HttpResponse) GetTrailer ¶
func (x *HttpResponse) GetTrailer() *HttpResponse_Trailer
func (*HttpResponse) ProtoMessage ¶
func (*HttpResponse) ProtoMessage()
func (*HttpResponse) ProtoReflect ¶
func (x *HttpResponse) ProtoReflect() protoreflect.Message
func (*HttpResponse) Reset ¶
func (x *HttpResponse) Reset()
func (*HttpResponse) String ¶
func (x *HttpResponse) String() string
func (*HttpResponse) Validate ¶
func (m *HttpResponse) Validate() error
Validate checks the field values on HttpResponse with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type HttpResponseValidationError ¶
type HttpResponseValidationError struct {
// contains filtered or unexported fields
}
HttpResponseValidationError is the validation error returned by HttpResponse.Validate if the designated constraints aren't met.
func (HttpResponseValidationError) Cause ¶
func (e HttpResponseValidationError) Cause() error
Cause function returns cause value.
func (HttpResponseValidationError) Error ¶
func (e HttpResponseValidationError) Error() string
Error satisfies the builtin error interface
func (HttpResponseValidationError) ErrorName ¶
func (e HttpResponseValidationError) ErrorName() string
ErrorName returns error name.
func (HttpResponseValidationError) Field ¶
func (e HttpResponseValidationError) Field() string
Field function returns field value.
func (HttpResponseValidationError) Key ¶
func (e HttpResponseValidationError) Key() bool
Key function returns key value.
func (HttpResponseValidationError) Reason ¶
func (e HttpResponseValidationError) Reason() string
Reason function returns reason value.
type HttpResponse_Data ¶
type HttpResponse_Data struct { Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*HttpResponse_Data) Descriptor
deprecated
func (*HttpResponse_Data) Descriptor() ([]byte, []int)
Deprecated: Use HttpResponse_Data.ProtoReflect.Descriptor instead.
func (*HttpResponse_Data) GetData ¶
func (x *HttpResponse_Data) GetData() []byte
func (*HttpResponse_Data) ProtoMessage ¶
func (*HttpResponse_Data) ProtoMessage()
func (*HttpResponse_Data) ProtoReflect ¶
func (x *HttpResponse_Data) ProtoReflect() protoreflect.Message
func (*HttpResponse_Data) Reset ¶
func (x *HttpResponse_Data) Reset()
func (*HttpResponse_Data) String ¶
func (x *HttpResponse_Data) String() string
func (*HttpResponse_Data) Validate ¶
func (m *HttpResponse_Data) Validate() error
Validate checks the field values on HttpResponse_Data with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type HttpResponse_DataValidationError ¶
type HttpResponse_DataValidationError struct {
// contains filtered or unexported fields
}
HttpResponse_DataValidationError is the validation error returned by HttpResponse_Data.Validate if the designated constraints aren't met.
func (HttpResponse_DataValidationError) Cause ¶
func (e HttpResponse_DataValidationError) Cause() error
Cause function returns cause value.
func (HttpResponse_DataValidationError) Error ¶
func (e HttpResponse_DataValidationError) Error() string
Error satisfies the builtin error interface
func (HttpResponse_DataValidationError) ErrorName ¶
func (e HttpResponse_DataValidationError) ErrorName() string
ErrorName returns error name.
func (HttpResponse_DataValidationError) Field ¶
func (e HttpResponse_DataValidationError) Field() string
Field function returns field value.
func (HttpResponse_DataValidationError) Key ¶
func (e HttpResponse_DataValidationError) Key() bool
Key function returns key value.
func (HttpResponse_DataValidationError) Reason ¶
func (e HttpResponse_DataValidationError) Reason() string
Reason function returns reason value.
type HttpResponse_Data_ ¶
type HttpResponse_Data_ struct {
Data *HttpResponse_Data `protobuf:"bytes,2,opt,name=data,proto3,oneof"`
}
type HttpResponse_Header ¶
type HttpResponse_Header struct { Response *prototool.HttpResponse `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` // contains filtered or unexported fields }
func (*HttpResponse_Header) Descriptor
deprecated
func (*HttpResponse_Header) Descriptor() ([]byte, []int)
Deprecated: Use HttpResponse_Header.ProtoReflect.Descriptor instead.
func (*HttpResponse_Header) GetResponse ¶
func (x *HttpResponse_Header) GetResponse() *prototool.HttpResponse
func (*HttpResponse_Header) ProtoMessage ¶
func (*HttpResponse_Header) ProtoMessage()
func (*HttpResponse_Header) ProtoReflect ¶
func (x *HttpResponse_Header) ProtoReflect() protoreflect.Message
func (*HttpResponse_Header) Reset ¶
func (x *HttpResponse_Header) Reset()
func (*HttpResponse_Header) String ¶
func (x *HttpResponse_Header) String() string
func (*HttpResponse_Header) Validate ¶
func (m *HttpResponse_Header) Validate() error
Validate checks the field values on HttpResponse_Header with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type HttpResponse_HeaderValidationError ¶
type HttpResponse_HeaderValidationError struct {
// contains filtered or unexported fields
}
HttpResponse_HeaderValidationError is the validation error returned by HttpResponse_Header.Validate if the designated constraints aren't met.
func (HttpResponse_HeaderValidationError) Cause ¶
func (e HttpResponse_HeaderValidationError) Cause() error
Cause function returns cause value.
func (HttpResponse_HeaderValidationError) Error ¶
func (e HttpResponse_HeaderValidationError) Error() string
Error satisfies the builtin error interface
func (HttpResponse_HeaderValidationError) ErrorName ¶
func (e HttpResponse_HeaderValidationError) ErrorName() string
ErrorName returns error name.
func (HttpResponse_HeaderValidationError) Field ¶
func (e HttpResponse_HeaderValidationError) Field() string
Field function returns field value.
func (HttpResponse_HeaderValidationError) Key ¶
func (e HttpResponse_HeaderValidationError) Key() bool
Key function returns key value.
func (HttpResponse_HeaderValidationError) Reason ¶
func (e HttpResponse_HeaderValidationError) Reason() string
Reason function returns reason value.
type HttpResponse_Header_ ¶
type HttpResponse_Header_ struct {
Header *HttpResponse_Header `protobuf:"bytes,1,opt,name=header,proto3,oneof"`
}
type HttpResponse_Trailer ¶
type HttpResponse_Trailer struct {
// contains filtered or unexported fields
}
func (*HttpResponse_Trailer) Descriptor
deprecated
func (*HttpResponse_Trailer) Descriptor() ([]byte, []int)
Deprecated: Use HttpResponse_Trailer.ProtoReflect.Descriptor instead.
func (*HttpResponse_Trailer) ProtoMessage ¶
func (*HttpResponse_Trailer) ProtoMessage()
func (*HttpResponse_Trailer) ProtoReflect ¶
func (x *HttpResponse_Trailer) ProtoReflect() protoreflect.Message
func (*HttpResponse_Trailer) Reset ¶
func (x *HttpResponse_Trailer) Reset()
func (*HttpResponse_Trailer) String ¶
func (x *HttpResponse_Trailer) String() string
func (*HttpResponse_Trailer) Validate ¶
func (m *HttpResponse_Trailer) Validate() error
Validate checks the field values on HttpResponse_Trailer with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.
type HttpResponse_TrailerValidationError ¶
type HttpResponse_TrailerValidationError struct {
// contains filtered or unexported fields
}
HttpResponse_TrailerValidationError is the validation error returned by HttpResponse_Trailer.Validate if the designated constraints aren't met.
func (HttpResponse_TrailerValidationError) Cause ¶
func (e HttpResponse_TrailerValidationError) Cause() error
Cause function returns cause value.
func (HttpResponse_TrailerValidationError) Error ¶
func (e HttpResponse_TrailerValidationError) Error() string
Error satisfies the builtin error interface
func (HttpResponse_TrailerValidationError) ErrorName ¶
func (e HttpResponse_TrailerValidationError) ErrorName() string
ErrorName returns error name.
func (HttpResponse_TrailerValidationError) Field ¶
func (e HttpResponse_TrailerValidationError) Field() string
Field function returns field value.
func (HttpResponse_TrailerValidationError) Key ¶
func (e HttpResponse_TrailerValidationError) Key() bool
Key function returns key value.
func (HttpResponse_TrailerValidationError) Reason ¶
func (e HttpResponse_TrailerValidationError) Reason() string
Reason function returns reason value.
type HttpResponse_Trailer_ ¶
type HttpResponse_Trailer_ struct {
Trailer *HttpResponse_Trailer `protobuf:"bytes,3,opt,name=trailer,proto3,oneof"`
}
type InboundGrpcToOutboundHttp ¶
type InboundGrpcToOutboundHttp struct {
// contains filtered or unexported fields
}
func NewInboundGrpcToOutboundHttp ¶
func NewInboundGrpcToOutboundHttp(api API, httpDo HttpDo) *InboundGrpcToOutboundHttp
func (*InboundGrpcToOutboundHttp) Pipe ¶
func (x *InboundGrpcToOutboundHttp) Pipe(server InboundGrpcToOutboundHttpStream) error
type InboundGrpcToOutboundHttpStream ¶
type InboundGrpcToOutboundHttpStream interface { Send(*HttpResponse) error grpc.ServerStream }
type InvalidTransitionCallback ¶
type InvalidTransitionCallback func(from, to protoreflect.FieldNumber, allowed []protoreflect.FieldNumber, message proto.Message) error
InvalidTransitionCallback is a callback that is called when an invalid transition is attempted. 'message' is nil when 'to' is eofState.
type JWTAuther ¶
type JWTAuther struct {
// contains filtered or unexported fields
}
func NewJWTAuther ¶
func (*JWTAuther) StreamServerInterceptor ¶
func (a *JWTAuther) StreamServerInterceptor(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error
StreamServerInterceptor returns a new stream server interceptors that performs per-request JWT auth.
func (*JWTAuther) UnaryServerInterceptor ¶
func (a *JWTAuther) UnaryServerInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
UnaryServerInterceptor returns a new unary server interceptors that performs per-request JWT auth.
type JwtCredentials ¶
func (*JwtCredentials) GetRequestMetadata ¶
func (*JwtCredentials) RequireTransportSecurity ¶
func (c *JwtCredentials) RequireTransportSecurity() bool
type MessageCallback ¶
type MessageCallback interface{}
MessageCallback is a function with signature func(message someConcreteProtoMessage) error someConcreteProtoMessage must be the type passed to NewStreamVisitor().
type RawCodec ¶
type RawCodec struct { }
RawCodec is a *raw* encoding.Codec. This codec treats a gRPC message frame as raw bytes.
type RawCodecWithProtoFallback ¶
type RawCodecWithProtoFallback struct { }
RawCodecWithProtoFallback is a *raw* encoding.Codec. This codec treats a gRPC message as raw bytes if it's RawFrame and falls back to default proto encoding for other message types.
func (RawCodecWithProtoFallback) Marshal ¶
func (c RawCodecWithProtoFallback) Marshal(v interface{}) ([]byte, error)
func (RawCodecWithProtoFallback) Name ¶
func (c RawCodecWithProtoFallback) Name() string
func (RawCodecWithProtoFallback) String ¶
func (c RawCodecWithProtoFallback) String() string
String is here for compatibility with grpc.Codec interface.
func (RawCodecWithProtoFallback) Unmarshal ¶
func (c RawCodecWithProtoFallback) Unmarshal(data []byte, v interface{}) error
type ServerLimiter ¶
type ServerLimiter interface { // Allow should return true and consume one "limitable event" if the limit has not been exceeded. Otherwise, it returns false and does not count towards the limit Allow(ctx context.Context) bool }
ServerLimiter defines the interface to perform server-side request rate limiting. Inspired by golang.org/x/time/rate.Limiter, but accepts a context
type Stream ¶
type Stream interface {
RecvMsg(m interface{}) error
}
Stream is a grpc.ServerStream or grpc.ClientStream.
type StreamVisitor ¶
type StreamVisitor struct {
// contains filtered or unexported fields
}
StreamVisitor allows to consume messages in a gRPC stream. Message order should follow the automata, defined on fields in a oneof group.
func NewStreamVisitor ¶
func NewStreamVisitor(streamMessage proto.Message) (*StreamVisitor, error)
func (*StreamVisitor) Visit ¶
func (s *StreamVisitor) Visit(stream Stream, opts ...StreamVisitorOption) error
type StreamVisitorOption ¶
type StreamVisitorOption func(*config) error
func WithCallback ¶
func WithCallback(transitionTo protoreflect.FieldNumber, cb MessageCallback) StreamVisitorOption
WithCallback registers cb to be called when entering transitionTo when parsing the stream. Only one callback can be registered per target
func WithEOFCallback ¶
func WithEOFCallback(cb EOFCallback) StreamVisitorOption
func WithInvalidTransitionCallback ¶
func WithInvalidTransitionCallback(cb InvalidTransitionCallback) StreamVisitorOption
func WithStartState ¶
func WithStartState(startState protoreflect.FieldNumber) StreamVisitorOption
WithStartState allows to specify a custom automata start state. The visitor then acts as if it has just visited field with startState number.
Source Files ¶
- agent_md.go
- client_ctx.go
- client_limiting.go
- client_validator.go
- dial_listener.go
- grpctool.pb.go
- grpctool.pb.validate.go
- inbound_grpc_to_outbound_http.go
- jwt_creds.go
- jwt_server_auth.go
- logger.go
- raw_codec.go
- server_ctx.go
- server_limiting.go
- stream_visitor.go
- stream_visitor_options.go
- token_creds.go
- tools.go