Files
gluetun/internal/alpine/alpine.go
Quentin McGaw 73479bab26 Code maintenance: OS package for file system
- OS custom internal package for file system interaction
- Remove fileManager external dependency
- Closer API to Go's native API on the OS
- Create directories at startup
- Better testability
- Move Unsetenv to os interface
2020-12-29 00:55:31 +00:00

26 lines
518 B
Go

package alpine
import (
"os/user"
"github.com/qdm12/gluetun/internal/os"
)
type Configurator interface {
CreateUser(username string, uid int) (createdUsername string, err error)
}
type configurator struct {
openFile os.OpenFileFunc
lookupUID func(uid string) (*user.User, error)
lookupUser func(username string) (*user.User, error)
}
func NewConfigurator(openFile os.OpenFileFunc) Configurator {
return &configurator{
openFile: openFile,
lookupUID: user.LookupId,
lookupUser: user.Lookup,
}
}