TalkToCloud

main

coodly/TalkToCloud

TalkToCloud

Swift library for server-to-server CloudKit communication. Uses container based methods, allowing access to multiple containers in same project.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Installing

  • Add TalkToCloud to your Package.swift
import PackageDescription

let package = Package(
	dependencies: [
		.Package(url: "https://github.com/coodly/TalkToCloud.git", Version(0, 5, 1))
	]
)

Quick run

Save your credentials in Config folder using following naming:

.
├── Config
│   ├── com.coodly.moviez-development.key  # Key ID from Dashboard -> API Access -> Server-to-Server keys  
│   ├── com.coodly.moviez-development.pen  # Private key

Create task conforming to Command protocol.

Indicate used container by using protocols ProductionConsumer and/or DevelopmentConsumer.

import TalkToCloud

class Loader: Command, DevelopmentConsumer, ProductionConsumer {
    var developmentContainer: CloudContainer!
    var productionContainer: CloudContainer!
}

As alternative you can use ContainerConsumer and used container will be figured out at runtime.

import TalkToCloud

class Loader: Command, ContainerConsumer {
    var container: CloudContainer!
}

In main.swift, create a command executor.

let commander = Commander<Loader>(containerId: "com.coodly.moviez", arguments: CommandLine.arguments)
commander.run()

When using ContainerConsumer, use --development or --production to indicate which environment container should be given to command.

License

This project is licensed under the Apache 2 License - see the LICENSE file for details

Description

  • Swift Tools 5.1.0
View More Packages from this Author

Dependencies

Last updated: Mon Oct 21 2024 15:24:27 GMT-0900 (Hawaii-Aleutian Daylight Time)