mirror of
https://github.com/munki/munki.git
synced 2026-01-31 20:10:50 -06:00
40 lines
1.3 KiB
Swift
40 lines
1.3 KiB
Swift
//
|
|
// RepoProtocol.swift
|
|
// munki
|
|
//
|
|
// Created by Greg Neagle on 5/8/25.
|
|
//
|
|
// 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
|
|
//
|
|
// https://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.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
import Foundation
|
|
|
|
/// Defines methods all repo classes must implement
|
|
public protocol Repo {
|
|
init(_ url: String) throws
|
|
func list(_ kind: String) async throws -> [String]
|
|
func get(_ identifier: String) async throws -> Data
|
|
func get(_ identifier: String, toFile local_file_path: String) async throws
|
|
func put(_ identifier: String, content: Data) async throws
|
|
func put(_ identifier: String, fromFile local_file_path: String) async throws
|
|
func delete(_ identifier: String) async throws
|
|
func pathFor(_ identifier: String) -> String?
|
|
}
|
|
|
|
open class RepoPluginBuilder {
|
|
// public init() {}
|
|
|
|
open func connect(_: String) -> Repo? {
|
|
fatalError("You have to override this method.")
|
|
}
|
|
}
|