Documentation ¶
Index ¶
- Constants
- type GDS
- func (s *GDS) Channel() *bufconn.Listener
- func (s *GDS) Details(ctx context.Context, in *members.DetailsRequest) (*members.MemberDetails, error)
- func (s *GDS) List(ctx context.Context, in *members.ListRequest) (*members.ListReply, error)
- func (s *GDS) Lookup(ctx context.Context, in *gds.LookupRequest) (*gds.LookupReply, error)
- func (s *GDS) Reset()
- func (s *GDS) Search(ctx context.Context, in *gds.SearchRequest) (*gds.SearchReply, error)
- func (s *GDS) Shutdown()
- func (s *GDS) Status(ctx context.Context, in *gds.HealthCheck) (*gds.ServiceState, error)
- func (s *GDS) Summary(ctx context.Context, in *members.SummaryRequest) (*members.SummaryReply, error)
- func (s *GDS) UseError(rpc string, code codes.Code, msg string) error
- func (s *GDS) UseFixture(rpc, path string) (err error)
Constants ¶
View Source
const ( LookupRPC = "trisa.gds.api.v1beta1.TRISADirectory/Lookup" SearchRPC = "trisa.gds.api.v1beta1.TRISADirectory/Search" SummaryRPC = "gds.members.v1alpha1.TRISAMembers/Summary" ListRPC = "gds.members.v1alpha1.TRISAMembers/List" DetailRPC = "gds.members.v1alpha1.TRISAMembers/Details" StatusRPC = "trisa.gds.api.v1beta1.TRISADirectory/Status" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GDS ¶
type GDS struct { gds.UnimplementedTRISADirectoryServer members.UnimplementedTRISAMembersServer Calls map[string]int OnLookup func(context.Context, *gds.LookupRequest) (*gds.LookupReply, error) OnSearch func(context.Context, *gds.SearchRequest) (*gds.SearchReply, error) OnSummary func(context.Context, *members.SummaryRequest) (*members.SummaryReply, error) OnList func(context.Context, *members.ListRequest) (*members.ListReply, error) OnDetail func(context.Context, *members.DetailsRequest) (*members.MemberDetails, error) OnStatus func(context.Context, *gds.HealthCheck) (*gds.ServiceState, error) // contains filtered or unexported fields }
GDS implements a mock gRPC server for testing TRISA Global Directory Service client connections. The desired response of the directory service can be set by external callers using the OnRPC functions or the WithFixture or WithError functions. The Calls map can be used to count the number of times the remote peer PRC was called.
func (*GDS) Details ¶
func (s *GDS) Details(ctx context.Context, in *members.DetailsRequest) (*members.MemberDetails, error)
func (*GDS) Lookup ¶
func (s *GDS) Lookup(ctx context.Context, in *gds.LookupRequest) (*gds.LookupReply, error)
func (*GDS) Search ¶
func (s *GDS) Search(ctx context.Context, in *gds.SearchRequest) (*gds.SearchReply, error)
func (*GDS) Status ¶
func (s *GDS) Status(ctx context.Context, in *gds.HealthCheck) (*gds.ServiceState, error)
func (*GDS) Summary ¶
func (s *GDS) Summary(ctx context.Context, in *members.SummaryRequest) (*members.SummaryReply, error)
func (*GDS) UseError ¶
UseError allows you to specify a gRPC status error to return from the specified RPC.
func (*GDS) UseFixture ¶
UseFixture loadsa a JSON fixture from disk (usually in a testdata folder) to use as the protocol buffer response to the specified RPC, simplifying handler mocking.
Click to show internal directories.
Click to hide internal directories.