Documentation
¶
Index ¶
- Constants
- Variables
- func DescriptorSourceFromFileDescriptors(files ...*desc.FileDescriptor) (*fileSource, error)
- func Invoke(ctx context.Context, stub grpcdynamic.Stub, mthDesc *desc.MethodDescriptor, ...) (proto.Message, error)
- func RegisterExtension(source DescriptorSource, extReg *dynamic.ExtensionRegistry, ...) error
- type Config
- type Descriptor
- type DescriptorSource
- type DescriptorSourceStrategy
- type Filter
- type FilterFactory
- type Match
- type Plugin
- type Rule
Constants ¶
View Source
const ( // Kind is the kind of Fallback. Kind = constant.HTTPGrpcProxyFilter // DescriptorSourceKey current ds DescriptorSourceKey = "DescriptorSource" // GrpcClientConnKey the grpc-client-conn by the coroutine local GrpcClientConnKey = "GrpcClientConn" )
View Source
const ( NONE = "none" AUTO = "auto" LOCAL = "local" REMOTE = "remote" )
Variables ¶
View Source
var ErrReflectionNotSupported = errors.New("server does not support the reflection API")
Functions ¶
func DescriptorSourceFromFileDescriptors ¶
func DescriptorSourceFromFileDescriptors(files ...*desc.FileDescriptor) (*fileSource, error)
func Invoke ¶
func Invoke(ctx context.Context, stub grpcdynamic.Stub, mthDesc *desc.MethodDescriptor, grpcReq proto.Message, opts ...grpc.CallOption) (proto.Message, error)
func RegisterExtension ¶
func RegisterExtension(source DescriptorSource, extReg *dynamic.ExtensionRegistry, msgDesc *desc.MessageDescriptor, registered map[string]bool) error
Types ¶
type Config ¶
type Config struct { DescriptorSourceStrategy DescriptorSourceStrategy `yaml:"descriptor_source_strategy" json:"descriptor_source_strategy" default:"auto"` Path string `yaml:"path" json:"path"` Rules []*Rule `yaml:"rules" json:"rules"` //nolint Timeout time.Duration `yaml:"timeout" json:"timeout"` //nolint }
Config describe the config of AccessFilter
type Descriptor ¶
type Descriptor struct {
// contains filtered or unexported fields
}
func (*Descriptor) GetCurrentDescriptorSource ¶
func (dr *Descriptor) GetCurrentDescriptorSource(ctx context.Context) (DescriptorSource, error)
type DescriptorSource ¶
type DescriptorSource interface { // ListServices returns a list of fully-qualified service names. It will be all services in a set of // descriptor files or the set of all services exposed by a gRPC server. ListServices() ([]string, error) // FindSymbol returns a descriptor for the given fully-qualified symbol name. FindSymbol(fullyQualifiedName string) (desc.Descriptor, error) // AllExtensionsForType returns all known extension fields that extend the given message type name. AllExtensionsForType(typeName string) ([]*desc.FieldDescriptor, error) }
type DescriptorSourceStrategy ¶
type DescriptorSourceStrategy string
func (DescriptorSourceStrategy) String ¶
func (c DescriptorSourceStrategy) String() string
func (DescriptorSourceStrategy) Val ¶
func (c DescriptorSourceStrategy) Val() DescriptorSourceStrategy
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
func (*Filter) Decode ¶
func (f *Filter) Decode(c *http.HttpContext) filter.FilterStatus
Decode use the default http to grpc transcoding strategy https://cloud.google.com/endpoints/docs/grpc/transcoding
type FilterFactory ¶
type FilterFactory struct {
// contains filtered or unexported fields
}
FilterFactory is grpc filter instance
func (*FilterFactory) Apply ¶
func (factory *FilterFactory) Apply() error
func (*FilterFactory) Config ¶
func (factory *FilterFactory) Config() interface{}
func (*FilterFactory) PrepareFilterChain ¶
func (factory *FilterFactory) PrepareFilterChain(ctx *http.HttpContext, chain filter.FilterChain) error
type Plugin ¶
type Plugin struct { }
Plugin is grpc filter plugin.
func (*Plugin) CreateFilterFactory ¶
func (p *Plugin) CreateFilterFactory() (filter.HttpFilterFactory, error)
Click to show internal directories.
Click to hide internal directories.