Documentation
¶
Overview ¶
Copyright 2018 Tharanga Nilupul Thennakoon
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 2018 Tharanga Nilupul Thennakoon ¶
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 2018 Tharanga Nilupul Thennakoon ¶
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 2018 Tharanga Nilupul Thennakoon ¶
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 2018 Tharanga Nilupul Thennakoon ¶
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 ¶
- Constants
- type BaseEvent
- func (baseEvent *BaseEvent) GetCreated() string
- func (baseEvent *BaseEvent) GetError() string
- func (baseEvent *BaseEvent) GetEventID() string
- func (baseEvent *BaseEvent) GetHeaderData(key string) string
- func (baseEvent *BaseEvent) GetPayload() []byte
- func (baseEvent *BaseEvent) GetPayloadAsObject() interface{}
- func (baseEvent *BaseEvent) GetPayloadAsString() string
- func (baseEvent *BaseEvent) GetRequestID() string
- func (baseEvent *BaseEvent) GetStatuscode() int
- func (baseEvent *BaseEvent) ParsePayloadAsObject(payloadObject interface{}) error
- type Messenger
- func (messenger *Messenger) Close()
- func (messenger *Messenger) Init() error
- func (messenger *Messenger) Publish(eventID string, payload interface{}, requestHeaders map[string]string, ...) (string, error)
- func (messenger *Messenger) PublishBlocking(eventID string, payload interface{}, requestHeaders map[string]string, ...) (string, error)
- func (messenger *Messenger) ReleseQueue(routingKey string)
- func (messenger *Messenger) ReplyError(requestBaseEvent BaseEvent, errMessage string, statuscode int) error
- func (messenger *Messenger) ReplySuccess(requestBaseEvent BaseEvent, replyPayload interface{}, statuscode int) error
- func (messenger *Messenger) Subscribe(eventID string, requestHandler func(baseEvent BaseEvent), consumerName string) error
- func (messenger *Messenger) WaitInit(wait time.Duration) error
Constants ¶
const Exchange = "quebic-faas-eventbus"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseEvent ¶
type BaseEvent struct {
// contains filtered or unexported fields
}
BaseEvent type
func (*BaseEvent) GetCreated ¶
GetCreated get created
func (*BaseEvent) GetEventID ¶
GetEventID get eventID
func (*BaseEvent) GetHeaderData ¶
GetHeaderData get requestHeaders
func (*BaseEvent) GetPayload ¶
GetPayload get payload []byte
func (*BaseEvent) GetPayloadAsObject ¶
func (baseEvent *BaseEvent) GetPayloadAsObject() interface{}
GetPayloadAsObject get payloadObject as a perticular object
func (*BaseEvent) GetPayloadAsString ¶
GetPayloadAsString get payload string
func (*BaseEvent) GetRequestID ¶
GetRequestID get requestID
func (*BaseEvent) GetStatuscode ¶
GetStatuscode get requestHeaders
func (*BaseEvent) ParsePayloadAsObject ¶
ParsePayloadAsObject parse to object you provided
type Messenger ¶
type Messenger struct {
AppID string
EventBusConfig config.EventBusConfig
// contains filtered or unexported fields
}
Messenger interface
func (*Messenger) Publish ¶
func (messenger *Messenger) Publish( eventID string, payload interface{}, requestHeaders map[string]string, successHandler func(message BaseEvent, statuscode int), errHandler func(err string, statuscode int), requestTimeout time.Duration) (string, error)
Publish publish
func (*Messenger) PublishBlocking ¶
func (messenger *Messenger) PublishBlocking( eventID string, payload interface{}, requestHeaders map[string]string, successHandler func(message BaseEvent, statuscode int), errHandler func(err string, statuscode int), requestTimeout time.Duration) (string, error)
PublishBlocking publish and wait caller thread until responce came
func (*Messenger) ReleseQueue ¶
ReleseQueue release queue
func (*Messenger) ReplyError ¶
func (messenger *Messenger) ReplyError(requestBaseEvent BaseEvent, errMessage string, statuscode int) error
ReplyError reply error response
func (*Messenger) ReplySuccess ¶
func (messenger *Messenger) ReplySuccess(requestBaseEvent BaseEvent, replyPayload interface{}, statuscode int) error
ReplySuccess reply success response