github.com/zhouyu0/docker-note@v0.0.0-20190722021225-b8d3825084db/internal/test/registry/ops.go (about) 1 package registry 2 3 // Schema1 sets the registry to serve v1 api 4 func Schema1(c *Config) { 5 c.schema1 = true 6 } 7 8 // Htpasswd sets the auth method with htpasswd 9 func Htpasswd(c *Config) { 10 c.auth = "htpasswd" 11 } 12 13 // Token sets the auth method to token, with the specified token url 14 func Token(tokenURL string) func(*Config) { 15 return func(c *Config) { 16 c.auth = "token" 17 c.tokenURL = tokenURL 18 } 19 } 20 21 // URL sets the registry url 22 func URL(registryURL string) func(*Config) { 23 return func(c *Config) { 24 c.registryURL = registryURL 25 } 26 }