ops.go 531 B

1234567891011121314151617181920212223242526
  1. package registry
  2. // Schema1 sets the registry to serve v1 api
  3. func Schema1(c *Config) {
  4. c.schema1 = true
  5. }
  6. // Htpasswd sets the auth method with htpasswd
  7. func Htpasswd(c *Config) {
  8. c.auth = "htpasswd"
  9. }
  10. // Token sets the auth method to token, with the specified token url
  11. func Token(tokenURL string) func(*Config) {
  12. return func(c *Config) {
  13. c.auth = "token"
  14. c.tokenURL = tokenURL
  15. }
  16. }
  17. // URL sets the registry url
  18. func URL(registryURL string) func(*Config) {
  19. return func(c *Config) {
  20. c.registryURL = registryURL
  21. }
  22. }