몇개 struct unexported를 exported로 바꿈
This commit is contained in:
parent
251ba74dbe
commit
fd51e0136b
|
@ -5,21 +5,21 @@ import (
|
|||
"context"
|
||||
)
|
||||
|
||||
type wrappedIO struct {
|
||||
type WrappedIO struct {
|
||||
stdin io.Reader
|
||||
stdout io.Writer
|
||||
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)
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
func (wio *wrappedIO) Close() (err error) {
|
||||
func (wio *WrappedIO) Close() (err error) {
|
||||
wio.closer()
|
||||
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
|
||||
// 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 {
|
||||
// no need to layer on another lock
|
||||
return lws
|
||||
|
|
|
@ -11,7 +11,7 @@ type rotateSyncer struct {
|
|||
lumberjack.Logger
|
||||
}
|
||||
|
||||
func newRotater(filename string, maxSize, maxBackup, maxDay int) logger.RotateSyncer {
|
||||
func NewRotater(filename string, maxSize, maxBackup, maxDay int) logger.RotateSyncer {
|
||||
return &rotateSyncer{
|
||||
setOnceOnclose: &sync.Once{},
|
||||
Logger: lumberjack.Logger{
|
||||
|
|
Reference in New Issue