몇개 struct unexported를 exported로 바꿈
This commit is contained in:
parent
251ba74dbe
commit
fd51e0136b
|
@ -5,21 +5,21 @@ import (
|
||||||
"context"
|
"context"
|
||||||
)
|
)
|
||||||
|
|
||||||
type wrappedIO struct {
|
type WrappedIO struct {
|
||||||
stdin io.Reader
|
stdin io.Reader
|
||||||
stdout io.Writer
|
stdout io.Writer
|
||||||
closer context.CancelFunc
|
closer context.CancelFunc
|
||||||
}
|
}
|
||||||
|
|
||||||
func (wio *wrappedIO) Read(p []byte) (n int, err error) {
|
func (wio *WrappedIO) Read(p []byte) (n int, err error) {
|
||||||
return wio.stdin.Read(p)
|
return wio.stdin.Read(p)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (wio *wrappedIO) Write(p []byte) (n int, err error) {
|
func (wio *WrappedIO) Write(p []byte) (n int, err error) {
|
||||||
return wio.stdout.Write(p)
|
return wio.stdout.Write(p)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (wio *wrappedIO) Close() (err error) {
|
func (wio *WrappedIO) Close() (err error) {
|
||||||
wio.closer()
|
wio.closer()
|
||||||
return io.EOF
|
return io.EOF
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ type LockedWriteSyncer struct {
|
||||||
|
|
||||||
// Lock wraps a WriteSyncer in a mutex to make it safe for concurrent use. In
|
// Lock wraps a WriteSyncer in a mutex to make it safe for concurrent use. In
|
||||||
// particular, *os.Files must be locked before use.
|
// particular, *os.Files must be locked before use.
|
||||||
func newLocked(ws logger.WriteSyncer) logger.RotateSyncer {
|
func NewLocked(ws logger.WriteSyncer) logger.RotateSyncer {
|
||||||
if lws, ok := ws.(*LockedWriteSyncer); ok {
|
if lws, ok := ws.(*LockedWriteSyncer); ok {
|
||||||
// no need to layer on another lock
|
// no need to layer on another lock
|
||||||
return lws
|
return lws
|
||||||
|
|
|
@ -11,7 +11,7 @@ type rotateSyncer struct {
|
||||||
lumberjack.Logger
|
lumberjack.Logger
|
||||||
}
|
}
|
||||||
|
|
||||||
func newRotater(filename string, maxSize, maxBackup, maxDay int) logger.RotateSyncer {
|
func NewRotater(filename string, maxSize, maxBackup, maxDay int) logger.RotateSyncer {
|
||||||
return &rotateSyncer{
|
return &rotateSyncer{
|
||||||
setOnceOnclose: &sync.Once{},
|
setOnceOnclose: &sync.Once{},
|
||||||
Logger: lumberjack.Logger{
|
Logger: lumberjack.Logger{
|
||||||
|
|
Reference in New Issue