infra
/
goutils
Archived
1
0
Fork 0

몇개 struct unexported를 exported로 바꿈

This commit is contained in:
Sangbum Kim 2018-06-07 00:48:38 +09:00
parent 251ba74dbe
commit fd51e0136b
3 changed files with 6 additions and 6 deletions

View File

@ -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
}

View File

@ -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

View File

@ -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{