Documentation ¶
Overview ¶
Copyright 2020 newtbig Author. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 newtbig Author. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 newtbig Author. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Variables
- type NatsClient
- func (nc *NatsClient) AddStream(stream string, subjects []string) *nats.StreamInfo
- func (c *NatsClient) CallBack() chan *framepb.Msg
- func (nc *NatsClient) CloseHandler(conn *nats.Conn)
- func (nc *NatsClient) CreatNatsKeyValue(bukName string, ttl time.Duration) (nats.KeyValue, error)
- func (nc *NatsClient) CreatNatsQueueSubscription(subj string, queue string) (*nats.Subscription, error)
- func (nc *NatsClient) CreatNatsSubscription(subj string) (*nats.Subscription, error)
- func (nc *NatsClient) CreatNatsSubscriptionPull(subj string, queue string) (*nats.Subscription, error)
- func (nc *NatsClient) Done()
- func (nc *NatsClient) GetNatsConn() *nats.Conn
- func (nc *NatsClient) GetNatsJs() nats.JetStreamContext
- func (nc *NatsClient) Init()
- func (nc *NatsClient) InitStreamWithSubjects()
- func (nc *NatsClient) Publish(subj string, data []byte) error
- func (nc *NatsClient) PublishMsg(subj string, msg *framepb.Msg) error
- func (nc *NatsClient) RequestMsg(subj string, msg *framepb.Msg) (*framepb.Msg, error)
- func (nc *NatsClient) SendMsg(subj string, msg *framepb.Msg) error
- func (nc *NatsClient) StartPublishHandle() (err error)
- func (nc *NatsClient) StartRequestHandle() error
- type StreamMsg
Constants ¶
This section is empty.
Variables ¶
var NATS_REQUEST_TIMEOUT = 10
Functions ¶
This section is empty.
Types ¶
type NatsClient ¶
type NatsClient struct {
// contains filtered or unexported fields
}
func NewNatsClient ¶
func NewNatsClient(app module.App) (*NatsClient, error)
func (*NatsClient) AddStream ¶
func (nc *NatsClient) AddStream(stream string, subjects []string) *nats.StreamInfo
func (*NatsClient) CallBack ¶
func (c *NatsClient) CallBack() chan *framepb.Msg
func (*NatsClient) CloseHandler ¶
func (nc *NatsClient) CloseHandler(conn *nats.Conn)
func (*NatsClient) CreatNatsKeyValue ¶
func (nc *NatsClient) CreatNatsKeyValue(bukName string, ttl time.Duration) (nats.KeyValue, error)
func (*NatsClient) CreatNatsQueueSubscription ¶
func (nc *NatsClient) CreatNatsQueueSubscription(subj string, queue string) (*nats.Subscription, error)
func (*NatsClient) CreatNatsSubscription ¶
func (nc *NatsClient) CreatNatsSubscription(subj string) (*nats.Subscription, error)
func (*NatsClient) CreatNatsSubscriptionPull ¶
func (nc *NatsClient) CreatNatsSubscriptionPull(subj string, queue string) (*nats.Subscription, error)
func (*NatsClient) Done ¶
func (nc *NatsClient) Done()
func (*NatsClient) GetNatsConn ¶
func (nc *NatsClient) GetNatsConn() *nats.Conn
func (*NatsClient) GetNatsJs ¶
func (nc *NatsClient) GetNatsJs() nats.JetStreamContext
func (*NatsClient) Init ¶
func (nc *NatsClient) Init()
func (*NatsClient) InitStreamWithSubjects ¶
func (nc *NatsClient) InitStreamWithSubjects()
func (*NatsClient) PublishMsg ¶
func (nc *NatsClient) PublishMsg(subj string, msg *framepb.Msg) error
func (*NatsClient) RequestMsg ¶
func (*NatsClient) StartPublishHandle ¶
func (nc *NatsClient) StartPublishHandle() (err error)
func (*NatsClient) StartRequestHandle ¶
func (nc *NatsClient) StartRequestHandle() error