MCPcopy Create free account
hub / github.com/assembla/cony / NewClient

Function NewClient

client.go:232–246  ·  view source on GitHub ↗

NewClient initializes new Client

(opts ...ClientOpt)

Source from the content-addressed store, hash-verified

230
231// NewClient initializes new Client
232func NewClient(opts ...ClientOpt) *Client {
233 c := &Client{
234 run: run,
235 declarations: make([]Declaration, 0),
236 consumers: make(map[*Consumer]struct{}),
237 publishers: make(map[*Publisher]struct{}),
238 errs: make(chan error, 100),
239 blocking: make(chan amqp.Blocking, 10),
240 }
241
242 for _, o := range opts {
243 o(c)
244 }
245 return c
246}
247
248// URL is a functional option, used in `NewClient` constructor
249// default URL is amqp://guest:guest@localhost/

Callers 8

TestNewClientFunction · 0.85
TestClient_ConsumeFunction · 0.85
TestClient_PublishFunction · 0.85
TestClient_ErrorsFunction · 0.85
TestClient_CloseFunction · 0.85
TestClient_LoopFunction · 0.85
TestClient_reportErrFunction · 0.85
TestClient_connectionFunction · 0.85

Calls

no outgoing calls

Tested by 8

TestNewClientFunction · 0.68
TestClient_ConsumeFunction · 0.68
TestClient_PublishFunction · 0.68
TestClient_ErrorsFunction · 0.68
TestClient_CloseFunction · 0.68
TestClient_LoopFunction · 0.68
TestClient_reportErrFunction · 0.68
TestClient_connectionFunction · 0.68