This repository has been archived on 2020-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
quay/endpoints/api/__init__models_interface.py

55 lines
1.1 KiB
Python
Raw Normal View History

2019-11-12 16:09:47 +00:00
from abc import ABCMeta, abstractmethod
from six import add_metaclass
@add_metaclass(ABCMeta)
class InitDataInterface(object):
"""
Interface that represents all data store interactions required by __init__.
"""
@abstractmethod
def is_app_repository(self, namespace_name, repository_name):
"""
Args:
namespace_name: namespace or user
repository_name: repository
Returns:
Boolean
"""
pass
@abstractmethod
def repository_is_public(self, namespace_name, repository_name):
"""
Args:
namespace_name: namespace or user
repository_name: repository
Returns:
Boolean
"""
pass
@abstractmethod
def log_action(self, kind, namespace_name, repository_name, performer, ip, metadata):
"""
Args:
kind: type of log
user_or_orgname: name of user or organization
performer: user doing the action
ip: originating ip
metadata: metadata
repository: repository the action is related to
Returns:
None
"""
pass