1
0
mirror of https://github.com/mayflower/docker-ls.git synced 2025-11-28 00:01:09 +03:00
Files
docker-ls/lib/registry_credentials.go
2016-02-26 14:21:50 +01:00

31 lines
623 B
Go

package lib
import (
"flag"
)
type RegistryCredentials struct {
user string
password string
}
func (c *RegistryCredentials) BindToFlags(flags *flag.FlagSet) {
flags.StringVar(&c.user, "user", "", "username for logging into the registry")
flags.StringVar(&c.password, "password", "", "password for logging into the registry")
}
func (r *RegistryCredentials) User() string {
return r.user
}
func (r *RegistryCredentials) Password() string {
return r.password
}
func NewRegistryCredentials(user, password string) RegistryCredentials {
return RegistryCredentials{
user: user,
password: password,
}
}