Changeset 269 in code for trunk/service.go


Ignore:
Timestamp:
Apr 28, 2020, 9:41:13 AM (5 years ago)
Author:
delthas
Message:

Add support for IRC address schemes

This is preparatory work for adding other connection types to upstream
servers. The service command network create now accepts a scheme in
the address flag, which specifies how to connect to the upstream server.

The only supported scheme for now is ircs, which is also the default if
no scheme is specified. ircs connects to a network over a TLS TCP
connection.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/service.go

    r263 r269  
    204204        }
    205205
     206        if addrParts := strings.SplitN(*addr, "://", 2); len(addrParts) == 2 {
     207                scheme := addrParts[0]
     208                switch scheme {
     209                case "ircs":
     210                default:
     211                        return fmt.Errorf("unknown scheme %q (supported schemes: ircs)", scheme)
     212                }
     213        }
     214
    206215        for _, command := range connectCommands {
    207216                _, err := irc.ParseMessage(command)
Note: See TracChangeset for help on using the changeset viewer.