Documentation
ΒΆ
Index ΒΆ
- Variables
- func Accept(r *http.Request, format string) bool
- func AddToKnownHosts(user, server string) error
- func AppendUsingReflect(slice any, value any) any
- func AuthenticateTailscale(authkey string) error
- func BackupDir(path string, encKey string, outfile string) error
- func Bit(b byte, i int) bool
- func CallMethod(v any, m string, args []string) ([]string, error)
- func ClientIP(r *http.Request) string
- func CmdlineServer(h http.Handler)
- func CompressDir(dir, outFile string) error
- func ContentType(r *http.Request, format string) bool
- func Cookie(r *http.Request, id string) string
- func CopyDir(srcDir, dstDir string) error
- func CopyFile(src, dst string) error
- func CopyFileFromRemote(user, addr, src, dst string) ([]byte, error)
- func CopyFileToRemote(user, addr, src, dst string) ([]byte, error)
- func CreateFile(path string) (*os.File, error)
- func CreateP(name string) (*os.File, error)
- func DecryptAndDecompressDir(src io.Reader, dst string, key string) error
- func DeleteCookie(w http.ResponseWriter, name string)
- func Download(url, target string) error
- func DownloadDir(user, host, path string) ([]byte, error)
- func Drill(v any, path []string) (any, error)
- func EncryptAndCompressDir(src string, buf io.Writer, key string) error
- func EncryptedReader(key string, r io.Reader) (*cipher.StreamReader, error)
- func EncryptedWriter(key string, w io.Writer) (*cipher.StreamWriter, error)
- func EnvVar(name string, def string) string
- func ErrorHTTP(w http.ResponseWriter, code int)
- func ExecRemote(user, host, cmd string) ([]byte, error)
- func Exists(path string) bool
- func FReadJSONFile(fsys fs.FS, path string, v any) error
- func FieldValue(v any, f string) any
- func FilterString(input, charset string) string
- func FilterTestFiles(fi fs.FileInfo) bool
- func Flatten(v any) map[string]string
- func FprintJSON(w io.Writer, v any) (int, error)
- func FrequencyToRGB(frequency float64) string
- func GetAddr() string
- func GetInstalledGoVersion() (string, error)
- func GetLatestGoVersion() (string, error)
- func GetName(v any) string
- func GetOSID() (string, error)
- func GetPasswordFromStdin(prompt string) (string, error)
- func HandleCORS(w http.ResponseWriter, r *http.Request)
- func HandlePUT(w http.ResponseWriter, r *http.Request, v any)
- func HasMethod(v any, m string) bool
- func HomeDir() string
- func InstallGo() error
- func InstallNode() error
- func InstallTailscale() error
- func IntToID(v int64) string
- func IsAlphaNumeric(ch rune) bool
- func IsArray(v any) bool
- func IsBool(v any) bool
- func IsDir(path string) bool
- func IsInt(v any) bool
- func IsLoopbackIP(ip net.IP) bool
- func IsMap(v any) bool
- func IsMutation(r *http.Request) bool
- func IsPrivateIP(ip net.IP) bool
- func IsPublicIP(ip net.IP) bool
- func IsRootRequest(r *http.Request) bool
- func IsStdlib(pkg string) bool
- func IsString(v any) bool
- func IsStruct(v any) bool
- func IsTenDigits(phone string) bool
- func JSONString(v any) string
- func JoinPath(path []string) string
- func KebabCase(s string) string
- func Kind(v interface{}) string
- func LatestGoVersion() string
- func ListenAndServe(h http.Handler) error
- func MIMEType(file string) string
- func Main(s http.Handler)
- func Must[T any](v T, err error) T
- func NewRecursiveWatcher(dir string) (*fsnotify.Watcher, error)
- func NewReverseProxy(backendURL string) *httputil.ReverseProxy
- func NewServeMux(handlers map[string]http.Handler) http.Handler
- func NormalizeGoName(s string) string
- func NormalizePhoneNumber(number string) string
- func OS() string
- func OnFileChange(path string, callback func()) error
- func OnlyLowerCase(s string) string
- func OnlyOne[T any](m map[string]T) (id string, value T, ok bool)
- func OptionallyServeHTTP(v any, w http.ResponseWriter, r *http.Request)
- func PackageManager() string
- func ParseJSON[T any](s string) T
- func ParsePath(s string) []string
- func PascalCase(s string) string
- func PasswordProtected(passwd string, h http.Handler) http.Handler
- func Pop[T any](items []T) (T, []T)
- func PopPath(path string) (first string, rest string, isRoot bool)
- func Port() string
- func PrintJSON(v any) (int, error)
- func PrintResponse(resp *http.Response)
- func QuadrupleTime(fn1, fn2, fn3, fn4 func()) error
- func RandomBits(n int) []bool
- func RandomBytes(n int) []byte
- func RandomCode(digits int) string
- func RandomDigit() int
- func RandomElement[T any](arr []T) (T, error)
- func RandomID() string
- func RandomString(length int, charset string) string
- func RandomToken(bytes int) string
- func ReadDir(path string) ([]string, error)
- func ReadGoPackageFromDisk(dir string) (*ast.Package, error)
- func ReadJSON[T any](r io.Reader) *T
- func ReadJSONFS(w io.Writer, t *Type, path string) error
- func ReadJSONFile(path string, v any) error
- func ReadRemoteFile(user, password, host string, port int, remotePath string) (string, error)
- func ReloadSystemd() error
- func RenderTemplateToFile(tmpl string, path string, in any) error
- func RequireEnvVar(name string) string
- func RestoreDir(backupFile string, encKey string, outDir string) error
- func Run(cmd *exec.Cmd) error
- func RunInParallel(fns []func() error) []error
- func RunSSHCommandWithKnownHostsCheck(host, user, cmd string, auth []ssh.AuthMethod) ([]byte, error)
- func SHA256(b []byte) []byte
- func SSHClientConfig(user string) (*ssh.ClientConfig, error)
- func SecurePassword() string
- func Serialize(v any) []byte
- func Serve(s http.Handler)
- func ServeAll(handlers map[string]http.Handler) error
- func ServeAny(v any, w http.ResponseWriter, r *http.Request)
- func ServeBool(path []string, v any, w http.ResponseWriter, r *http.Request)
- func ServeError(w http.ResponseWriter, code int)
- func ServeHTTPS(h http.Handler, email, certDir string, allowHost func(host string) bool) error
- func ServeMethod(m string, v any, w http.ResponseWriter, r *http.Request)
- func ServeMyIP(w http.ResponseWriter, r *http.Request)
- func ServeObject(path []string, v Object, w http.ResponseWriter, r *http.Request)
- func SetField(v any, fieldName string, fieldValue any)
- func SnakeCase(s string) string
- func SortedKeys[T any](m map[string]T) []string
- func StartServer(s http.Handler) error
- func StripNonAlphaNumeric(s string) string
- func StructToMap(val any) map[string]any
- func SubFS(fsys fs.FS, dir string) fs.FS
- func Sync(src, dst string) error
- func TitleCase(s string) string
- func Touch(path string) error
- func UnixNanoTimestamp() string
- func UnixTimestamp() string
- func UploadDir(user, host string, b []byte, path string) error
- func UserPassServer(user string, pass string, h http.Handler) http.Handler
- func WaitUntil(h, m, s int)
- func Watch(path string, fn func()) error
- func WavelengthToRGB(wavelength float64) string
- func WriteFile(path string, b []byte) error
- func WriteJSON(w http.ResponseWriter, v any)
- func WriteJSONFS(path string, b []byte) error
- func WriteJSONFile(path string, v any) error
- func WriteMethodNotAllowed(w http.ResponseWriter)
- func WriteNotFound(w http.ResponseWriter)
- func WriteTempFile(b []byte) (string, error)
- type API
- func (api *API[T]) Data() *Table[T]
- func (api *API[T]) Login(w http.ResponseWriter, r *http.Request)
- func (api *API[T]) Logout(w http.ResponseWriter, r *http.Request)
- func (api *API[T]) NewOrg(w http.ResponseWriter, r *http.Request)
- func (api *API[T]) Orgs() *Table[Org]
- func (api *API[T]) Register(w http.ResponseWriter, r *http.Request)
- func (api *API[T]) ServeData(w http.ResponseWriter, r *http.Request)
- func (api *API[T]) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (api *API[T]) Sessions() *Table[string]
- func (api *API[T]) Users() *Table[User]
- type Account
- type Action
- type App
- type AppConfig
- type AppServer
- type Array
- type ArrayType
- type AuthMethod
- type Backend
- type BlogPost
- type Bool
- type BuildConfig
- type BuildServer
- type CI
- type Cafe
- type CmdServer
- type Collection
- type DB
- func (db *DB) AddColumn(table, column, typ string) error
- func (db *DB) CreateTable(name string) error
- func (db *DB) Delete(name string) error
- func (db *DB) Insert(name string) error
- func (db *DB) SelectMany(name string) error
- func (db *DB) SelectOne(name string) error
- func (db *DB) Update(name string) error
- type DevServer
- type Email
- type Endpoint
- type Error
- type Expression
- type FancyRoute
- type FancyRouter
- type Field
- type File
- type FileObject
- type FileServer
- type FileStore
- type FileSystem
- type Folder
- type Form
- type Function
- type GitRepo
- type GithubMirror
- type GithubRepository
- type GithubWebhook
- type GithubWebhookRequest
- type GoBuilder
- type GoCodebase
- type GoDecl
- type GoFile
- type GoPackage
- type GoWorkspace
- type HCloudStorageFileSystem
- type HTMLDocument
- type HTMLHead
- type HTMLReader
- type HTMLTemplateData
- type HashCache
- type ImportMap
- type Int
- type JSONFileServer
- type Link
- type LinkList
- type List
- type ListItem
- type LiveObject
- type LocalFileSystem
- func (fs *LocalFileSystem) Dig(path string) FileSystem
- func (fs *LocalFileSystem) IsDir(path string) bool
- func (fs *LocalFileSystem) IsFile(path string) bool
- func (fs *LocalFileSystem) MakeDir(path string) error
- func (fs *LocalFileSystem) ReadDir(path string) ([]string, error)
- func (fs *LocalFileSystem) ReadFile(path string) ([]byte, error)
- func (fs *LocalFileSystem) Remove(path string) error
- func (fs *LocalFileSystem) WriteFile(path string, b []byte) error
- type Map
- type MapList
- type MapType
- type Metadata
- type MethodCall
- type Movie
- type MultiHostServer
- type MultiUserAuthHandler
- type Name
- type NextApp
- type NextPage
- type Nil
- type Object
- type Org
- type Pair
- type Person
- type Personal
- type PhoneNumber
- type PingServer
- type PostgresDB
- type ProgrammingLanguage
- type Prompt
- type PromptOption
- type ReactComponent
- type ReactElement
- type ReactHook
- type Ref
- type RemoteFileSystem
- func (fs *RemoteFileSystem) IsDir(path string) bool
- func (fs *RemoteFileSystem) IsFile(path string) bool
- func (fs *RemoteFileSystem) MakeDir(path string) error
- func (fs *RemoteFileSystem) ReadDir(path string) ([]string, error)
- func (fs *RemoteFileSystem) ReadFile(path string) ([]byte, error)
- func (fs *RemoteFileSystem) Remove(path string) error
- func (fs *RemoteFileSystem) WriteFile(path string, b []byte) error
- type Request
- type Response
- type Route
- type Router
- type SHA256Server
- type ScalarType
- type Schema
- type SchemaCafe
- type Sender
- type Service
- type Session
- type Set
- type SheetsDB
- type SimpleForm
- type SinglePageApp
- type SingleUserApp
- func (a *SingleUserApp) AuthFiles() FileSystem
- func (a *SingleUserApp) AuthHandler() *SingleUserAuthHandler
- func (a *SingleUserApp) Authorized(r *http.Request) (bool, error)
- func (a *SingleUserApp) GetSession(token string) (*Session, error)
- func (app *SingleUserApp) ServeHTTP(w http.ResponseWriter, r *http.Request)
- type SingleUserAuthHandler
- type Statement
- type StreamBroadcaster
- type StreamMultiplexer
- type String
- type Struct
- type StructType
- type SystemdService
- type TVEpisode
- type TVSeason
- type TVShow
- type Table
- func (t *Table[T]) Delete(id string) error
- func (t *Table[T]) FindIDsBy(k, v string) (Set[string], error)
- func (t *Table[T]) Get(id string) (*T, error)
- func (t *Table[T]) Len() int
- func (t *Table[T]) ListAll() []string
- func (t *Table[T]) Post(v *T) error
- func (t *Table[T]) Set(id string, v *T) error
- type TableConstraint
- type TemplateServer
- type TwilioClient
- type Type
- type User
- type Value
- func (v *Value) GoImports() map[string]bool
- func (v *Value) GoString(imports map[string]string) string
- func (v *Value) WriteGoConstFile(path string) error
- func (v *Value) WriteGoVarFile(path string) error
- func (v *Value) WriteReactHookFile(path string) error
- func (v *Value) WriteTypeScriptConstantFile(path string) error
- type Video
- type WebAPI
- type WebpageMetadata
- type Word
- type XML
Constants ΒΆ
This section is empty.
Variables ΒΆ
var Digits = "0123456789"
var Letters = "abcdefghijklmnopqrstuvwxyz"
Functions ΒΆ
func AddToKnownHosts ΒΆ
func AppendUsingReflect ΒΆ
func AuthenticateTailscale ΒΆ
func Bit ΒΆ
Bit returns the bit value of the bit at index i of b. It panics if i is out of range (1-8).
func CallMethod ΒΆ
CallMethod takes any value, a method name, and an array of JSON-encoded strings. It parses these strings into method arguments and invokes the method, including support for variadic functions. Returns the result of the method call or an error.
func CmdlineServer ΒΆ
CmdlineServer let's you easily turn any http.Handler into a cmdline app.
func CompressDir ΒΆ
CompressDir compresses the specified directory into a .tar.gz file.
func CopyFileFromRemote ΒΆ
func CopyFileToRemote ΒΆ
func DeleteCookie ΒΆ
func DeleteCookie(w http.ResponseWriter, name string)
func DownloadDir ΒΆ
func EncryptAndCompressDir ΒΆ
func EncryptedReader ΒΆ
EncryptedReader wraps r with an OFB cipher stream.
func EncryptedWriter ΒΆ
EncryptedWriter wraps w with an OFB cipher stream.
func ErrorHTTP ΒΆ
func ErrorHTTP(w http.ResponseWriter, code int)
func ExecRemote ΒΆ
func FieldValue ΒΆ
func FilterString ΒΆ
func FilterTestFiles ΒΆ
func FrequencyToRGB ΒΆ
FrequencyToRGB converts a light frequency in THz to an RGB hex string.
func GetInstalledGoVersion ΒΆ
func GetLatestGoVersion ΒΆ
func GetPasswordFromStdin ΒΆ
func HandleCORS ΒΆ
func HandleCORS(w http.ResponseWriter, r *http.Request)
func InstallNode ΒΆ
func InstallNode() error
func InstallTailscale ΒΆ
func InstallTailscale() error
func IsAlphaNumeric ΒΆ
func IsLoopbackIP ΒΆ
func IsMutation ΒΆ
func IsPrivateIP ΒΆ
func IsPublicIP ΒΆ
func IsRootRequest ΒΆ
func IsTenDigits ΒΆ
func JSONString ΒΆ
func Kind ΒΆ
func Kind(v interface{}) string
Kind determines the kind of a given value. It returns one of "struct", "map", "list", "scalar" or "null".
func LatestGoVersion ΒΆ
func LatestGoVersion() string
func ListenAndServe ΒΆ
func NewReverseProxy ΒΆ
func NewReverseProxy(backendURL string) *httputil.ReverseProxy
func NormalizeGoName ΒΆ
func NormalizePhoneNumber ΒΆ
func OnFileChange ΒΆ
OnFileChange sets up a watcher that calls `callback()` ONCE each time the file's contents change.
func OnlyLowerCase ΒΆ
func OptionallyServeHTTP ΒΆ
func OptionallyServeHTTP(v any, w http.ResponseWriter, r *http.Request)
func PackageManager ΒΆ
func PackageManager() string
func PascalCase ΒΆ
func PrintResponse ΒΆ
func QuadrupleTime ΒΆ
func QuadrupleTime(fn1, fn2, fn3, fn4 func()) error
Run each fn 250 ms apart forever. Returns an error if a func takes longer than 249 ms to run.
func RandomBits ΒΆ
func RandomBytes ΒΆ
func RandomCode ΒΆ
func RandomDigit ΒΆ
func RandomDigit() int
func RandomElement ΒΆ
func RandomID ΒΆ
func RandomID() string
RandomID returns a 32-byte hex encoded string. The first 8 bytes are a nano-second precision UNIX time-stamp. The next 24 bytes are generated by /dev/urandom.
func RandomString ΒΆ
func RandomToken ΒΆ
func ReadJSONFile ΒΆ
func ReadRemoteFile ΒΆ
func ReloadSystemd ΒΆ
func ReloadSystemd() error
func RequireEnvVar ΒΆ
func RunInParallel ΒΆ
RunInParallel runs each function in fns in its own goroutine, waits for all to finish, and returns a slice of errors (same order, same length).
func RunSSHCommandWithKnownHostsCheck ΒΆ
func RunSSHCommandWithKnownHostsCheck(host, user, cmd string, auth []ssh.AuthMethod) ([]byte, error)
func SSHClientConfig ΒΆ
func SSHClientConfig(user string) (*ssh.ClientConfig, error)
func SecurePassword ΒΆ
func SecurePassword() string
func ServeAny ΒΆ
func ServeAny(v any, w http.ResponseWriter, r *http.Request)
ServeAny serves any Go value. Drill into any exported struct field or map/arary value. Arrays start at 1001. GET requests are served the JSON encoded values. POST requests are used to call methods. Ex request body: `{"Method":"Add","Args":["1","2","3"]}`. All args are JSON-encoded strings. The server will unmarshal each arg into it's appropriate type. Ex response body: `["6","null"]`.
func ServeError οΏ½οΏ½
func ServeError(w http.ResponseWriter, code int)
func ServeHTTPS ΒΆ
ServeHTTPS serves h on HTTP and HTTPS ports handling tls.
func ServeMethod ΒΆ
func ServeObject ΒΆ
func SortedKeys ΒΆ
func StartServer ΒΆ
func StripNonAlphaNumeric ΒΆ
func StructToMap ΒΆ
func UnixNanoTimestamp ΒΆ
func UnixNanoTimestamp() string
func UnixTimestamp ΒΆ
func UnixTimestamp() string
func WavelengthToRGB ΒΆ
func WriteJSON ΒΆ
func WriteJSON(w http.ResponseWriter, v any)
func WriteJSONFS ΒΆ
WriteJSONFS takes a JSON value and writes it recursively to the filesystem.
func WriteJSONFile ΒΆ
func WriteMethodNotAllowed ΒΆ
func WriteMethodNotAllowed(w http.ResponseWriter)
func WriteNotFound ΒΆ
func WriteNotFound(w http.ResponseWriter)
func WriteTempFile ΒΆ
Types ΒΆ
type API ΒΆ
type App ΒΆ
func (App) HTMLReader ΒΆ
func (a App) HTMLReader() *HTMLReader
type ArrayType ΒΆ
type ArrayType struct {
Name Name `json:"name"`
Description string `json:"description"`
ElemType string `json:"elem_type"`
Methods map[string]*Function `json:"methods"`
DefaultJSON string `json:"default_json"`
}
func (*ArrayType) WriteGoFile ΒΆ
func (*ArrayType) WriteTypeScriptFile ΒΆ
type AuthMethod ΒΆ
type Backend ΒΆ
type Backend struct {
DataURL string `json:"dataURL"`
GoWorkDir string `json:"goWorkDir"`
BinDir string `json:"binDir"`
}
type BlogPost ΒΆ
type BlogPost struct {
Metadata *WebpageMetadata
BodyHTML string
}
type BuildConfig ΒΆ
func (*BuildConfig) Build ΒΆ
func (config *BuildConfig) Build() error
type BuildServer ΒΆ
type BuildServer struct {
Workdir string
Config map[string]*BuildConfig
}
func (*BuildServer) ServeHTTP ΒΆ
func (s *BuildServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
type CI ΒΆ
type CI struct {
PeriodMinutes int
SourceDir string
OutFile string
ServiceName string
TwilioClient *TwilioClient
AdminPhone string
}
func (*CI) Codebase ΒΆ
func (ci *CI) Codebase() *GoCodebase
func (*CI) Serivce ΒΆ
func (ci *CI) Serivce() *SystemdService
type Collection ΒΆ
func (*Collection) List ΒΆ
func (c *Collection) List(limit, after int)
List returns a list of the first `limit` items after
type DB ΒΆ
type DB struct {
FS FileSystem
Schema struct {
Tables map[string]struct {
Columns map[string]string
}
}
}
func (*DB) CreateTable ΒΆ
func (*DB) SelectMany ΒΆ
type DevServer ΒΆ
type DevServer struct {
PkgPath string
// contains filtered or unexported fields
}
type Expression ΒΆ
type Expression struct {
IsLiteral bool `json:"isLiteral"`
Value string `json:"value"`
IsCall bool `json:"isCall"`
Fn *Ref `json:"fn"`
Args []*Expression `json:"args"`
IsRef bool `json:"isRef"`
Ref *Ref `json:"ref"`
}
func (*Expression) GoImports ΒΆ
func (ex *Expression) GoImports() map[string]bool
type FancyRoute ΒΆ
type FancyRoute struct {
Root http.Handler
Static map[string]http.Handler
Catchall *FancyRoute
VarName string
}
func (*FancyRoute) ServeHTTP ΒΆ
func (route *FancyRoute) ServeHTTP(w http.ResponseWriter, r *http.Request)
type FancyRouter ΒΆ
type FancyRouter struct {
// Routes. Each key should start with '/'.
// To handle the root request, use the key "/".
// To define a path variable, use square brackets like "/items/[itemID]".
Routes map[string]http.Handler
NotFound http.Handler
}
FancyRouter handles HTTP requests by matching each request to a handler according to Next.js routing conventions.
func (*FancyRouter) SortedRoutes ΒΆ
func (r *FancyRouter) SortedRoutes() []string
type Field ΒΆ
type FileObject ΒΆ
func (*FileObject[T]) ServeHTTP ΒΆ
func (fo *FileObject[T]) ServeHTTP(w http.ResponseWriter, r *http.Request)
type FileServer ΒΆ
type FileServer struct {
Root string
}
func (*FileServer) ServeHTTP ΒΆ
func (fs *FileServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
type FileStore ΒΆ
type FileStore struct {
Workdir string
}
FileStore stores and serves files. To use, set up a directory with an `auth.json` file and a `content` directory.
type FileSystem ΒΆ
type Function ΒΆ
type GitRepo ΒΆ
type GitRepo struct {
Dir string
}
type GithubMirror ΒΆ
type GithubMirror struct {
Workdir string
}
func (*GithubMirror) Pull ΒΆ
func (g *GithubMirror) Pull(repo string) error
func (*GithubMirror) ServeHTTP ΒΆ
func (g *GithubMirror) ServeHTTP(w http.ResponseWriter, r *http.Request)
Handle webhooks from github
type GithubRepository ΒΆ
type GithubRepository struct {
ID int `json:"id"`
NodeID string `json:"node_id"`
FullName string `json:"full_name"`
}
func (*GithubRepository) SyncLocal ΒΆ
func (repo *GithubRepository) SyncLocal(path string) error
type GithubWebhook ΒΆ
type GithubWebhookRequest ΒΆ
type GithubWebhookRequest struct {
Zen string `json:"zen"`
HookID int `json:"hook_id"`
Hook *GithubWebhook `json:"hook"`
Repository *GithubRepository `json:"repository"`
}
type GoCodebase ΒΆ
type GoCodebase struct {
Dir string
}
func (GoCodebase) Build ΒΆ
func (c GoCodebase) Build(outFile string) error
func (*GoCodebase) GitRepo ΒΆ
func (c *GoCodebase) GitRepo() *GitRepo
func (*GoCodebase) UpdateDeps ΒΆ
func (c *GoCodebase) UpdateDeps() (bool, error)
type GoDecl ΒΆ
type GoFile ΒΆ
type GoWorkspace ΒΆ
type GoWorkspace struct {
Dir string
}
func (*GoWorkspace) Clone ΒΆ
func (w *GoWorkspace) Clone(pkg string) error
func (*GoWorkspace) Install ΒΆ
func (w *GoWorkspace) Install(pkg string) error
func (*GoWorkspace) Pull ΒΆ
func (w *GoWorkspace) Pull(pkg string) error
func (*GoWorkspace) ServeGithubWebhook ΒΆ
func (ws *GoWorkspace) ServeGithubWebhook(w http.ResponseWriter, r *http.Request)
type HCloudStorageFileSystem ΒΆ
type HCloudStorageFileSystem struct {
HetznerStorageBoxAddr string
HetznerStorageBoxUsername string
HetznerStorageBoxPassword string
}
func (*HCloudStorageFileSystem) NewSFTPClient ΒΆ
func (fs *HCloudStorageFileSystem) NewSFTPClient() (*sftp.Client, error)
func (*HCloudStorageFileSystem) NewSSHClient ΒΆ
func (fs *HCloudStorageFileSystem) NewSSHClient() (*ssh.Client, error)
type HTMLDocument ΒΆ
type HTMLReader ΒΆ
func NewHTMLReader ΒΆ
func NewHTMLReader(types map[string]*Type) *HTMLReader
type HTMLTemplateData ΒΆ
type HashCache ΒΆ
type HashCache struct {
DataDir string
// contains filtered or unexported fields
}
type JSONFileServer ΒΆ
type JSONFileServer struct {
Root string
}
func (*JSONFileServer) ServeHTTP ΒΆ
func (fs *JSONFileServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
type LiveObject ΒΆ
type LiveObject[T http.Handler] struct { Path string Value T // contains filtered or unexported fields }
func NewLiveObject ΒΆ
func NewLiveObject[T http.Handler](path string, value T) *LiveObject[T]
func (*LiveObject[T]) Load ΒΆ
func (obj *LiveObject[T]) Load()
func (*LiveObject[T]) Save ΒΆ
func (obj *LiveObject[T]) Save() error
func (*LiveObject[T]) ServeHTTP ΒΆ
func (obj *LiveObject[T]) ServeHTTP(w http.ResponseWriter, r *http.Request)
type LocalFileSystem ΒΆ
type LocalFileSystem struct {
Root string
}
func (*LocalFileSystem) Dig ΒΆ
func (fs *LocalFileSystem) Dig(path string) FileSystem
func (*LocalFileSystem) IsDir ΒΆ
func (fs *LocalFileSystem) IsDir(path string) bool
func (*LocalFileSystem) IsFile ΒΆ
func (fs *LocalFileSystem) IsFile(path string) bool
func (*LocalFileSystem) MakeDir ΒΆ
func (fs *LocalFileSystem) MakeDir(path string) error
func (*LocalFileSystem) ReadDir ΒΆ
func (fs *LocalFileSystem) ReadDir(path string) ([]string, error)
func (*LocalFileSystem) ReadFile ΒΆ
func (fs *LocalFileSystem) ReadFile(path string) ([]byte, error)
func (*LocalFileSystem) Remove ΒΆ
func (fs *LocalFileSystem) Remove(path string) error
type MapType ΒΆ
type MapType struct {
Name Name `json:"name"`
Description string `json:"description"`
ElemType string `json:"elem_type"`
Methods map[string]*Function `json:"methods"`
DefaultJSON string `json:"default_json"`
}
func (*MapType) WriteGoFile ΒΆ
func (*MapType) WriteTypeScriptFile ΒΆ
type MethodCall ΒΆ
type MultiHostServer ΒΆ
type MultiHostServer struct {
Hosts map[string]http.Handler
TwilioClient *TwilioClient
AdminPhone string
}
func (*MultiHostServer) HostPolicy ΒΆ
func (s *MultiHostServer) HostPolicy(ctx context.Context, host string) error
func (*MultiHostServer) ServeHTTP ΒΆ
func (s *MultiHostServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*MultiHostServer) Start ΒΆ
func (s *MultiHostServer) Start(email, certDir string) error
type MultiUserAuthHandler ΒΆ
type MultiUserAuthHandler struct {
AuthFiles FileSystem
Twilio *TwilioClient
}
func (*MultiUserAuthHandler) Login ΒΆ
func (a *MultiUserAuthHandler) Login(phone, code string) (*Session, error)
func (*MultiUserAuthHandler) SendLoginCode ΒΆ
func (a *MultiUserAuthHandler) SendLoginCode(phone string) error
func (*MultiUserAuthHandler) ServeHTTP ΒΆ
func (a *MultiUserAuthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type Name ΒΆ
type Name []Word
func (Name) GoExported ΒΆ
GoExported returns an exported Go name. Ex: "Green Button" => "GreenButton"
func (Name) PascalCase ΒΆ
type NextApp ΒΆ
type Object ΒΆ
type PhoneNumber ΒΆ
type PhoneNumber string
func (PhoneNumber) Validate ΒΆ
func (phone PhoneNumber) Validate() error
type PingServer ΒΆ
type PingServer struct {
Msg string
}
func (*PingServer) ServeHTTP ΒΆ
func (s *PingServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
type PostgresDB ΒΆ
func (*PostgresDB) Open ΒΆ
func (pg *PostgresDB) Open() *sql.DB
type ProgrammingLanguage ΒΆ
type Prompt ΒΆ
type Prompt struct {
Name Name
Desc string
Options []PromptOption
}
type PromptOption ΒΆ
type ReactComponent ΒΆ
func (*ReactComponent) Write ΒΆ
func (rc *ReactComponent) Write(path string) error
type ReactElement ΒΆ
type ReactElement struct {
Type string
Props []struct {
Key string
Value any
}
Children []ReactElement
}
func (*ReactElement) WriteNextJSPage ΒΆ
func (el *ReactElement) WriteNextJSPage(w io.Writer) error
type RemoteFileSystem ΒΆ
type RemoteFileSystem struct {
Root string
}
func (*RemoteFileSystem) IsDir ΒΆ
func (fs *RemoteFileSystem) IsDir(path string) bool
func (*RemoteFileSystem) IsFile ΒΆ
func (fs *RemoteFileSystem) IsFile(path string) bool
func (*RemoteFileSystem) MakeDir ΒΆ
func (fs *RemoteFileSystem) MakeDir(path string) error
func (*RemoteFileSystem) ReadDir ΒΆ
func (fs *RemoteFileSystem) ReadDir(path string) ([]string, error)
func (*RemoteFileSystem) ReadFile ΒΆ
func (fs *RemoteFileSystem) ReadFile(path string) ([]byte, error)
func (*RemoteFileSystem) Remove ΒΆ
func (fs *RemoteFileSystem) Remove(path string) error
type Request ΒΆ
func NewRequest ΒΆ
type Route ΒΆ
type Route struct {
GetRoot http.HandlerFunc
PostRoot http.HandlerFunc
GetID func(id string, w http.ResponseWriter, r *http.Request)
PostID func(id string, w http.ResponseWriter, r *http.Request)
PutID func(id string, w http.ResponseWriter, r *http.Request)
PatchID func(id string, w http.ResponseWriter, r *http.Request)
DeleteID func(id string, w http.ResponseWriter, r *http.Request)
}
type Router ΒΆ
type Router struct {
Root func(w http.ResponseWriter, r *http.Request)
Next func(first string, w http.ResponseWriter, r *http.Request)
}
type SHA256Server ΒΆ
func (*SHA256Server) ServeHTTP ΒΆ
func (s *SHA256Server) ServeHTTP(w http.ResponseWriter, r *http.Request)
type ScalarType ΒΆ
type ScalarType struct {
Name Name `json:"name"`
Description string `json:"description"`
ElemType string `json:"elemType"`
Methods map[string]*Function `json:"methods"`
DefaultJSON string `json:"defaultJSON"`
}
func (*ScalarType) WriteGoFile ΒΆ
func (st *ScalarType) WriteGoFile(path string) error
func (*ScalarType) WriteTypeScriptFile ΒΆ
func (st *ScalarType) WriteTypeScriptFile(path string) error
type SchemaCafe ΒΆ
func (*SchemaCafe) ServeHTTP ΒΆ
func (sc *SchemaCafe) ServeHTTP(w http.ResponseWriter, r *http.Request)
type Service ΒΆ
type SimpleForm ΒΆ
type SimpleForm struct {
TitleText string
Fields []Field
SubmitText string
Error error
HandlePOST http.HandlerFunc
}
func (*SimpleForm) ServeHTTP ΒΆ
func (form *SimpleForm) ServeHTTP(w http.ResponseWriter, r *http.Request)
type SinglePageApp ΒΆ
type SinglePageApp struct {
// contains filtered or unexported fields
}
func (*SinglePageApp) ServeHTTP ΒΆ
func (spa *SinglePageApp) ServeHTTP(w http.ResponseWriter, r *http.Request)
type SingleUserApp ΒΆ
type SingleUserApp struct {
Twilio *TwilioClient
UserPhone string
Files FileSystem
Handler http.Handler
}
func (*SingleUserApp) AuthFiles ΒΆ
func (a *SingleUserApp) AuthFiles() FileSystem
func (*SingleUserApp) AuthHandler ΒΆ
func (a *SingleUserApp) AuthHandler() *SingleUserAuthHandler
func (*SingleUserApp) Authorized ΒΆ
func (a *SingleUserApp) Authorized(r *http.Request) (bool, error)
func (*SingleUserApp) GetSession ΒΆ
func (a *SingleUserApp) GetSession(token string) (*Session, error)
func (*SingleUserApp) ServeHTTP ΒΆ
func (app *SingleUserApp) ServeHTTP(w http.ResponseWriter, r *http.Request)
type SingleUserAuthHandler ΒΆ
type SingleUserAuthHandler struct {
UserPhone string
AuthFiles FileSystem
Twilio *TwilioClient
}
func (*SingleUserAuthHandler) Login ΒΆ
func (a *SingleUserAuthHandler) Login(phone, code string) (*Session, error)
func (*SingleUserAuthHandler) SendLoginCode ΒΆ
func (a *SingleUserAuthHandler) SendLoginCode(phone string) error
func (*SingleUserAuthHandler) ServeHTTP ΒΆ
func (a *SingleUserAuthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type Statement ΒΆ
type Statement struct {
IsReturn bool `json:"isReturn"`
Return *Expression `json:"return"`
IsAssign bool `json:"isAssign"`
Name string `json:"name"`
Value *Expression `json:"value"`
IsIf bool `json:"isIf"`
Condition *Expression `json:"condition"`
Body []*Statement `json:"body"`
}
Statement represents a line of code in a function or method body. There are 4 types of statements: returns, assignments, ifs and loops. Ifs and loops have substatements.
type StreamBroadcaster ΒΆ
type StreamBroadcaster struct {
ContentType string
StartFunc func() (io.ReadCloser, error)
// contains filtered or unexported fields
}
func NewStreamBroadcaster ΒΆ
func NewStreamBroadcaster(contentType string, startFunc func() (io.ReadCloser, error)) *StreamBroadcaster
func (*StreamBroadcaster) ServeHTTP ΒΆ
func (sb *StreamBroadcaster) ServeHTTP(w http.ResponseWriter, r *http.Request)
type StreamMultiplexer ΒΆ
type StreamMultiplexer struct {
// contains filtered or unexported fields
}
func NewStreamMultiplexer ΒΆ
func NewStreamMultiplexer(contentType string, backendURL string) *StreamMultiplexer
func (*StreamMultiplexer) ServeHTTP ΒΆ
func (m *StreamMultiplexer) ServeHTTP(w http.ResponseWriter, r *http.Request)
type StructType ΒΆ
type StructType struct {
Name Name `json:"name"`
Description string `json:"description"`
Fields []Field `json:"fields"`
Methods map[string]*Function `json:"methods"`
DefaultJSON string `json:"default_json"`
}
func (*StructType) WriteGoFile ΒΆ
func (t *StructType) WriteGoFile(path, pkgName string) error
func (*StructType) WriteTypeScriptFile ΒΆ
func (t *StructType) WriteTypeScriptFile(path string) error
type SystemdService ΒΆ
type SystemdService struct {
Name string
Desc string
After string
Type string
Env []Pair[string, string]
ExecStart string
AutoRestart string
WantedBy string
}
func (*SystemdService) Restart ΒΆ
func (s *SystemdService) Restart() error
func (*SystemdService) WriteConfig ΒΆ
func (s *SystemdService) WriteConfig(w io.Writer) error
func (*SystemdService) WriteConfigToFile ΒΆ
func (s *SystemdService) WriteConfigToFile() error
type Table ΒΆ
type TableConstraint ΒΆ
type TemplateServer ΒΆ
func NewTemplateServer ΒΆ
func NewTemplateServer[DataType any](tmpl *template.Template, workdir, userID string) *TemplateServer[DataType]
func (*TemplateServer[T]) ServeHTTP ΒΆ
func (s *TemplateServer[T]) ServeHTTP(w http.ResponseWriter, r *http.Request)
type TwilioClient ΒΆ
func (*TwilioClient) SendSMS ΒΆ
func (c *TwilioClient) SendSMS(to, message string) error
type Type ΒΆ
type Type struct {
Description string `json:"description"`
IsScalar bool `json:"isScalar"`
Scalar *Ref `json:"scalar"`
IsArray bool `json:"isArray"`
IsMap bool `json:"isMap"`
ElemType *Type `json:"elemType"`
IsStruct bool `json:"isStruct"`
Fields []Field `json:"fields"`
Methods map[string]*Function `json:"methods"`
DefaultJSON string `json:"defaultJSON"`
LocalInstanceName string `json:"localInstanceName"`
}
type Value ΒΆ
type Value struct {
Description string `json:"description"`
Type *Type `json:"type"`
JSON string `json:"json"`
}
func (*Value) WriteGoConstFile ΒΆ
func (*Value) WriteGoVarFile ΒΆ
func (*Value) WriteReactHookFile ΒΆ
func (*Value) WriteTypeScriptConstantFile ΒΆ
type WebAPI ΒΆ
type WebAPI struct {
Types map[string]Type
RootType string
Data FileSystem
}
The WebAPI type represents an WebAPI backed by any JSON-serializable Go object.
func (*WebAPI) ServeHTTP ΒΆ
func (api *WebAPI) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP serves a generic REST API.
func (*WebAPI) ServeNotFound ΒΆ
func (api *WebAPI) ServeNotFound(w http.ResponseWriter, r *http.Request)
type WebpageMetadata ΒΆ
Source Files
ΒΆ
- accept.go
- account.go
- action.go
- add_to_known_hosts.go
- api.go
- app.go
- app_config.go
- app_server.go
- append_using_reflect.go
- array.go
- array_type.go
- auth_method.go
- authenticate_tailscale.go
- backend.go
- backup_dir.go
- bit.go
- bool.go
- build_config.go
- build_server.go
- cafe.go
- call_method.go
- ci.go
- client_ip.go
- cmd_server.go
- cmdline_server.go
- collection.go
- compress_dir.go
- content_type.go
- cookie.go
- copy_dir.go
- copy_file.go
- copy_file_from_remote.go
- copy_file_to_remote.go
- create_file.go
- create_p.go
- db.go
- decrypt_and_decompress_dir.go
- delete_cookie.go
- dev_server.go
- digits.go
- download.go
- download_dir.go
- drill.go
- email.go
- encrypt_and_compress_dir.go
- endpoint.go
- env_var.go
- error.go
- error_http.go
- exec_remote.go
- exists.go
- expression.go
- fancy_route.go
- field.go
- field_value.go
- file.go
- file_object.go
- file_server.go
- file_store.go
- file_system.go
- filter_string.go
- filter_test_files.go
- flatten.go
- folder.go
- form.go
- fprint_json.go
- frequency_to_rgb.go
- function.go
- get_addr.go
- get_installed_go_version.go
- get_latest_go_version.go
- get_name.go
- get_osid.go
- get_password_from_stdin.go
- git_repo.go
- github_mirror.go
- github_repository.go
- github_webhook.go
- github_webhook_request.go
- go_builder.go
- go_codebase.go
- go_decl.go
- go_file.go
- go_package.go
- go_workspace.go
- handle_cors.go
- handle_put.go
- has_method.go
- hash_cache.go
- hcloud_file_system.go
- home_dir.go
- html_document.go
- html_head.go
- html_reader.go
- html_template.go
- html_template_data.go
- import_map.go
- install_go.go
- install_node.go
- install_tailscale.go
- int.go
- int_to_id.go
- is_alpha_numeric.go
- is_array.go
- is_bool.go
- is_dir.go
- is_int.go
- is_loopback_ip.go
- is_map.go
- is_mutation.go
- is_private_ip.go
- is_public_ip.go
- is_root_request.go
- is_stdlib.go
- is_string.go
- is_struct.go
- is_ten_digits.go
- join_path.go
- json_file_server.go
- json_string.go
- kebab_case.go
- kind.go
- latest_go_version.go
- letters.go
- link.go
- link_list.go
- list.go
- list_item.go
- listen_and_serve.go
- live_object.go
- local_file_system.go
- main.go
- map.go
- map_keys.go
- map_list.go
- map_type.go
- metadata.go
- method_call.go
- mime_type.go
- movie.go
- multi_host_server.go
- multi_user_auth_handler.go
- must.go
- name.go
- new_object.go
- next_app.go
- next_page.go
- nil.go
- normalize_go_name.go
- normalize_phone_number.go
- object.go
- on_file_change.go
- only_lower_case.go
- only_one.go
- optionally_serve_http.go
- org.go
- os.go
- package_manager.go
- pair.go
- parse_json.go
- parse_path.go
- pascal_case.go
- password_protected.go
- person.go
- personal.go
- phone_number.go
- ping_server.go
- pop.go
- pop_path.go
- port.go
- post.go
- postgres_db.go
- print_json.go
- print_response.go
- programming_language.go
- prompt.go
- quadruple_time.go
- random_bits.go
- random_bytes.go
- random_code.go
- random_digit.go
- random_element.go
- random_id.go
- random_string.go
- random_token.go
- react_component.go
- react_element.go
- react_hook.go
- read_dir.go
- read_go_package_from_disk.go
- read_json.go
- read_json_file.go
- read_json_fs.go
- read_remote_file.go
- ref.go
- reload_systemd.go
- remote_file_system.go
- render_template_to_file.go
- request.go
- require_env_var.go
- response.go
- restore_dir.go
- reverse_proxy.go
- route.go
- router.go
- run.go
- run_in_parallel.go
- run_ssh_with_known_hosts_check.go
- scalar_type.go
- schema.go
- schema_cafe.go
- secure_password.go
- sender.go
- serialize.go
- serve.go
- serve_all.go
- serve_any.go
- serve_bool.go
- serve_error.go
- serve_https.go
- serve_method.go
- serve_mux.go
- serve_my_ip.go
- serve_object.go
- service.go
- session.go
- set.go
- set_field.go
- sha256.go
- sha256_server.go
- sheets_db.go
- simple_form.go
- single_page_app.go
- single_user_app.go
- single_user_auth_handler.go
- snake_case.go
- ssh_client_config.go
- start_server.go
- statement.go
- stream_broadcaster.go
- stream_multiplexer.go
- string.go
- strip_non_alpha_numeric.go
- struct.go
- struct_to_map.go
- struct_type.go
- sub_fs.go
- sync.go
- systemd_service.go
- table.go
- table_constraint.go
- template_server.go
- title_case.go
- touch.go
- tv_episode.go
- tv_season.go
- tv_show.go
- twilio_client.go
- type.go
- unix_nano_timestamp.go
- unix_timestamp.go
- upload_dir.go
- user.go
- user_pass_server.go
- valid_rel_path.go
- value.go
- video.go
- wait_until.go
- watch.go
- wavelength_to_rgb.go
- web_api.go
- webpage_metadata.go
- word.go
- write_encrypted.go
- write_file.go
- write_json.go
- write_json_file.go
- write_json_fs.go
- write_method_not_allowed.go
- write_not_found.go
- write_temp_file.go
- xml.go
- xml_string.go