Documentation
¶
Index ¶
- Constants
- type TRISA
- func (s *TRISA) Channel() *bufconn.Listener
- func (s *TRISA) ConfirmAddress(ctx context.Context, in *api.Address) (*api.AddressConfirmation, error)
- func (s *TRISA) KeyExchange(ctx context.Context, in *api.SigningKey) (*api.SigningKey, error)
- func (s *TRISA) Reset()
- func (s *TRISA) Shutdown()
- func (s *TRISA) Status(ctx context.Context, in *api.HealthCheck) (*api.ServiceState, error)
- func (s *TRISA) Transfer(ctx context.Context, in *api.SecureEnvelope) (*api.SecureEnvelope, error)
- func (s *TRISA) TransferStream(stream api.TRISANetwork_TransferStreamServer) error
- func (s *TRISA) UseError(rpc string, code codes.Code, msg string) error
- func (s *TRISA) UseFixture(rpc, path string) (err error)
Constants ¶
View Source
const ( TransferRPC = "trisa.api.v1beta1.TRISANetwork/Transfer" TransferStreamRPC = "trisa.api.v1beta1.TRISANetwork/TransferStream" KeyExchangeRPC = "trisa.api.v1beta1.TRISANetwork/KeyExchange" ConfirmAddressRPC = "trisa.api.v1beta1.TRISANetwork/ConfirmAddress" StatusRPC = "trisa.api.v1beta1.TRISAHealth/Status" )
RPC names as defined by the grpc info method; used for tracking calls.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TRISA ¶
type TRISA struct { api.UnimplementedTRISAHealthServer api.UnimplementedTRISANetworkServer Calls map[string]int OnTransfer func(context.Context, *api.SecureEnvelope) (*api.SecureEnvelope, error) OnTransferStream func(api.TRISANetwork_TransferStreamServer) error OnKeyExchange func(context.Context, *api.SigningKey) (*api.SigningKey, error) OnConfirmAddress func(context.Context, *api.Address) (*api.AddressConfirmation, error) OnStatus func(context.Context, *api.HealthCheck) (*api.ServiceState, error) // contains filtered or unexported fields }
TRISA implements the TRISANetwork and TRISAHealth services for mocking tests for clients that might call a remote server.
func (*TRISA) ConfirmAddress ¶
func (*TRISA) KeyExchange ¶
func (s *TRISA) KeyExchange(ctx context.Context, in *api.SigningKey) (*api.SigningKey, error)
func (*TRISA) Status ¶
func (s *TRISA) Status(ctx context.Context, in *api.HealthCheck) (*api.ServiceState, error)
func (*TRISA) Transfer ¶
func (s *TRISA) Transfer(ctx context.Context, in *api.SecureEnvelope) (*api.SecureEnvelope, error)
func (*TRISA) TransferStream ¶
func (s *TRISA) TransferStream(stream api.TRISANetwork_TransferStreamServer) error
func (*TRISA) UseError ¶
UseError allows you to specify a gRPC status error to return from the specified RPC.
func (*TRISA) 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.