-
Notifications
You must be signed in to change notification settings - Fork 53
/
grpc_client.go
32 lines (30 loc) · 907 Bytes
/
grpc_client.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package interfaces
import (
"context"
grpc "github.com/crawlab-team/crawlab-grpc"
"time"
)
type GrpcClient interface {
GrpcBase
WithConfigPath
GetModelDelegateClient() grpc.ModelDelegateClient
GetModelBaseServiceClient() grpc.ModelBaseServiceClient
GetNodeClient() grpc.NodeServiceClient
GetTaskClient() grpc.TaskServiceClient
GetPluginClient() grpc.PluginServiceClient
GetMessageClient() grpc.MessageServiceClient
SetAddress(Address)
SetTimeout(time.Duration)
SetSubscribeType(string)
SetHandleMessage(bool)
Context() (context.Context, context.CancelFunc)
NewRequest(interface{}) *grpc.Request
NewPluginRequest(interface{}) *grpc.PluginRequest
GetMessageChannel() chan *grpc.StreamMessage
Restart() error
NewModelBaseServiceRequest(ModelId, GrpcBaseServiceParams) (*grpc.Request, error)
IsStarted() bool
IsClosed() bool
Err() error
GetStream() grpc.NodeService_SubscribeClient
}