registry.h 1.5 KB
Newer Older
W
WangFengTu 已提交
1 2
/******************************************************************************
 * Copyright (c) Huawei Technologies Co., Ltd. 2020. All rights reserved.
3 4 5 6
 * iSulad licensed under the Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *     http://license.coscl.org.cn/MulanPSL2
W
WangFengTu 已提交
7 8 9
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
 * PURPOSE.
10
 * See the Mulan PSL v2 for more details.
W
WangFengTu 已提交
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
 * Author: wangfengtu
 * Create: 2020-02-27
 * Description: provide registry definition
 ******************************************************************************/
#ifndef __IMAGE_REGISTRY_H
#define __IMAGE_REGISTRY_H

#ifdef __cplusplus
extern "C" {
#endif

typedef struct {
    char *username;
    char *password;
} registry_auth;

typedef struct {
    char *image_name;
W
WangFengTu 已提交
29
    char *dest_image_name;
W
WangFengTu 已提交
30 31
    registry_auth auth;
    bool skip_tls_verify;
W
WangFengTu 已提交
32 33 34 35
} registry_pull_options;

typedef struct {
    char *host;
W
WangFengTu 已提交
36 37
    registry_auth auth;
    bool skip_tls_verify;
W
WangFengTu 已提交
38 39
} registry_login_options;

W
WangFengTu 已提交
40
int registry_init();
W
WangFengTu 已提交
41 42
int registry_pull(registry_pull_options *options);
int registry_login(registry_login_options *options);
W
WangFengTu 已提交
43 44
int registry_logout(char *host);

W
WangFengTu 已提交
45 46 47 48 49 50 51 52 53
void free_registry_pull_options(registry_pull_options *options);
void free_registry_login_options(registry_login_options *options);

#ifdef __cplusplus
}
#endif

#endif