Documentation
¶
Index ¶
- Constants
- Variables
- func DisableOutput(ctx context.Context) error
- func EnableOutput(ctx context.Context, conn *sql.DB) error
- func GetOutput(ctx context.Context) (string, error)
- func PrintOutput(ctx context.Context, w io.StringWriter) error
- type AQ
- func (aq *AQ) Create() error
- func (aq *AQ) Dequeue(message driver.Value, messageSize int) (messageID []byte, err error)
- func (aq *AQ) DequeueForSubscriber(subscriberName string, message driver.Value, messageSize int) ([]byte, error)
- func (aq *AQ) Drop() error
- func (aq *AQ) Enqueue(message driver.Value) (messageID []byte, err error)
- func (aq *AQ) Start(enqueue, dequeue bool) error
- func (aq *AQ) Stop(enqueue, dequeue bool) error
- func (aq *AQ) Subscribe(subscriberName string) error
- func (aq *AQ) Unsubscribe(subscriberName string) error
- type DBOutput
Constants ¶
const ( MaxBufferSize = 0x7FFF MinBufferSize = 2000 KeyInContext = "GO-ORA.DBMS_OUTPUT" )
Variables ¶
var ErrQueueNotMultiConsumer = errors.New("queue is not multi-consumer")
Functions ¶
func DisableOutput ¶
disable oracle output for current session
func EnableOutput ¶
enable oracle output for current session param:
ctx: context of goroutine used in large apps
for main: context.Background()
for rest apis:
http.Request.Context()
gin.Context
fiber.Ctx.Context()
...
func PrintOutput ¶
func PrintOutput(ctx context.Context, w io.StringWriter) error
print oracle output into StringWriter for current session
Types ¶
type AQ ¶
type AQ struct {
Name string `db:"QUEUE_NAME"`
TableName string `db:"TB_NAME"`
TypeName string `db:"TYPE_NAME"`
MultiConsumer go_ora.PLBool `db:"MULTI_CONSUMER"`
MaxRetry int64 `db:"MAX_RETRY"`
RetryDelay int64 `db:"RETRY_DELAY"`
RetentionTime int64 `db:"RETENTION_TIME"`
Comment string `db:"COMMENT"`
Owner string
// contains filtered or unexported fields
}
func NewAQ ¶
NewAQ creates a new instance of AQ with the provided connection, queue name, and type name. The table name is generated with a "_TB" suffix. To make this QA multi-consumer, set AQ.MultiConsumer on the resulting instance. Doing so will enable the AQ.Subscribe, AQ.Unsubscribe, AQ.DequeueForSubscriber functions.
func (*AQ) DequeueForSubscriber ¶
func (aq *AQ) DequeueForSubscriber(subscriberName string, message driver.Value, messageSize int) ([]byte, error)
DequeueForSubscriber pulls the next message for a given subscriber. It sets deque_options.CONSUMER_NAME so each subscriber sees its own copy.
func (*AQ) Subscribe ¶
Subscribe adds a new subscriber (consumer) on a multi-consumer queue. Your queue must have been created with multiple_consumers => TRUE.
func (*AQ) Unsubscribe ¶
Unsubscribe unregisters a subscriber from the queue.