Skip to content
Permalink
Browse files

merged id,db and util packages from dev branch

  • Loading branch information...
mrjoshuak committed Aug 22, 2017
1 parent d733b6c commit 7aa6ff403a6c6742424c26a4d9fb39d1338b7af4
Showing with 4,292 additions and 486 deletions.
  1. +4 −0 .gitignore
  2. +15 −0 .travis.yml
  3. +46 −0 CODE_OF_CONDUCT.md
  4. +6 −0 CONTRIBUTORS
  5. +3 −3 LICENSE
  6. +78 −54 README.md
  7. +0 −16 asset/doc.go
  8. +0 −190 asset/id.go
  9. +0 −212 asset/id_test.go
  10. +117 −0 db/Readme.md
  11. +984 −0 db/db.go
  12. +498 −0 db/db_test.go
  13. +31 −0 db/internal_test.go
  14. +4 −11 doc.go
  15. +127 −0 id/README.md
  16. +26 −0 id/common_ids.go
  17. +86 −0 id/digest.go
  18. +117 −0 id/digest_slice.go
  19. +266 −0 id/digest_test.go
  20. +67 −0 id/doc.go
  21. +43 −0 id/encoder.go
  22. +63 −0 id/encoder_test.go
  23. +91 −0 id/encoding.go
  24. +29 −0 id/errors.go
  25. +111 −0 id/id.go
  26. +228 −0 id/id_test.go
  27. +15 −0 id/identify.go
  28. +36 −0 id/identify_test.go
  29. +33 −0 id/interface.go
  30. +20 −0 id/json.go
  31. +72 −0 id/json_test.go
  32. +68 −0 id/slice.go
  33. +59 −0 id/slice_test.go
  34. +206 −0 id/tree.go
  35. +117 −0 id/tree_test.go
  36. +162 −0 id/tree_utils.go
  37. +14 −0 id/tree_utils_test.go
  38. +200 −0 id/treeslice_bench_test.go
  39. +140 −0 util/charset.go
  40. +110 −0 util/charset_test.go
@@ -3,6 +3,8 @@
*.a
*.so
cmd/c4/c4
cmd/c4id/c4id
cmd/example/example

# Folders
_obj
@@ -23,3 +25,5 @@ _testmain.go
*.exe
*.test
*.prof
*.coverprofile

@@ -0,0 +1,15 @@
language: go

go:
- 1.7
before_install:
- go get golang.org/x/tools/cmd/cover
- go get github.com/axw/gocov/gocov
- go get github.com/modocache/gover
- go get github.com/mattn/goveralls
script:
- go test -coverprofile=id.coverprofile ./id
- go test -coverprofile=db.coverprofile ./db
- go test -coverprofile=util.coverprofile ./util
- $HOME/gopath/bin/gover
- $HOME/gopath/bin/goveralls -coverprofile=gover.coverprofile -service travis-ci
@@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at c4dev@avalanche.io. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
@@ -0,0 +1,6 @@
# This is the official list of people who have contributed
# code to the C4 repository.

Joshua Kolden <joshua@studiopyxis.com>
Mat Ryer <thatmatryer@gmail.com>
Lars Lehtonen <lars@opsangeles.com>
@@ -1,9 +1,9 @@
The MIT License (MIT)

Copyright © 2008-2016 Joshua Kolden http://www.cccc.io
Copyright © 2008-2016 Joshua Kolden <mrjoshua@avalanche.io> and the C4 Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
132 README.md
@@ -1,62 +1,86 @@

# C4 - The Cinema Content Creation Cloud

Go package and cli for c4. [![GoDoc](https://godoc.org/github.com/etcenter/c4go?status.svg)](https://godoc.org/github.com/etcenter/c4)

### Command line tool
See [c4 command line tool](https://github.com/etcenter/c4/tree/master/cmd/c4)

### Go Package
Example usage to generate an c4 ID for a file.

```go
package main
import (
"fmt"
"io"
"os"
// import 'asset' asset identification
"github.com/etcenter/c4/asset"
)
func main() {
file := "main.go"
f, err := os.Open(file)
if err != nil {
panic(err)
}
defer f.Close()
// create a ID encoder.
e := asset.NewIDEncoder()
// the encoder is an io.Writer
_, err = io.Copy(e, f)
if err != nil {
panic(err)
}
// ID will return an *asset.ID.
// Be sure to be done writing bytes before calling ID()
id := e.ID()
// use the *asset.ID String method to get the c4id string
fmt.Printf("C4id of \"%s\": %s\n", file, id.String())
return
}
```

Output:

```bash
>go run main.go
C4id of "main.go": c44jVTEz8y7wCiJcXvsX66BHhZEUdmtf7TNcZPy1jdM6S14qqrzsiLyoZRSvRGcAMLnKn4zVBvAFimNg14NFKp46cC
```
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
[![GoDoc](https://godoc.org/github.com/Avalanche-io/c4?status.svg)](https://godoc.org/github.com/avalanche-io/c4)
[![Stories in Ready](https://badge.waffle.io/Avalanche-io/c4.png?label=ready&title=Ready)](https://waffle.io/Avalanche-io/c4)
[![Build Status](https://travis-ci.org/Avalanche-io/c4.svg?branch=master)](https://travis-ci.org/Avalanche-io/c4)


### The C4 framework
C4 the Cinema Content Creation Cloud is an open source framework for content creation using remote resources.

- Videos:
- [C4 Framework Universal Asset ID](https://youtu.be/ZHQY0WYmGYU)
- [The Magic of C4](https://youtu.be/vzh0JzKhY4o)

- Web: http://www.cccc.io/
- Mailing list: https://groups.google.com/forum/#!forum/c4-framework
- Twitter: https://twitter.com/CinemaC4

---

### C4 ID - Universal Identification

[C4 ID Whitepaper](http://www.cccc.io/downloads/C4ID%20ETC%20Whitepaper_u2.pdf)

The C4 ID system provides an unambiguous, universally unique id for any file or block of data. Unlike other mechanisms of identification, file paths, URLs, UUID, GUID, etc., C4 IDs are not only universally unique, but also universally consistent. This means that users at different locations and times will independently agree on the C4 ID of any data. This allows for consistent and unambiguous communication without prior agreement or communication of any kind.

This 'agreement without communication' is the key to enabling interoperability for globally distributed workflows.

See the [README.md](id/README.md) in `./id` for more information.

---

### C4 Lang - Domain Language for Wokflows

The C4 Domain Specific Language (DSL) is a declarative language that represents a dependency graph of operations that are repeatable and verifiable. C4 Lang make it possible to describe processes that must work across ad-hoc and unreliable networks.

Like the [Bitcoin][1] block chain, the [git][2] source code management system, and CoreOS's [etcd][3], C4 is at it's core a way to address the [consensus problem][4] of distributed computing.

In the context of media production computational work can be reduced to a graph of dependencies where each node represents a process that transforms inputs into outputs. C4 Lang identifies inputs and outputs by C4 IDs which allows systems to consider processing and storage to be interchangeable.

This property extends to any combination of processes leading to the same C4 ID. This means that any dependency graph can be collapsed if the C4 ID of it's results are available or can be deduced. This fungibility of computation and storage is a very powerful property of the language that reduces much of the complexity of distributed computation by eliminating the need for message passing or synchronous remote procedure calls.

Both the results of a C4 Lang workflow and the dependency graph itself are immutable. By making workflows unmodifiable all systems are guaranteed to have a consistent view of any given workflow across all points in time. Until that workflow is superseded work can progress indefinitely to reduce it to it's fix and immutable results, surviving network outages, reboots, extended downtime and even storage failures.

At any point in time it is unambiguous what work has been done and what work needs to be done, active synchronization is not required. If dependencies can be locally satisfied for pending tasks work progresses without knowledge of past events or the state of remote systems. When information from remote systems does arrive it can be combined with the local state in a lock free, conflict free merge. Systems needn't track where or when updates occur they need only ever consider the static state of the current environment at the moment of evaluation.

[1]: https://en.bitcoin.it/wiki/Block_chain
[2]: https://git-scm.com
[3]: https://coreos.com/etcd
[4]: https://en.wikipedia.org/wiki/Consensus_(computer_science)

---

### C4 PKI - Identity and Access Management

Under the C4 Public Key Infrastructure model there are no logins (other than a user on their own device). C4 PKI employs a public key infrastructure with mutually authenticated certificates to establish federated access between systems without needing an active network connection. C4 PKI eliminates the need for account logins, or identity providers like LDAP and OAuth.

C4 PKI allows access to be structured hierarchically. An organization like a studio can grant access to sub organizations like a post house, and directly to individuals. Two or more sub organizations with access to the same production, as granted by a signed certificate from the studio, can share data and interact with each other over secure connections. Encrypted communication is still possible and security is maintained even when an Internet connection is not available because users are authenticated by signed certificate not by user name and password.

---

##### Regular Expressions for C4 IDs
Here are some options for regular expressions with varying precision.
- Non-overlapping matches.
- `c4\w{88}`
- `c4[1-9A-Za-z]{88}`
- `c4[1-9A-HJ-NP-Za-km-z]{88}`
- `c4[1-6][1-9A-HJ-NP-Za-km-z]{87}`
- `c46[1-7][1-9A-HJ-NP-Za-km-z]{86}|c4[1-5][1-9A-HJ-NP-Za-km-z]{87}`
- Overlapping matches.
- `(?=(c4\w{88}))`
- `(?=(c4[1-9A-Za-z]{88}))`
- `(?=(c4[1-9A-HJ-NP-Za-km-z]{88}))`
- `(?=(c4[1-6][1-9A-HJ-NP-Za-km-z]{87}))`
- `(?=(c46[1-7][1-9A-HJ-NP-Za-km-z]{86}|c4[1-5][1-9A-HJ-NP-Za-km-z]{87}))`

### Releases

Current release: [v0.6.0](https://github.com/etcenter/c4/tree/v0.6.0)
Current release: [v0.6.0](https://github.com/Avalanche-io/c4/tree/v0.6.0)

Check the `release` branch for the latest release, or tags to find a specific release. The `master` branch holds currently development.
Check the `release` branch for the latest release, or tags to find a specific release. The `master` branch holds current development.

### License
This software is released under the MIT license. See LICENSE for more information.
This software is released under the MIT license. See [LICENSE](./LICENSE) for more information.

This file was deleted.

0 comments on commit 7aa6ff4

Please sign in to comment.
You can’t perform that action at this time.