MCPcopy
hub / github.com/uber-go/zap / RegisterSink

Function RegisterSink

sink.go:126–128  ·  view source on GitHub ↗

RegisterSink registers a user-supplied factory for all sinks with a particular scheme. All schemes must be ASCII, valid under section 0.1 of RFC 3986 (https://tools.ietf.org/html/rfc3983#section-3.1), and must not already have a factory registered. Zap automatically registers a factory for the "fil

(scheme string, factory func(*url.URL) (Sink, error))

Source from the content-addressed store, hash-verified

124// have a factory registered. Zap automatically registers a factory for the
125// "file" scheme.
126func RegisterSink(scheme string, factory func(*url.URL) (Sink, error)) error {
127 return _sinkRegistry.RegisterSink(scheme, factory)
128}
129
130func (sr *sinkRegistry) newFileSinkFromURL(u *url.URL) (Sink, error) {
131 if u.User != nil {

Callers 2

TestRegisterSinkFunction · 0.85

Calls 1

RegisterSinkMethod · 0.80

Tested by 2

TestRegisterSinkFunction · 0.68