sftpgo-mirror/examples/ldapauthserver/logger/sync_wrapper.go
Nicola Murino ebd6a11f3a external auth: add example HTTP server to use as authentication hook
The server authenticate against an LDAP server.
2020-04-26 14:48:32 +02:00

17 lines
238 B
Go

package logger
import (
"os"
"sync"
)
type logSyncWrapper struct {
lock *sync.Mutex
output *os.File
}
func (l logSyncWrapper) Write(b []byte) (n int, err error) {
l.lock.Lock()
defer l.lock.Unlock()
return l.output.Write(b)
}