Documentation ¶
Index ¶
- Constants
- type GenerateFunc
- type GeneratorOption
- type Message
- type Option
- type Request
- type Response
- type Server
- func (s *Server) Addr() string
- func (s *Server) ClearMatchers()
- func (s *Server) ClearRequests()
- func (s *Server) ClientConn() *grpc.ClientConn
- func (s *Server) Close()
- func (s *Server) Conn() *grpc.ClientConn
- func (s *Server) Match(fn func(r *Request) bool) *matcher
- func (s *Server) Method(method string) *matcher
- func (s *Server) Methodf(format string, a ...any) *matcher
- func (s *Server) Requests() []*Request
- func (s *Server) ResponseDynamic(opts ...GeneratorOption) *matcher
- func (s *Server) Service(service string) *matcher
- func (s *Server) Servicef(format string, a ...any) *matcher
- func (s *Server) UnmatchedRequests() []*Request
- type TB
Constants ¶
View Source
const ( HealthCheckService_DEFAULT = "default" HealthCheckService_FLAPPING = "flapping" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GenerateFunc ¶ added in v0.8.0
type GeneratorOption ¶ added in v0.8.0
type GeneratorOption func(generators) generators
func Generator ¶ added in v0.8.0
func Generator(pattern string, fn GenerateFunc) GeneratorOption
type Option ¶ added in v0.6.0
type Option func(*config) error
func DisableReflection ¶ added in v0.11.1
func DisableReflection() Option
DisableReflection disable Server Reflection Protocol
func EnableHealthCheck ¶ added in v0.9.0
func EnableHealthCheck() Option
EnableHealthCheck enable grpc.health.v1
func ImportPaths ¶ added in v0.6.0
ImportPaths set import paths
type Response ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewTLSServer ¶ added in v0.5.0
NewTLSServer returns a new server with registered secure *grpc.Server
func (*Server) ClearMatchers ¶ added in v0.15.3
func (s *Server) ClearMatchers()
ClearMatchers clear matchers.
func (*Server) ClearRequests ¶ added in v0.15.3
func (s *Server) ClearRequests()
ClearRequests clear requests.
func (*Server) ClientConn ¶ added in v0.5.0
func (s *Server) ClientConn() *grpc.ClientConn
ClientConn is alias of Conn
func (*Server) Conn ¶
func (s *Server) Conn() *grpc.ClientConn
Conn returns *grpc.ClientConn which connects *grpc.Server.
func (*Server) Match ¶
Match create request matcher with matchFunc (func(r *grpcstub.Request) bool).
func (*Server) ResponseDynamic ¶ added in v0.8.1
func (s *Server) ResponseDynamic(opts ...GeneratorOption) *matcher
ResponseDynamic set handler which return dynamic response.
func (*Server) UnmatchedRequests ¶ added in v0.14.0
UnmatchedRequests returns []*grpcstub.Request received but not matched by router.
Click to show internal directories.
Click to hide internal directories.