Documentation ¶
Index ¶
- Variables
- func ForceGetClient(path string, opts ...Option) (p interfaces.GrpcClient, err error)
- func GetClient(path string, opts ...Option) (c interfaces.GrpcClient, err error)
- func GetClientPool(path string) (p interfaces.GrpcClientPool, err error)
- func NewClient(opts ...Option) (res interfaces.GrpcClient, err error)
- func NewNewPool(opts ...PoolOption) (p interfaces.GrpcClientPool, err error)
- func ProvideClient(path string, opts ...Option) func() (res interfaces.GrpcClient, err error)
- func ProvideClientPool(path string) func() (interfaces.GrpcClientPool, error)
- func ProvideGetClient(path string, opts ...Option) func() (res interfaces.GrpcClient, err error)
- type Client
- func (c *Client) Context() (ctx context.Context, cancel context.CancelFunc)
- func (c *Client) Err() (err error)
- func (c *Client) GetConfigPath() (path string)
- func (c *Client) GetMessageChannel() (msgCh chan *grpc2.StreamMessage)
- func (c *Client) GetMessageClient() grpc2.MessageServiceClient
- func (c *Client) GetModelBaseServiceClient() (res grpc2.ModelBaseServiceClient)
- func (c *Client) GetModelDelegateClient() (res grpc2.ModelDelegateClient)
- func (c *Client) GetNodeClient() grpc2.NodeServiceClient
- func (c *Client) GetPluginClient() grpc2.PluginServiceClient
- func (c *Client) GetStream() (stream grpc2.NodeService_SubscribeClient)
- func (c *Client) GetTaskClient() grpc2.TaskServiceClient
- func (c *Client) Init() (err error)
- func (c *Client) IsClosed() (res bool)
- func (c *Client) IsStarted() (res bool)
- func (c *Client) NewModelBaseServiceRequest(id interfaces.ModelId, params interfaces.GrpcBaseServiceParams) (req *grpc2.Request, err error)
- func (c *Client) NewPluginRequest(d interface{}) (req *grpc2.PluginRequest)
- func (c *Client) NewRequest(d interface{}) (req *grpc2.Request)
- func (c *Client) Register() (err error)
- func (c *Client) Restart() (err error)
- func (c *Client) SetAddress(address interfaces.Address)
- func (c *Client) SetConfigPath(path string)
- func (c *Client) SetHandleMessage(handleMessage bool)
- func (c *Client) SetSubscribeType(value string)
- func (c *Client) SetTimeout(timeout time.Duration)
- func (c *Client) Start() (err error)
- func (c *Client) Stop() (err error)
- type Option
- type Pool
- type PoolOption
Constants ¶
This section is empty.
Variables ¶
View Source
var EmptyRequest = &grpc2.Request{}
Functions ¶
func ForceGetClient ¶
func ForceGetClient(path string, opts ...Option) (p interfaces.GrpcClient, err error)
func GetClient ¶
func GetClient(path string, opts ...Option) (c interfaces.GrpcClient, err error)
func GetClientPool ¶
func GetClientPool(path string) (p interfaces.GrpcClientPool, err error)
func NewClient ¶
func NewClient(opts ...Option) (res interfaces.GrpcClient, err error)
func NewNewPool ¶
func NewNewPool(opts ...PoolOption) (p interfaces.GrpcClientPool, err error)
func ProvideClient ¶
func ProvideClient(path string, opts ...Option) func() (res interfaces.GrpcClient, err error)
func ProvideClientPool ¶
func ProvideClientPool(path string) func() (interfaces.GrpcClientPool, error)
func ProvideGetClient ¶
func ProvideGetClient(path string, opts ...Option) func() (res interfaces.GrpcClient, err error)
Types ¶
type Client ¶
type Client struct { // grpc clients ModelDelegateClient grpc2.ModelDelegateClient ModelBaseServiceClient grpc2.ModelBaseServiceClient NodeClient grpc2.NodeServiceClient TaskClient grpc2.TaskServiceClient PluginClient grpc2.PluginServiceClient MessageClient grpc2.MessageServiceClient // contains filtered or unexported fields }
func (*Client) Context ¶
func (c *Client) Context() (ctx context.Context, cancel context.CancelFunc)
func (*Client) GetConfigPath ¶
func (*Client) GetMessageChannel ¶
func (c *Client) GetMessageChannel() (msgCh chan *grpc2.StreamMessage)
func (*Client) GetMessageClient ¶
func (c *Client) GetMessageClient() grpc2.MessageServiceClient
func (*Client) GetModelBaseServiceClient ¶
func (c *Client) GetModelBaseServiceClient() (res grpc2.ModelBaseServiceClient)
func (*Client) GetModelDelegateClient ¶
func (c *Client) GetModelDelegateClient() (res grpc2.ModelDelegateClient)
func (*Client) GetNodeClient ¶
func (c *Client) GetNodeClient() grpc2.NodeServiceClient
func (*Client) GetPluginClient ¶
func (c *Client) GetPluginClient() grpc2.PluginServiceClient
func (*Client) GetStream ¶
func (c *Client) GetStream() (stream grpc2.NodeService_SubscribeClient)
func (*Client) GetTaskClient ¶
func (c *Client) GetTaskClient() grpc2.TaskServiceClient
func (*Client) NewModelBaseServiceRequest ¶
func (c *Client) NewModelBaseServiceRequest(id interfaces.ModelId, params interfaces.GrpcBaseServiceParams) (req *grpc2.Request, err error)
func (*Client) NewPluginRequest ¶
func (c *Client) NewPluginRequest(d interface{}) (req *grpc2.PluginRequest)
func (*Client) NewRequest ¶
func (*Client) SetAddress ¶
func (c *Client) SetAddress(address interfaces.Address)
func (*Client) SetConfigPath ¶
func (*Client) SetHandleMessage ¶
func (*Client) SetSubscribeType ¶
func (*Client) SetTimeout ¶
type Option ¶
type Option func(client interfaces.GrpcClient)
func WithAddress ¶
func WithAddress(address interfaces.Address) Option
func WithConfigPath ¶
func WithHandleMessage ¶
func WithSubscribeType ¶
func WithTimeout ¶
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
func (*Pool) GetClient ¶
func (p *Pool) GetClient() (c interfaces.GrpcClient, err error)
func (*Pool) GetConfigPath ¶
func (*Pool) SetConfigPath ¶
type PoolOption ¶
type PoolOption func(p interfaces.GrpcClientPool)
func WithPoolConfigPath ¶
func WithPoolConfigPath(path string) PoolOption
func WithPoolSize ¶
func WithPoolSize(size int) PoolOption
Click to show internal directories.
Click to hide internal directories.