1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
7 // UnixAddr represents the address of a Unix domain socket end point.
13 // Network returns the address's network name, "unix", "unixgram" or
15 func (a
*UnixAddr
) Network() string {
19 func (a
*UnixAddr
) String() string {
26 func (a
*UnixAddr
) toAddr() Addr
{
33 // ResolveUnixAddr parses addr as a Unix domain socket address.
34 // The string net gives the network name, "unix", "unixgram" or
36 func ResolveUnixAddr(net
, addr
string) (*UnixAddr
, error
) {
38 case "unix", "unixgram", "unixpacket":
39 return &UnixAddr
{Name
: addr
, Net
: net
}, nil
41 return nil, UnknownNetworkError(net
)