github.com/gdamore/mangos@v1.4.0/transport/all/all.go (about) 1 // Copyright 2018 The Mangos Authors 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use file except in compliance with the License. 5 // You may obtain a copy of the license at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 // Package all is used to register all transports. This allows a program 16 // to support all known transports as well as supporting as yet-unknown 17 // transports, with a single import. 18 package all 19 20 import ( 21 "nanomsg.org/go-mangos" 22 "nanomsg.org/go-mangos/transport/inproc" 23 "nanomsg.org/go-mangos/transport/ipc" 24 "nanomsg.org/go-mangos/transport/tcp" 25 "nanomsg.org/go-mangos/transport/tlstcp" 26 "nanomsg.org/go-mangos/transport/ws" 27 "nanomsg.org/go-mangos/transport/wss" 28 ) 29 30 // AddTransports adds all known transports to the given socket. 31 func AddTransports(sock mangos.Socket) { 32 sock.AddTransport(tcp.NewTransport()) 33 sock.AddTransport(inproc.NewTransport()) 34 sock.AddTransport(ipc.NewTransport()) 35 sock.AddTransport(tlstcp.NewTransport()) 36 sock.AddTransport(ws.NewTransport()) 37 sock.AddTransport(wss.NewTransport()) 38 }