Debian Codegraph @

go/pkg/proton/doc.go

raw
1 /*
2 Licensed to the Apache Software Foundation (ASF) under one
3 or more contributor license agreements. See the NOTICE file
4 distributed with this work for additional information
5 regarding copyright ownership. The ASF licenses this file
6 to you under the Apache License, Version 2.0 (the
7 "License"); you may not use this file except in compliance
8 with the License. You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 Unless required by applicable law or agreed to in writing,
13 software distributed under the License is distributed on an
14 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 KIND, either express or implied. See the License for the
16 specific language governing permissions and limitations
17 under the License.
18 */
19
20 /*
21 Package proton wraps Proton-C, an event-driven, concurrent-unsafe AMQP 1.0
22 C library (package 'electron' is more "Go-like" and concurrent-safe)
23
24 This package requires the [proton-C library](http://qpid.apache.org/proton) to be installed.
25
26 Consult the C API documentation at http://qpid.apache.org/proton for more
27 information about the types here. There is a 1-1 correspondence between C type
28 pn_foo_t and Go type proton.Foo, and between C function
29
30 pn_foo_do_something(pn_foo_t*, ...)
31
32 and Go method
33
34 func (proton.Foo) DoSomething(...)
35
36 The proton.Engine type pumps data between a Go net.Conn and a proton event loop
37 goroutine that feeds events to a proton.MessagingHandler, which you must implement.
38 See the Engine documentation for more.
39
40 MessagingHandler defines an event handling interface that you can implement to
41 react to AMQP protocol events. There is also a lower-level EventHandler, but
42 MessagingHandler provides a simpler set of events and automates common tasks for you,
43 for most applications it will be more convenient.
44
45 NOTE: Methods on most types defined in this package (Sessions, Links etc.) can
46 *only* be called in the event handler goroutine of the relevant
47 Connection/Engine, either by the HandleEvent method of a handler type or in a
48 function injected into the goroutine via Inject() or InjectWait() Handlers and
49 injected functions can set up channels to communicate with other goroutines.
50 Note the Injecter associated with a handler available as part of the Event value
51 passed to HandleEvent.
52
53 Separate Engine instances are independent, and can run concurrently.
54
55 The 'electron' package is built on the proton package but instead offers a
56 concurrent-safe API that can use simple procedural loops rather than event
57 handlers to express application logic. It is easier to use for most
58 applications.
59
60 */
61 package proton
62
63 // #cgo LDFLAGS: -lqpid-proton-core
64 import "C"
65
66 // This file is just for the package comment.