2023-12-21 17:38:20 +08:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# Copyright 2023 Ant Group CO., Ltd.
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
|
|
|
|
# in compliance with the License. You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software distributed under the License
|
|
|
|
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
|
|
|
# or implied.
|
2023-12-11 23:13:19 +08:00
|
|
|
import os
|
2023-12-06 17:26:39 +08:00
|
|
|
from abc import ABC
|
|
|
|
|
|
|
|
|
|
|
|
class Client(ABC):
|
2023-12-11 23:13:19 +08:00
|
|
|
def __init__(self, host_addr: str = None, project_id: int = None):
|
|
|
|
self._host_addr = host_addr or os.environ.get("KNEXT_HOST_ADDR")
|
|
|
|
self._project_id = project_id or os.environ.get("KNEXT_PROJECT_ID")
|