This repository has been archived by the owner on Dec 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
266 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
/api/ | ||
/dist/ | ||
/gen/ | ||
/vendor/ | ||
/docs/openapiv2/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
project_name: aetherfs | ||
|
||
snapshot: | ||
name_template: "{{ .ShortCommit }}" | ||
|
||
builds: | ||
- id: aetherfs | ||
main: ./main.go | ||
binary: aetherfs | ||
goos: | ||
- darwin | ||
- linux | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
hooks: | ||
post: make .proto-tar VERSION={{ .Version }} | ||
|
||
archives: | ||
- id: aetherfs | ||
name_template: "aetherfs_{{ .Os }}_{{ .Arch }}" | ||
builds: | ||
- aetherfs | ||
|
||
checksum: | ||
name_template: 'aetherfs_checksums.txt' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# This is the list of AetherFS's significant contributors. | ||
# | ||
# This does not necessarily list everyone who has contributed code, | ||
# especially since many employees of one corporation may be contributing. | ||
# To see the full list of contributors, see the revision history in | ||
# source control. | ||
Mya Pitzeruse <mya@aetherfs.tech> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Copyright (C) The AetherFS Authors - All Rights Reserved | ||
// | ||
// Proprietary and confidential. | ||
// Unauthorized copying of this file, via any medium is strictly prohibited. | ||
// Written by Mya Pitzeruse, September 2021 | ||
|
||
package authors | ||
|
||
import ( | ||
"strings" | ||
|
||
"github.com/urfave/cli/v2" | ||
) | ||
|
||
// Parse parses the contents of the authors file. The file is format based on Google's open source guidelines. For more | ||
// information, see https://opensource.google/docs/releasing/authors/ | ||
func Parse(contents string) []*cli.Author { | ||
lines := strings.Split(contents, "\n") | ||
results := make([]*cli.Author, 0, len(lines)) | ||
|
||
for _, line := range lines { | ||
idx := strings.Index(line, "#") | ||
if idx > -1 { | ||
line = line[:idx] | ||
} | ||
|
||
line := strings.TrimSpace(line) | ||
|
||
name := line | ||
email := "" | ||
|
||
start := strings.LastIndex(line, "<") | ||
end := strings.LastIndex(line, ">") | ||
|
||
// emails are optional | ||
if start > -1 && end > -1 { | ||
name = strings.TrimSpace(line[:start]) | ||
email = line[start+1 : end] | ||
} | ||
|
||
if name != "" { | ||
results = append(results, &cli.Author{ | ||
Name: name, | ||
Email: email, | ||
}) | ||
} | ||
} | ||
|
||
return results | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
// Copyright (C) The AetherFS Authors - All Rights Reserved | ||
// | ||
// Proprietary and confidential. | ||
// Unauthorized copying of this file, via any medium is strictly prohibited. | ||
// Written by Mya Pitzeruse, September 2021 | ||
package main | ||
|
||
import ( | ||
"context" | ||
_ "embed" | ||
"fmt" | ||
"log" | ||
"os" | ||
"os/signal" | ||
"syscall" | ||
"time" | ||
|
||
"github.com/urfave/cli/v2" | ||
|
||
"github.com/mjpitz/aetherfs/internal/authors" | ||
) | ||
|
||
//go:embed AUTHORS | ||
var authorsFileContents string | ||
|
||
var version string | ||
var commit string | ||
var date string | ||
|
||
func main() { | ||
compiled, err := time.Parse(time.RFC3339, date) | ||
if err != nil { | ||
compiled = time.Now() | ||
} | ||
|
||
if version == "" { | ||
version = "dev" | ||
} | ||
|
||
if commit == "" { | ||
commit = "HEAD" | ||
} | ||
|
||
app := &cli.App{ | ||
Name: "aetherfs", | ||
Usage: "A publish once, consume many file system for small to medium datasets", | ||
UsageText: "aetherfs <command>", | ||
Version: fmt.Sprintf("%s (%s)", version, commit), | ||
Commands: []*cli.Command{ | ||
{ | ||
Name: "agent", | ||
Usage: "Starts the aetherfs-agent process", | ||
UsageText: "aetherfs agent [options]", | ||
Action: func(ctx *cli.Context) error { | ||
log.Print("running agent") | ||
<-ctx.Done() | ||
return nil | ||
}, | ||
}, | ||
{ | ||
Name: "server", | ||
Usage: "Starts the aetherfs-server process", | ||
UsageText: "aetherfs server [options]", | ||
Action: func(ctx *cli.Context) error { | ||
log.Print("running server") | ||
<-ctx.Done() | ||
return nil | ||
}, | ||
}, | ||
{ | ||
Name: "push", | ||
Usage: "Pushes a dataset into AetherFS", | ||
UsageText: "aetherfs push [options] <path>", | ||
Action: func(ctx *cli.Context) error { | ||
log.Print("pushing dataset") | ||
return nil | ||
}, | ||
}, | ||
{ | ||
Name: "pull", | ||
Usage: "Pulls a dataset from AetherFS", | ||
UsageText: "aetherfs pull [options] <dataset> [path]", | ||
Action: func(ctx *cli.Context) error { | ||
log.Print("pulling dataset") | ||
return nil | ||
}, | ||
}, | ||
}, | ||
Flags: []cli.Flag{}, | ||
Before: func(ctx *cli.Context) error { | ||
var cancel context.CancelFunc | ||
ctx.Context, cancel = context.WithCancel(ctx.Context) | ||
|
||
halt := make(chan os.Signal, 1) | ||
signal.Notify(halt, syscall.SIGINT, syscall.SIGTERM) | ||
|
||
go func() { | ||
<-halt | ||
signal.Stop(halt) | ||
|
||
cancel() | ||
}() | ||
|
||
return nil | ||
}, | ||
After: func(ctx *cli.Context) error { | ||
// teardown plugins | ||
// - destroy outgoing connections | ||
// - ensure db files are closed | ||
// - etc | ||
return nil | ||
}, | ||
Compiled: compiled, | ||
Authors: authors.Parse(authorsFileContents), | ||
Copyright: fmt.Sprintf("Copyright %d The AetherFS Authors - All Rights Reserved", compiled.Year()), | ||
} | ||
|
||
_ = app.Run(os.Args) | ||
} |