github.com/oam-dev/kubevela@v1.9.11/pkg/utils/registries/types.go (about)

     1  /*
     2  Copyright 2023 The KubeVela Authors.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8  	http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  package registries
    18  
    19  // DockerConfig represents the config file used by the docker CLI.
    20  // This config that represents the credentials that should be used
    21  // when pulling images from specific image repositories.
    22  type DockerConfig map[string]DockerConfigEntry
    23  
    24  // DockerConfigEntry wraps a docker config as an entry
    25  type DockerConfigEntry struct {
    26  	Username string
    27  	Password string
    28  	Email    string
    29  	Auth     string
    30  }
    31  
    32  // ImageRegistry the request body for validating image registry
    33  type ImageRegistry struct {
    34  	Registry string `json:"registry"`
    35  	Auth     Auth   `json:"auth"`
    36  	Insecure bool   `json:"insecure"`
    37  	UseHTTP  bool   `json:"useHTTP"`
    38  }
    39  
    40  // Auth the auth of image registry
    41  type Auth struct {
    42  	Username string `json:"username"`
    43  	Password string `json:"password"`
    44  	Email    string `json:"email"`
    45  }