Documentation ¶
Index ¶
- Variables
- func NewFakeConn() *grpc.ClientConn
- func NewFakeGRPCClientV3() synse.V3PluginClient
- func NewFakeGRPCClientV3Err() synse.V3PluginClient
- func NewFakeHTTPClientV3() synse.Client
- func NewFakeHTTPClientV3Err() synse.Client
- type Builder
- type FakeClientStream
- func (f *FakeClientStream) CloseSend() error
- func (f *FakeClientStream) Context() context.Context
- func (f *FakeClientStream) Header() (metadata.MD, error)
- func (f *FakeClientStream) RecvMsg(m interface{}) error
- func (f *FakeClientStream) SendMsg(m interface{}) error
- func (f *FakeClientStream) Trailer() metadata.MD
- type FakeDevicesClient
- type FakeGRPCClientV3
- func (f *FakeGRPCClientV3) Devices(ctx context.Context, in *synse.V3DeviceSelector, opts ...grpc.CallOption) (synse.V3Plugin_DevicesClient, error)
- func (f *FakeGRPCClientV3) Health(ctx context.Context, in *synse.Empty, opts ...grpc.CallOption) (*synse.V3Health, error)
- func (f *FakeGRPCClientV3) Metadata(ctx context.Context, in *synse.Empty, opts ...grpc.CallOption) (*synse.V3Metadata, error)
- func (f *FakeGRPCClientV3) Read(ctx context.Context, in *synse.V3ReadRequest, opts ...grpc.CallOption) (synse.V3Plugin_ReadClient, error)
- func (f *FakeGRPCClientV3) ReadCache(ctx context.Context, in *synse.V3Bounds, opts ...grpc.CallOption) (synse.V3Plugin_ReadCacheClient, error)
- func (f *FakeGRPCClientV3) ReadStream(ctx context.Context, in *synse.V3StreamRequest, opts ...grpc.CallOption) (synse.V3Plugin_ReadStreamClient, error)
- func (f *FakeGRPCClientV3) Test(ctx context.Context, in *synse.Empty, opts ...grpc.CallOption) (*synse.V3TestStatus, error)
- func (f *FakeGRPCClientV3) Transaction(ctx context.Context, in *synse.V3TransactionSelector, opts ...grpc.CallOption) (*synse.V3TransactionStatus, error)
- func (f *FakeGRPCClientV3) Transactions(ctx context.Context, in *synse.Empty, opts ...grpc.CallOption) (synse.V3Plugin_TransactionsClient, error)
- func (f *FakeGRPCClientV3) Version(ctx context.Context, in *synse.Empty, opts ...grpc.CallOption) (*synse.V3Version, error)
- func (f *FakeGRPCClientV3) WriteAsync(ctx context.Context, in *synse.V3WritePayload, opts ...grpc.CallOption) (synse.V3Plugin_WriteAsyncClient, error)
- func (f *FakeGRPCClientV3) WriteSync(ctx context.Context, in *synse.V3WritePayload, opts ...grpc.CallOption) (synse.V3Plugin_WriteSyncClient, error)
- type FakeHTTPClientV3
- func (c *FakeHTTPClientV3) Close() error
- func (c *FakeHTTPClientV3) Config() (*scheme.Config, error)
- func (c *FakeHTTPClientV3) GetOptions() *synse.Options
- func (c *FakeHTTPClientV3) Info(string) (*scheme.Info, error)
- func (c *FakeHTTPClientV3) Open() error
- func (c *FakeHTTPClientV3) Plugin(string) (*scheme.Plugin, error)
- func (c *FakeHTTPClientV3) PluginHealth() (*scheme.PluginHealth, error)
- func (c *FakeHTTPClientV3) Plugins() ([]*scheme.PluginMeta, error)
- func (c *FakeHTTPClientV3) Read(scheme.ReadOptions) ([]*scheme.Read, error)
- func (c *FakeHTTPClientV3) ReadCache(opts scheme.ReadCacheOptions, readings chan<- *scheme.Read) error
- func (c *FakeHTTPClientV3) ReadDevice(string) ([]*scheme.Read, error)
- func (c *FakeHTTPClientV3) ReadStream(options scheme.ReadStreamOptions, readings chan<- *scheme.Read, ...) error
- func (c *FakeHTTPClientV3) Scan(scheme.ScanOptions) ([]*scheme.Scan, error)
- func (c *FakeHTTPClientV3) Status() (*scheme.Status, error)
- func (c *FakeHTTPClientV3) Tags(scheme.TagsOptions) ([]string, error)
- func (c *FakeHTTPClientV3) Transaction(string) (*scheme.Transaction, error)
- func (c *FakeHTTPClientV3) Transactions() ([]string, error)
- func (c *FakeHTTPClientV3) Version() (*scheme.Version, error)
- func (c *FakeHTTPClientV3) WriteAsync(string, []scheme.WriteData) ([]*scheme.Write, error)
- func (c *FakeHTTPClientV3) WriteSync(string, []scheme.WriteData) ([]*scheme.Transaction, error)
- type FakeReadClient
- type FakeTransactionsClient
- type FakeWriteClient
- type Result
Constants ¶
This section is empty.
Variables ¶
var ( // ErrFakeClient is an error that is returned when a // fake test client is configured to return an error. ErrFakeClient = errors.New("fake client err") )
Functions ¶
func NewFakeConn ¶
func NewFakeConn() *grpc.ClientConn
NewFakeConn returns a gRPC client connection that can be used for testing, since the mock will need to return a connection that gets closed.
func NewFakeGRPCClientV3 ¶
func NewFakeGRPCClientV3() synse.V3PluginClient
NewFakeGRPCClientV3 creates a new fake gRPC client whose methods will never return an error.
func NewFakeGRPCClientV3Err ¶
func NewFakeGRPCClientV3Err() synse.V3PluginClient
NewFakeGRPCClientV3Err creates a new fake gRPC client whose methods will always return an error.
func NewFakeHTTPClientV3 ¶
NewFakeHTTPClientV3 creates a new fake client whose methods will never return an error.
func NewFakeHTTPClientV3Err ¶
NewFakeHTTPClientV3Err creates a new fake client whose methods will always return an error.
Types ¶
type FakeClientStream ¶
type FakeClientStream struct {
// contains filtered or unexported fields
}
func (*FakeClientStream) CloseSend ¶
func (f *FakeClientStream) CloseSend() error
func (*FakeClientStream) Context ¶
func (f *FakeClientStream) Context() context.Context
func (*FakeClientStream) RecvMsg ¶
func (f *FakeClientStream) RecvMsg(m interface{}) error
func (*FakeClientStream) SendMsg ¶
func (f *FakeClientStream) SendMsg(m interface{}) error
func (*FakeClientStream) Trailer ¶
func (f *FakeClientStream) Trailer() metadata.MD
type FakeDevicesClient ¶
type FakeDevicesClient struct {
FakeClientStream
}
type FakeGRPCClientV3 ¶
type FakeGRPCClientV3 struct {
// contains filtered or unexported fields
}
FakeGRPCClientV3 implements the synse.V3PluginClient interface to allow for basic testing of gRPC-based commands without dependencies on external services.
func (*FakeGRPCClientV3) Devices ¶
func (f *FakeGRPCClientV3) Devices(ctx context.Context, in *synse.V3DeviceSelector, opts ...grpc.CallOption) (synse.V3Plugin_DevicesClient, error)
func (*FakeGRPCClientV3) Health ¶
func (f *FakeGRPCClientV3) Health(ctx context.Context, in *synse.Empty, opts ...grpc.CallOption) (*synse.V3Health, error)
func (*FakeGRPCClientV3) Metadata ¶
func (f *FakeGRPCClientV3) Metadata(ctx context.Context, in *synse.Empty, opts ...grpc.CallOption) (*synse.V3Metadata, error)
func (*FakeGRPCClientV3) Read ¶
func (f *FakeGRPCClientV3) Read(ctx context.Context, in *synse.V3ReadRequest, opts ...grpc.CallOption) (synse.V3Plugin_ReadClient, error)
func (*FakeGRPCClientV3) ReadCache ¶
func (f *FakeGRPCClientV3) ReadCache(ctx context.Context, in *synse.V3Bounds, opts ...grpc.CallOption) (synse.V3Plugin_ReadCacheClient, error)
func (*FakeGRPCClientV3) ReadStream ¶
func (f *FakeGRPCClientV3) ReadStream(ctx context.Context, in *synse.V3StreamRequest, opts ...grpc.CallOption) (synse.V3Plugin_ReadStreamClient, error)
func (*FakeGRPCClientV3) Test ¶
func (f *FakeGRPCClientV3) Test(ctx context.Context, in *synse.Empty, opts ...grpc.CallOption) (*synse.V3TestStatus, error)
func (*FakeGRPCClientV3) Transaction ¶
func (f *FakeGRPCClientV3) Transaction(ctx context.Context, in *synse.V3TransactionSelector, opts ...grpc.CallOption) (*synse.V3TransactionStatus, error)
func (*FakeGRPCClientV3) Transactions ¶
func (f *FakeGRPCClientV3) Transactions(ctx context.Context, in *synse.Empty, opts ...grpc.CallOption) (synse.V3Plugin_TransactionsClient, error)
func (*FakeGRPCClientV3) Version ¶
func (f *FakeGRPCClientV3) Version(ctx context.Context, in *synse.Empty, opts ...grpc.CallOption) (*synse.V3Version, error)
func (*FakeGRPCClientV3) WriteAsync ¶
func (f *FakeGRPCClientV3) WriteAsync(ctx context.Context, in *synse.V3WritePayload, opts ...grpc.CallOption) (synse.V3Plugin_WriteAsyncClient, error)
func (*FakeGRPCClientV3) WriteSync ¶
func (f *FakeGRPCClientV3) WriteSync(ctx context.Context, in *synse.V3WritePayload, opts ...grpc.CallOption) (synse.V3Plugin_WriteSyncClient, error)
type FakeHTTPClientV3 ¶
type FakeHTTPClientV3 struct {
// contains filtered or unexported fields
}
FakeHTTPClientV3 implements the synse.Client interface to allow for basic testing without dependencies on external services.
func (*FakeHTTPClientV3) Close ¶
func (c *FakeHTTPClientV3) Close() error
func (*FakeHTTPClientV3) GetOptions ¶
func (c *FakeHTTPClientV3) GetOptions() *synse.Options
func (*FakeHTTPClientV3) Open ¶
func (c *FakeHTTPClientV3) Open() error
func (*FakeHTTPClientV3) PluginHealth ¶
func (c *FakeHTTPClientV3) PluginHealth() (*scheme.PluginHealth, error)
func (*FakeHTTPClientV3) Plugins ¶
func (c *FakeHTTPClientV3) Plugins() ([]*scheme.PluginMeta, error)
func (*FakeHTTPClientV3) Read ¶
func (c *FakeHTTPClientV3) Read(scheme.ReadOptions) ([]*scheme.Read, error)
func (*FakeHTTPClientV3) ReadCache ¶
func (c *FakeHTTPClientV3) ReadCache(opts scheme.ReadCacheOptions, readings chan<- *scheme.Read) error
func (*FakeHTTPClientV3) ReadDevice ¶
func (c *FakeHTTPClientV3) ReadDevice(string) ([]*scheme.Read, error)
func (*FakeHTTPClientV3) ReadStream ¶
func (c *FakeHTTPClientV3) ReadStream(options scheme.ReadStreamOptions, readings chan<- *scheme.Read, quit chan struct{}) error
func (*FakeHTTPClientV3) Scan ¶
func (c *FakeHTTPClientV3) Scan(scheme.ScanOptions) ([]*scheme.Scan, error)
func (*FakeHTTPClientV3) Tags ¶
func (c *FakeHTTPClientV3) Tags(scheme.TagsOptions) ([]string, error)
func (*FakeHTTPClientV3) Transaction ¶
func (c *FakeHTTPClientV3) Transaction(string) (*scheme.Transaction, error)
func (*FakeHTTPClientV3) Transactions ¶
func (c *FakeHTTPClientV3) Transactions() ([]string, error)
func (*FakeHTTPClientV3) WriteAsync ¶
func (*FakeHTTPClientV3) WriteSync ¶
func (c *FakeHTTPClientV3) WriteSync(string, []scheme.WriteData) ([]*scheme.Transaction, error)
type FakeReadClient ¶
type FakeReadClient struct {
FakeClientStream
}
type FakeTransactionsClient ¶
type FakeTransactionsClient struct {
FakeClientStream
}
func (*FakeTransactionsClient) Recv ¶
func (f *FakeTransactionsClient) Recv() (*synse.V3TransactionStatus, error)
type FakeWriteClient ¶
type FakeWriteClient struct {
FakeClientStream
}
func (*FakeWriteClient) Recv ¶
func (f *FakeWriteClient) Recv() (*synse.V3WriteTransaction, error)
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
func (*Result) AssertExited ¶
func (r *Result) AssertExited()
func (*Result) AssertGolden ¶
func (*Result) AssertNoErr ¶
func (r *Result) AssertNoErr()