-
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Tony Worm <[email protected]>
- Loading branch information
Showing
86 changed files
with
906 additions
and
728 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 |
---|---|---|
|
@@ -8,6 +8,6 @@ We are only supporting the latest version at this point. | |
|
||
Please email [email protected] | ||
|
||
We appreciate your secure disclusures. We don't have much money right now but will make our best effort to find a reward or other consideration. | ||
We appreciate your secure disclosures. We don't have much money right now but will make our best effort to find a reward or other consideration. | ||
|
||
Thank You |
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,42 @@ | ||
package prompt | ||
|
||
import "encoding/json" | ||
|
||
test: { | ||
@flow() | ||
|
||
prompt: { | ||
@task(prompt.Prompt) | ||
|
||
Input: { | ||
name: string | ||
repo: string | ||
releases: bool | *false | ||
} | ||
|
||
Questions: [{ | ||
Name: "name" | ||
Type: "input" | ||
Prompt: "What is your project named" | ||
Required: true | ||
}, { | ||
Name: "repo" | ||
Type: "input" | ||
Prompt: "Git repository" | ||
Default: "github.com/user/repo" | ||
}, { | ||
Name: "releases" | ||
Type: "confirm" | ||
Prompt: "Enable release tooling" | ||
Default: true | ||
}] | ||
|
||
Output: _ | ||
} | ||
|
||
output: { | ||
@task(os.Stdout) | ||
text: json.Indent(json.Marshal(prompt.Output), "", " ") | ||
} | ||
|
||
} |
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,75 @@ | ||
package api | ||
|
||
Method: *"GET" | "POST" | "PUT" | "DELETE" | "OPTIONS" | "HEAD" | "CONNECT" | "TRACE" | "PATCH" | ||
|
||
Call: { | ||
@task(api.Call) | ||
|
||
req: { | ||
method: Method | ||
host: string | ||
path: string | *"" | ||
auth?: string | ||
headers?: [string]: string | ||
query?: [string]: string | ||
form?: [string]: string | ||
data?: string | {...} | ||
timeout?: string | ||
// curl?: string | ||
retry?: { | ||
count: int | *3 | ||
timer: string | *"6s" | ||
codes: [...int] | ||
} | ||
} | ||
|
||
// filled by task | ||
resp: { | ||
status: string | ||
statusCode: int | ||
|
||
body: *{} | bytes | string | ||
header: [string]: string | [...string] | ||
trailer: [string]: string | [...string] | ||
} | ||
|
||
} | ||
|
||
Serve: { | ||
@task(api.Serve) | ||
|
||
port: string | ||
quitMailbox: string | ||
|
||
routes: [...{ | ||
// @flow() is needed to run sub-tasks per request, which is more typical | ||
// you can omit if you only need to reshape the data with CUE code | ||
|
||
// filled by hof/flow on each request | ||
req: { | ||
method: Method | ||
url: string | ||
|
||
headers: [string]: string | ||
query: [string]: string | ||
|
||
body: bytes | string | *{} // assumed json body if object | ||
} | ||
|
||
// any tasks you may need to convert the req -> resp | ||
// these will be run after the `req` fields has been filled | ||
|
||
// you construct the resp value which is sent back to the client | ||
// (todo, make this include headers, code, etc | ||
// for now, this is a value which will be turned into a JSON body for the response | ||
resp: { | ||
status: int | ||
|
||
// one of, if none -> NoContent | ||
json?: {} | ||
html?: string | ||
body?: string | ||
} | ||
|
||
}] | ||
} |
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 @@ | ||
// CSP (Communicating Sequential Processes) | ||
// Named channels (mailboxes) and send/recv messages | ||
// Similar to Go / Erlang concurrency | ||
// Can be accessed from different flows/tasks | ||
package csp | ||
|
||
// Chan is a named mailbox | ||
Chan: { | ||
@task(csp.Chan) | ||
|
||
// the name of the channel | ||
mailbox: string | ||
|
||
// how many messages can queue | ||
// defaults to a blocking send / recv | ||
buf: int | *0 | ||
} | ||
|
||
// Send a message to a mailbox | ||
Send: { | ||
@task(csp.Send) | ||
|
||
// the name of the channel | ||
mailbox: string | ||
|
||
// an optional key | ||
key?: string | ||
|
||
// the message value | ||
val: _ | ||
} | ||
|
||
// Recv is a coroutine which runs indefinitely | ||
Recv: { | ||
@task(csp.Recv) | ||
|
||
// the name of the channel | ||
mailbox: string | ||
|
||
// the name of a second mailbox to quit on any message received | ||
quitMailbox?: string | ||
|
||
// the handler for a message, run as a flow per message | ||
handler: { | ||
// filled when a message is received | ||
msg: _ | ||
|
||
// do whatever you like in here | ||
} | ||
} |
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,21 @@ | ||
package hof | ||
|
||
Format: { | ||
@task(cue.Format) | ||
|
||
value: _ | ||
|
||
Package: string | *"" | ||
Raw: bool | *false | ||
Final: bool | *false | ||
Concrete: bool | *true | ||
Definitions: bool | *true | ||
Optional: bool | *true | ||
Hidden: bool | *true | ||
Attributes: bool | *true | ||
Docs: bool | *true | ||
InlineImports: bool | *false | ||
ErrorsAsValues: bool | *false | ||
|
||
out: string | ||
} |
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,37 @@ | ||
package db | ||
|
||
// need to figure out how to separate out the connection | ||
// so it can be create once and reused by queries | ||
// possibly how to pool connections as well | ||
|
||
// only SQLite supported currently | ||
|
||
// Call a database | ||
Call: { | ||
@task(db.Call) | ||
|
||
// db connection | ||
conn: { | ||
sqlite?: string // db name | ||
postgres?: string | ||
} | ||
|
||
// args to Call | ||
args: [...] | ||
|
||
// Use only one of [query,exec,stmts] | ||
query: string | ||
exec: string | ||
|
||
stmts: [...{ | ||
// Use only one of [query,exec,stmts] | ||
query: string | ||
exec: string | ||
// args to statement, merged with top-level | ||
args: string | ||
|
||
results: _ | ||
}] | ||
|
||
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,35 @@ | ||
package gen | ||
|
||
// Seed the Range | ||
Seed: { | ||
@task(gen.Seed) | ||
|
||
// only set to ensure consistent output while testing | ||
seed?: int // defaults to time.Now() | ||
} | ||
|
||
Int: { | ||
@task(gen.Int) | ||
max?: int // max value if set | ||
|
||
// the random val returned | ||
val: int | ||
} | ||
|
||
Str: { | ||
@task(gen.Str) | ||
|
||
// number of runes to generate | ||
n: int | *12 | ||
|
||
// possible runes, defaults to [a-zA-Z] | ||
runes?: string | ||
} | ||
|
||
// the other tasks don't really have schema or input | ||
c: string @task(gen.CUID) // like UUID, but for cloud | ||
f: float @task(gen.Float) | ||
n: float @task(gen.Norm) | ||
t: string @task(gen.Now) // RFC-3339 | ||
s: string @task(gen.Slug) // related to CUID | ||
u: string @task(gen.UUID) |
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,13 @@ | ||
package hof | ||
|
||
Tempate: { | ||
@task(hof.Template) | ||
|
||
name: string | *"" | ||
data: _ | ||
|
||
template: string | ||
partials: [string]: string | ||
|
||
out: string | ||
} |
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,25 @@ | ||
package kv | ||
|
||
// in memory cue.Value storage | ||
Mem: { | ||
@task(kv.Mem) | ||
|
||
// key to store under | ||
key: string | ||
|
||
// if specified, value to store | ||
// otherwise the value in memory as filled in | ||
val?: _ | ||
|
||
// delete the key & value | ||
delete: bool | *false | ||
|
||
// boolean for if the value was loaded | ||
loaded: bool | ||
} | ||
|
||
// redis, etcd | ||
|
||
// obj Stores (here?) | ||
// mongo, couch, elastic | ||
// s3 / gcs |
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,8 @@ | ||
package msg | ||
|
||
// todo, abstract message type 'Any' | ||
// add more like rabbit, kafka, nats | ||
|
||
IrcClient: { | ||
// see github.com/verdverm/streamer-tools for an example | ||
} |
Oops, something went wrong.