Browse code

Support unixgram syslog address

- Consider unixgram:// as a valid URL prefix
- Parse unixgram:// addresses
- Update docs

Signed-off-by: Zhuoyun Wei <wzyboy@wzyboy.org>

Zhuoyun Wei authored on 2016/03/29 19:21:41
Showing 4 changed files
... ...
@@ -152,8 +152,8 @@ func parseAddress(address string) (string, string, error) {
152 152
 		return "", "", err
153 153
 	}
154 154
 
155
-	// unix socket validation
156
-	if url.Scheme == "unix" {
155
+	// unix and unixgram socket validation
156
+	if url.Scheme == "unix" || url.Scheme == "unixgram" {
157 157
 		if _, err := os.Stat(url.Path); err != nil {
158 158
 			return "", "", err
159 159
 		}
... ...
@@ -74,6 +74,7 @@ The following logging options are supported for the `syslog` logging driver:
74 74
 
75 75
     --log-opt syslog-address=[tcp|udp|tcp+tls]://host:port
76 76
     --log-opt syslog-address=unix://path
77
+    --log-opt syslog-address=unixgram://path
77 78
     --log-opt syslog-facility=daemon
78 79
     --log-opt syslog-tls-ca-cert=/etc/ca-certificates/custom/ca.pem
79 80
     --log-opt syslog-tls-cert=/etc/ca-certificates/custom/cert.pem
... ...
@@ -11,7 +11,7 @@ var (
11 11
 	validPrefixes = map[string][]string{
12 12
 		"url":       {"http://", "https://"},
13 13
 		"git":       {"git://", "github.com/", "git@"},
14
-		"transport": {"tcp://", "tcp+tls://", "udp://", "unix://"},
14
+		"transport": {"tcp://", "tcp+tls://", "udp://", "unix://", "unixgram://"},
15 15
 	}
16 16
 	urlPathWithFragmentSuffix = regexp.MustCompile(".git(?:#.+)?$")
17 17
 )
... ...
@@ -23,6 +23,7 @@ var (
23 23
 		"tcp+tls://example.com",
24 24
 		"udp://example.com",
25 25
 		"unix:///example",
26
+		"unixgram:///example",
26 27
 	}
27 28
 )
28 29