file_path stringlengths 3 280 | file_language stringclasses 66
values | content stringlengths 1 1.04M | repo_name stringlengths 5 92 | repo_stars int64 0 154k | repo_description stringlengths 0 402 | repo_primary_language stringclasses 108
values | developer_username stringlengths 1 25 | developer_name stringlengths 0 30 | developer_company stringlengths 0 82 |
|---|---|---|---|---|---|---|---|---|---|
pkg/dynamic/pack/osargs/osargs.go | Go | package osargs
import "os"
var overridden []string
func OSArgs() []string {
if overridden != nil {
return overridden
}
return os.Args
}
func SetOSArgs(override []string) {
overridden = override
}
| AkihiroSuda/gomodjail | 132 | [Experimental] jail for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/dynamic/pack/ziputil/ziputil.go | Go | package ziputil
import (
"archive/zip"
"errors"
"fmt"
"io"
"io/fs"
"log/slog"
"math"
"os"
"path/filepath"
"golang.org/x/sys/unix"
)
// SelfExtractArchiveComment is the comment present in the End Of Central Directory Record.
const SelfExtractArchiveComment = "gomodjail-self-extract-archive"
func WriteFileW... | AkihiroSuda/gomodjail | 132 | [Experimental] jail for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/dynamic/parent/parent.go | Go | package parent
import (
"io"
"github.com/AkihiroSuda/gomodjail/pkg/dynamic/tracer"
"github.com/AkihiroSuda/gomodjail/pkg/profile"
)
func Main(profile *profile.Profile, args []string) error {
cmd, err := createCmd(args)
if err != nil {
return err
}
tr, err := tracer.New(cmd, profile)
if err != nil {
retur... | AkihiroSuda/gomodjail | 132 | [Experimental] jail for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/dynamic/parent/parent_darwin.go | Go | package parent
import (
"os"
"os/exec"
)
func createCmd(args []string) (*exec.Cmd, error) {
cmd := exec.Command(args[0], args[1:]...)
cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
return cmd, nil
}
| AkihiroSuda/gomodjail | 132 | [Experimental] jail for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/dynamic/parent/parent_linux.go | Go | package parent
import (
"os"
"os/exec"
"github.com/AkihiroSuda/gomodjail/pkg/dynamic/env"
"github.com/AkihiroSuda/gomodjail/pkg/dynamic/pack/osargs"
)
func createCmd(_ []string) (*exec.Cmd, error) {
self, err := os.Executable()
if err != nil {
return nil, err
}
// osargs.OSArgs is basically os.Args but is ... | AkihiroSuda/gomodjail | 132 | [Experimental] jail for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/dynamic/procutil/procutil_linux.go | Go | package procutil
import (
"encoding/binary"
"fmt"
"strings"
"golang.org/x/sys/unix"
)
func ReadUint64(pid int, addr uintptr) (uint64, error) {
buf := make([]byte, 8)
if _, err := unix.PtracePeekData(pid, addr, buf); err != nil {
return 0, fmt.Errorf("failed to read 0x%x (%d bytes) from PID %d", addr, len(buf... | AkihiroSuda/gomodjail | 132 | [Experimental] jail for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/dynamic/tracer/regs/regs_linux.go | Go | package regs
import "golang.org/x/sys/unix"
type Regs struct {
unix.PtraceRegs
Modified bool
}
| AkihiroSuda/gomodjail | 132 | [Experimental] jail for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/dynamic/tracer/regs/regs_linux_amd64.go | Go | package regs
func (regs *Regs) Syscall() uint64 {
return regs.Orig_rax
}
func (regs *Regs) Args() []uint64 {
return []uint64{regs.Rdi, regs.Rsi, regs.Rdx, regs.R10, regs.R8, regs.R9}
}
func (regs *Regs) SetSyscall(v uint64) {
regs.Orig_rax = v
regs.Modified = true
}
func (regs *Regs) SetRet(v uint64) {
regs.Ra... | AkihiroSuda/gomodjail | 132 | [Experimental] jail for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/dynamic/tracer/regs/regs_linux_arm64.go | Go | package regs
func (regs *Regs) Syscall() uint64 {
return regs.Regs[8]
}
func (regs *Regs) Args() []uint64 {
return regs.Regs[0:5]
}
func (regs *Regs) SetSyscall(v uint64) {
regs.Regs[8] = v
regs.Modified = true
}
func (regs *Regs) SetRet(v uint64) {
regs.Regs[0] = v
regs.Modified = true
}
func (regs *Regs) F... | AkihiroSuda/gomodjail | 132 | [Experimental] jail for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/dynamic/tracer/tracer.go | Go | package tracer
import "fmt"
type Tracer interface {
// Trace traces the process.
// Trace may return [ExitError].
Trace() error
}
type ExitError struct {
ExitCode int
}
func (e *ExitError) Error() string {
return fmt.Sprintf("exit code %d", e.ExitCode)
}
| AkihiroSuda/gomodjail | 132 | [Experimental] jail for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/dynamic/tracer/tracer_darwin.go | Go | package tracer
import (
"debug/gosym"
"encoding/binary"
"encoding/json"
"errors"
"fmt"
"log/slog"
"net"
"os"
"os/exec"
"path/filepath"
"runtime"
"sync"
"github.com/AkihiroSuda/gomodjail/pkg/dynamic/unwinder"
"github.com/AkihiroSuda/gomodjail/pkg/profile"
)
func LibgomodjailHook() (string, error) {
hoo... | AkihiroSuda/gomodjail | 132 | [Experimental] jail for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/dynamic/tracer/tracer_linux.go | Go | // Package tracer was forked from
// https://github.com/AkihiroSuda/lsf/blob/ff4e43f59c5dc1a93c2b0e81b741bbc439c211da/pkg/tracer/tracer_linux.go
package tracer
import (
"errors"
"fmt"
"log/slog"
"os"
"os/exec"
"runtime"
"github.com/AkihiroSuda/gomodjail/pkg/dynamic/procutil"
"github.com/AkihiroSuda/gomodjail/... | AkihiroSuda/gomodjail | 132 | [Experimental] jail for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/dynamic/unwinder/unwinder.go | Go | // Package unwider provides unwinder for Go call stacks.
//
// https://www.grant.pizza/blog/go-stack-traces-bpf/
package unwinder
import (
"debug/buildinfo"
"debug/gosym"
"fmt"
"io"
"log/slog"
)
type Unwinder interface {
Symtab() *gosym.Table
BuildInfo() *buildinfo.BuildInfo
Unwind(pid int, pc, bp uintptr) ([... | AkihiroSuda/gomodjail | 132 | [Experimental] jail for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/dynamic/unwinder/unwinder_amd64.go | Go | package unwinder
const wordSize = 8
| AkihiroSuda/gomodjail | 132 | [Experimental] jail for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/dynamic/unwinder/unwinder_arm64.go | Go | package unwinder
const wordSize = 8
| AkihiroSuda/gomodjail | 132 | [Experimental] jail for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/dynamic/unwinder/unwinder_darwin.go | Go | // Package unwider provides unwinder for Go call stacks.
//
// https://www.grant.pizza/blog/go-stack-traces-bpf/
package unwinder
import (
"debug/macho"
"errors"
)
const (
gopclntabSectionName = "__gopclntab"
textSectionName = "__text"
gosymtabSectionName = "__gosymtab"
)
type machoObjectFile struct {
*m... | AkihiroSuda/gomodjail | 132 | [Experimental] jail for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/dynamic/unwinder/unwinder_linux.go | Go | // Package unwider provides unwinder for Go call stacks.
//
// https://www.grant.pizza/blog/go-stack-traces-bpf/
package unwinder
import (
"debug/elf"
"github.com/AkihiroSuda/gomodjail/pkg/dynamic/procutil"
)
const (
gopclntabSectionName = ".gopclntab"
textSectionName = ".text"
gosymtabSectionName = ".gos... | AkihiroSuda/gomodjail | 132 | [Experimental] jail for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/envutil/envutil.go | Go | // Package envutil is from https://github.com/reproducible-containers/repro-get/blob/v0.4.0/pkg/envutil/envutil.go
package envutil
import (
"fmt"
"os"
"strconv"
"log/slog"
)
func Bool(envName string, defaultValue bool) bool {
v, ok := os.LookupEnv(envName)
if !ok {
return defaultValue
}
b, err := strconv.P... | AkihiroSuda/gomodjail | 132 | [Experimental] jail for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/profile/fromgomod/fromgomod.go | Go | package fromgomod
import (
"fmt"
"log/slog"
"slices"
"github.com/AkihiroSuda/gomoddirectivecomments"
"golang.org/x/mod/modfile"
"github.com/AkihiroSuda/gomodjail/pkg/profile"
)
func FromGoMod(mod *modfile.File, prof *profile.Profile) error {
prof.Module = mod.Module.Mod.Path
var err error
parsedPolicies, e... | AkihiroSuda/gomodjail | 132 | [Experimental] jail for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/profile/fromgomod/fromgomod_test.go | Go | package fromgomod
import (
"testing"
"github.com/AkihiroSuda/gomodjail/pkg/profile"
"golang.org/x/mod/modfile"
"gotest.tools/v3/assert"
)
func TestFromGoMod(t *testing.T) {
type testCase struct {
name string
goMod string
expected map[string]profile.Policy
}
testCases := []testCase{
{
name: "... | AkihiroSuda/gomodjail | 132 | [Experimental] jail for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/profile/profile.go | Go | package profile
import (
"fmt"
"log/slog"
"slices"
"strings"
"sync"
)
type Policy = string
const (
PolicyUnconfined = "unconfined"
PolicyConfined = "confined"
)
var KnownPolicies = []Policy{
PolicyUnconfined,
PolicyConfined,
}
func New() *Profile {
return &Profile{
Modules: make(map[st... | AkihiroSuda/gomodjail | 132 | [Experimental] jail for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/profile/profile_test.go | Go | package profile
import (
"testing"
"gotest.tools/v3/assert"
)
func TestProfile(t *testing.T) {
prof := New()
const mainMod = "example.com/blah/v2"
prof.Module = mainMod
prof.Modules["example.com/foo"] = PolicyConfined
prof.Modules["example.com/foobaz"] = PolicyConfined
assert.NilError(t, prof.Validate())
as... | AkihiroSuda/gomodjail | 132 | [Experimental] jail for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/static/analyzer/analyzer.go | Go | package analyzer
import (
"context"
"flag"
"go/ast"
"log/slog"
"path/filepath"
"strconv"
"strings"
"golang.org/x/tools/go/analysis"
)
type Opts struct {
Flags flag.FlagSet
}
func New(ctx context.Context, opts Opts) (*analysis.Analyzer, error) {
a := &analysis.Analyzer{
Name: "gomodjail",
D... | AkihiroSuda/gomodjail | 132 | [Experimental] jail for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
cmd/gosocialcheck/commands/lookup/lookup.go | Go | package lookup
import (
"encoding/json"
"github.com/spf13/cobra"
"github.com/AkihiroSuda/gosocialcheck/pkg/cache"
)
func New() *cobra.Command {
cmd := &cobra.Command{
Use: "lookup",
Short: "[DEBUG] Lookup the database by h1 sum",
Args: cobra.ExactArgs(1),... | AkihiroSuda/gosocialcheck | 24 | social reputation checker for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
cmd/gosocialcheck/commands/run/run.go | Go | package run
import (
"os"
"github.com/spf13/cobra"
"golang.org/x/tools/go/analysis/singlechecker"
"github.com/AkihiroSuda/gosocialcheck/cmd/gosocialcheck/flagutil"
"github.com/AkihiroSuda/gosocialcheck/pkg/analyzer"
"github.com/AkihiroSuda/gosocialcheck/pkg/cache"
)
func New() *cobra.Command {
cmd := &cobra.... | AkihiroSuda/gosocialcheck | 24 | social reputation checker for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
cmd/gosocialcheck/commands/update/update.go | Go | package update
import (
"context"
"log/slog"
"github.com/spf13/cobra"
"github.com/AkihiroSuda/gosocialcheck/pkg/cache"
)
func New() *cobra.Command {
cmd := &cobra.Command{
Use: "update",
Short: "Update the database",
Args: cobra.NoArgs,
RunE: ... | AkihiroSuda/gosocialcheck | 24 | social reputation checker for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
cmd/gosocialcheck/envutil/envutil.go | Go | // Package envutil is from https://github.com/reproducible-containers/repro-get/blob/v0.4.0/pkg/envutil/envutil.go
package envutil
import (
"fmt"
"os"
"strconv"
"log/slog"
)
func Bool(envName string, defaultValue bool) bool {
v, ok := os.LookupEnv(envName)
if !ok {
return defaultValue
}
b, err := strconv.P... | AkihiroSuda/gosocialcheck | 24 | social reputation checker for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
cmd/gosocialcheck/flagutil/flagutil.go | Go | package flagutil
import (
"flag"
"slices"
"github.com/spf13/pflag"
)
func PFlagSetToGoFlagSet(pf *pflag.FlagSet, excludes []string) *flag.FlagSet {
fs := flag.NewFlagSet(pf.Name(), flag.ContinueOnError)
pf.VisitAll(func(f *pflag.Flag) {
if slices.Contains(excludes, f.Name) {
return
}
fs.Var(f.Value, f.... | AkihiroSuda/gosocialcheck | 24 | social reputation checker for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
cmd/gosocialcheck/main.go | Go | package main
import (
"log/slog"
"os"
"time"
"github.com/lmittmann/tint"
"github.com/spf13/cobra"
"github.com/AkihiroSuda/gosocialcheck/cmd/gosocialcheck/commands/lookup"
"github.com/AkihiroSuda/gosocialcheck/cmd/gosocialcheck/commands/run"
"github.com/AkihiroSuda/gosocialcheck/cmd/gosocialcheck/commands/upd... | AkihiroSuda/gosocialcheck | 24 | social reputation checker for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
cmd/gosocialcheck/version/version.go | Go | package version
import (
"runtime/debug"
"strconv"
)
// Version can be fulfilled on compilation time: -ldflags="-X github.com/AkihiroSuda/gosocialcheck/cmd/gosocialcheck/version.Version=v0.1.2"
var Version string
func GetVersion() string {
if Version != "" {
return Version
}
const unknown = "(unknown)"
bi, o... | AkihiroSuda/gosocialcheck | 24 | social reputation checker for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/analyzer/analyzer.go | Go | package analyzer
import (
"bufio"
"bytes"
"context"
"errors"
"flag"
"fmt"
"io"
"log/slog"
"os"
"path/filepath"
"strconv"
"strings"
"sync"
gomoddirectivecomments "github.com/AkihiroSuda/gomoddirectivecomments"
"golang.org/x/mod/modfile"
"golang.org/x/mod/module"
"golang.org/x/tools/go/analysis"
"git... | AkihiroSuda/gosocialcheck | 24 | social reputation checker for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/analyzer/analyzer_test.go | Go | package analyzer
import (
"testing"
"golang.org/x/mod/modfile"
"golang.org/x/mod/module"
"gotest.tools/v3/assert"
)
func TestModuleVersion(t *testing.T) {
tests := []struct {
name string
goMod string
imp string
expected *module.Version
}{
{
name: "simple require",
goMod: `module exa... | AkihiroSuda/gosocialcheck | 24 | social reputation checker for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/cache/cache.go | Go | // Package cache manages the cache.
/*
TODO: consider switching to bbolt
~/.cache: the cache home ($XDG_CACHE_HOME)
gosocialcheck: the ModTime represents the last updated time
github.com
containerd
containerd
fb4c30d4ede3531652d86197bf3fc9515e5276d9
gosocialcheck-cache.json
... | AkihiroSuda/gosocialcheck | 24 | social reputation checker for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/categories/categories.go | Go | package categories
const (
CNCFGraduated = "cncf.io::graduated"
CNCFGraduatedSub = "cncf.io::graduated::sub"
)
| AkihiroSuda/gosocialcheck | 24 | social reputation checker for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/modpath/modpath.go | Go | package modpath
import (
"errors"
"fmt"
"log/slog"
"path/filepath"
"regexp"
"strings"
"sync"
"golang.org/x/tools/go/analysis"
)
func DirFromFileAndMod(filePath, mod, modVer string) (string, error) {
modPath := StripMajorVersion(mod)
modOSPath := filepath.FromSlash(modPath)
idx := strings.Index(filePath, m... | AkihiroSuda/gosocialcheck | 24 | social reputation checker for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/modpath/modpath_test.go | Go | package modpath
import (
"strings"
"testing"
"gotest.tools/v3/assert"
)
func TestDirFromFileAndPkg(t *testing.T) {
tests := []struct {
name string
file string
Mod string
modVer string
want string
wantErr bool
}{
{
name: "Without version suffix",
file: "/Users/me/gopath/src/... | AkihiroSuda/gosocialcheck | 24 | social reputation checker for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/netutil/github/github.go | Go | package github
import (
"context"
"encoding/json"
"fmt"
"path"
"regexp"
"github.com/AkihiroSuda/gosocialcheck/pkg/netutil"
)
func NewRepo(urlStr string) (*Repo, error) {
pattern := regexp.MustCompile(`^https?://(?:www\.)?github\.com/([^/]+)/([^/]+?)(?:\.git)?(?:/.*)?$`)
matches := pattern.FindStringSubmatch(... | AkihiroSuda/gosocialcheck | 24 | social reputation checker for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/netutil/github/github_test.go | Go | package github
import (
"context"
"testing"
"gotest.tools/v3/assert"
)
func TestNewRepo(t *testing.T) {
cases := []struct {
url string
expected *Repo
}{
{"https://github.com/containerd/nerdctl", &Repo{Owner: "containerd", Repo: "nerdctl"}},
{"http://www.github.com/containerd/nerdctl.git", &Repo{Own... | AkihiroSuda/gosocialcheck | 24 | social reputation checker for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/netutil/netutil.go | Go | package netutil
import (
"context"
"fmt"
"io"
"net/http"
"net/url"
"os"
"strings"
)
type httpOpts struct {
client *http.Client
maxBytes int64
bearerToken string
}
type HTTPOpt func(opts *httpOpts, urlStr string) error
func WithHTTPClient(client *http.Client) HTTPOpt {
return func(opts *httpOpts, ... | AkihiroSuda/gosocialcheck | 24 | social reputation checker for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/source/cncf/cncf.go | Go | package cncf
const ProjectsURL = "https://raw.githubusercontent.com/cncf/clomonitor/refs/heads/main/data/cncf.yaml"
type Projects []Project
type Project struct {
Name string `yaml:"name,omitempty"`
DisplayName string `yaml:"display_name,omitempty"`
Description string `yaml:"description... | AkihiroSuda/gosocialcheck | 24 | social reputation checker for Go modules | Go | AkihiroSuda | Akihiro Suda | NTT |
cmd/vexllm/commands/generate/generate.go | Go | package generate
import (
"encoding/json"
"fmt"
"log/slog"
"os"
"strings"
"github.com/AkihiroSuda/vexllm/pkg/generator"
"github.com/AkihiroSuda/vexllm/pkg/llm"
"github.com/AkihiroSuda/vexllm/pkg/llm/llmfactory" // FIXME: dependency monster
"github.com/AkihiroSuda/vexllm/pkg/outputhandler"
"github.com/Akihir... | AkihiroSuda/vexllm | 65 | silence negligible CVE alerts using LLM | Go | AkihiroSuda | Akihiro Suda | NTT |
cmd/vexllm/main.go | Go | package main
import (
"log/slog"
"os"
"github.com/AkihiroSuda/vexllm/cmd/vexllm/commands/generate"
"github.com/AkihiroSuda/vexllm/cmd/vexllm/version"
"github.com/AkihiroSuda/vexllm/pkg/envutil"
"github.com/spf13/cobra"
)
var logLevel = new(slog.LevelVar)
func main() {
logHandler := slog.NewTextHandler(os.Std... | AkihiroSuda/vexllm | 65 | silence negligible CVE alerts using LLM | Go | AkihiroSuda | Akihiro Suda | NTT |
cmd/vexllm/version/version.go | Go | package version
import (
"runtime/debug"
"strconv"
)
// Version can be fulfilled on compilation time: -ldflags="-X github.com/AkihiroSuda/vexllm/cmd/vexllm/version.Version=v0.1.2"
var Version string
func GetVersion() string {
if Version != "" {
return Version
}
const unknown = "(unknown)"
bi, ok := debug.Rea... | AkihiroSuda/vexllm | 65 | silence negligible CVE alerts using LLM | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/envutil/envutil.go | Go | // From https://github.com/reproducible-containers/repro-get/blob/v0.4.0/pkg/envutil/envutil.go
package envutil
import (
"fmt"
"os"
"strconv"
"log/slog"
)
func Bool(envName string, defaultValue bool) bool {
v, ok := os.LookupEnv(envName)
if !ok {
return defaultValue
}
b, err := strconv.ParseBool(v)
if er... | AkihiroSuda/vexllm | 65 | silence negligible CVE alerts using LLM | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/generator/generator.go | Go | package generator
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"log/slog"
"os"
"path/filepath"
"time"
"github.com/AkihiroSuda/vexllm/pkg/llm"
"github.com/openvex/go-vex/pkg/vex"
"github.com/tmc/langchaingo/jsonschema"
"github.com/tmc/langchaingo/llms"
)
const (
DefaultBatchSize = 10... | AkihiroSuda/vexllm | 65 | silence negligible CVE alerts using LLM | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/llm/llm.go | Go | package llm
import (
"strings"
)
const (
Auto = "auto"
OpenAI = "openai"
Ollama = "ollama"
Anthropic = "anthropic"
GoogleAI = "googleai"
)
var Names = []string{
Auto, OpenAI, Ollama, Anthropic, GoogleAI,
}
func IsRateLimit(err error) bool {
if err == nil {
return false
}
errS := err.Error()
... | AkihiroSuda/vexllm | 65 | silence negligible CVE alerts using LLM | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/llm/llmfactory/llmfactory.go | Go | package llmfactory
import (
"context"
"fmt"
"log/slog"
"os"
"github.com/AkihiroSuda/vexllm/pkg/llm"
"github.com/tmc/langchaingo/llms"
"github.com/tmc/langchaingo/llms/anthropic"
"github.com/tmc/langchaingo/llms/googleai"
"github.com/tmc/langchaingo/llms/ollama"
"github.com/tmc/langchaingo/llms/openai"
)
//... | AkihiroSuda/vexllm | 65 | silence negligible CVE alerts using LLM | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/outputhandler/openvex.go | Go | package outputhandler
import (
"io"
"github.com/openvex/go-vex/pkg/vex"
)
type openvexOutputHandler struct {
w io.WriteCloser
stmts []vex.Statement
closed bool
}
func NewOpenvexOutputHandler(w io.WriteCloser) OutputHandler {
return &openvexOutputHandler{w: w}
}
func (h *openvexOutputHandler) HandleStat... | AkihiroSuda/vexllm | 65 | silence negligible CVE alerts using LLM | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/outputhandler/outputhandler.go | Go | package outputhandler
import (
"github.com/openvex/go-vex/pkg/vex"
)
type OutputHandler interface {
HandleStatements([]vex.Statement) error
Close() error
}
| AkihiroSuda/vexllm | 65 | silence negligible CVE alerts using LLM | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/outputhandler/trivyignore.go | Go | package outputhandler
import (
"encoding/json"
"fmt"
"io"
"github.com/openvex/go-vex/pkg/vex"
)
type trivyignoreOutputHandler struct {
w io.WriteCloser
}
func NewTrivyignoreOutputHandler(w io.WriteCloser) OutputHandler {
return &trivyignoreOutputHandler{w: w}
}
func (h *trivyignoreOutputHandler) HandleStatem... | AkihiroSuda/vexllm | 65 | silence negligible CVE alerts using LLM | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/trivypluginutil/trivypluginutil.go | Go | package trivypluginutil
import (
"log/slog"
"os"
"strings"
)
// IsTrivyPluginMode returns whether the binary is being executed as a trivy plugin mode.
// Not robust.
func IsTrivyPluginMode() bool {
exe, err := os.Executable()
if err != nil {
slog.Error("failed to call os.Executable()", "error", err)
return f... | AkihiroSuda/vexllm | 65 | silence negligible CVE alerts using LLM | Go | AkihiroSuda | Akihiro Suda | NTT |
pkg/trivytypes/trivytypes.go | Go | // Package trivytypes provides a subset of https://pkg.go.dev/github.com/aquasecurity/trivy@v0.53.0/pkg/types
package trivytypes
type Report struct {
SchemaVersion int `json:",omitempty"`
ArtifactName string `json:",omitempty"`
ArtifactType string `json:",omitempty"`
Results []Result `json:",omite... | AkihiroSuda/vexllm | 65 | silence negligible CVE alerts using LLM | Go | AkihiroSuda | Akihiro Suda | NTT |
eslint.config.js | JavaScript | import antfu from '@antfu/eslint-config'
const config = await antfu({
ignores: [
'**/generated',
'**/*.schema.json',
],
}, {
rules: {
curly: ['error', 'all'],
},
})
export default config
| Akryum/moquerie | 213 | Effortlessly mock your entire API with simple configuration and a beautiful UI - or create a fake REST API in seconds | TypeScript | Akryum | Guillaume Chau | |
playgrounds/playground/.moquerie/factories/Message/SimpleMessageFactory.ts | TypeScript | import { defineFactory } from 'moquerie/mocks'
export const version = '0.0.1'
export default defineFactory({
author: {
name: 'Guillaume Chau',
email: 'guillaume.b.chau@gmail.com',
avatar: 'https://avatars.githubusercontent.com/u/2798204?v=4',
github: {
login: 'Akryum',
profilePageUrl: '... | Akryum/moquerie | 213 | Effortlessly mock your entire API with simple configuration and a beautiful UI - or create a fake REST API in seconds | TypeScript | Akryum | Guillaume Chau | |
playgrounds/playground/.moquerie/types/queryManager.ts | TypeScript | import type { QueryManager } from 'moquerie'
import type {
Cat,
Dog,
Message,
Mutation,
MutationAPayload,
MutationBPayload,
MyObject,
MyObjectNotExported,
MyOtherObject,
OldObject,
Query,
Simple,
Subscription,
User,
} from './resources.js'
declare module 'moquerie' {
export interface Que... | Akryum/moquerie | 213 | Effortlessly mock your entire API with simple configuration and a beautiful UI - or create a fake REST API in seconds | TypeScript | Akryum | Guillaume Chau | |
playgrounds/playground/.moquerie/types/resources.ts | TypeScript | export interface Mutation {
addHello: string[]
addSimple: Simple
removeHello: string[]
testMutation: boolean
}
export interface Query {
currentUser: User
hello: string
manyHellos: string[]
manyHellosCount: number
}
export interface Subscription {
helloAdded: string
helloRemoved: string
simpleAdd... | Akryum/moquerie | 213 | Effortlessly mock your entire API with simple configuration and a beautiful UI - or create a fake REST API in seconds | TypeScript | Akryum | Guillaume Chau | |
playgrounds/playground/codegen.ts | TypeScript | import type { CodegenConfig } from '@graphql-codegen/cli'
const config: CodegenConfig = {
overwrite: true,
schema: 'src/schema.ts',
generates: {
'src/generated/graphql.ts': {
plugins: ['typescript', 'typescript-resolvers'],
config: {
enumsAsTypes: true,
},
},
'./graphql.sche... | Akryum/moquerie | 213 | Effortlessly mock your entire API with simple configuration and a beautiful UI - or create a fake REST API in seconds | TypeScript | Akryum | Guillaume Chau | |
playgrounds/playground/eslint.config.js | JavaScript | import antfu from '@antfu/eslint-config'
const config = await antfu({
ignores: [
'**/generated',
'**/*.schema.json',
],
}, {
rules: {
curly: ['error', 'all'],
},
})
export default config
| Akryum/moquerie | 213 | Effortlessly mock your entire API with simple configuration and a beautiful UI - or create a fake REST API in seconds | TypeScript | Akryum | Guillaume Chau | |
playgrounds/playground/moquerie.config.ts | TypeScript | import type { ESLint } from 'eslint'
import { resolve } from 'node:path'
import { defineConfig } from 'moquerie/config'
let eslint: ESLint
export default defineConfig({
graphql: {
schema: {
scanCodeFiles: './src/**/*.ts',
},
},
rest: {
typeFiles: [
'src/rest/types.ts',
],
},
ex... | Akryum/moquerie | 213 | Effortlessly mock your entire API with simple configuration and a beautiful UI - or create a fake REST API in seconds | TypeScript | Akryum | Guillaume Chau | |
playgrounds/playground/mq-api.ts | TypeScript | /* eslint-disable antfu/no-top-level-await */
/* eslint-disable no-console */
import process from 'node:process'
import { createInstanceFromFactory, createMoquerieInstance, getFactoryByName, runScript, startServer } from 'moquerie'
const mq = await createMoquerieInstance({
cwd: process.cwd(),
watching: true,
ski... | Akryum/moquerie | 213 | Effortlessly mock your entire API with simple configuration and a beautiful UI - or create a fake REST API in seconds | TypeScript | Akryum | Guillaume Chau | |
playgrounds/playground/src/auth.ts | TypeScript | export interface AuthenticatedUser {
id: string
}
export async function getUser(authorizationHeader: string): Promise<AuthenticatedUser | null> {
if (authorizationHeader === 'Bearer 123') {
return { id: '123' }
}
return null
}
| Akryum/moquerie | 213 | Effortlessly mock your entire API with simple configuration and a beautiful UI - or create a fake REST API in seconds | TypeScript | Akryum | Guillaume Chau | |
playgrounds/playground/src/context.ts | TypeScript | import type { YogaInitialContext } from 'graphql-yoga'
import { type AuthenticatedUser, getUser } from './auth.js'
export interface Context {
user: AuthenticatedUser | null
}
export async function getContext(initialContext: YogaInitialContext): Promise<Context> {
return {
user: await getUser(initialContext.re... | Akryum/moquerie | 213 | Effortlessly mock your entire API with simple configuration and a beautiful UI - or create a fake REST API in seconds | TypeScript | Akryum | Guillaume Chau | |
playgrounds/playground/src/extend/message.ts | TypeScript | export interface Message {
/**
* Some example property added to the schema
*/
internalProp: string
}
| Akryum/moquerie | 213 | Effortlessly mock your entire API with simple configuration and a beautiful UI - or create a fake REST API in seconds | TypeScript | Akryum | Guillaume Chau | |
playgrounds/playground/src/extend/types.ts | TypeScript | export * from './message.js'
| Akryum/moquerie | 213 | Effortlessly mock your entire API with simple configuration and a beautiful UI - or create a fake REST API in seconds | TypeScript | Akryum | Guillaume Chau | |
playgrounds/playground/src/fetch.test.ts | TypeScript | import type { MoquerieInstance } from 'moquerie'
import { createTestInstance, startServer } from 'moquerie'
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
describe('fetch', () => {
let mq: MoquerieInstance
let port: number
beforeEach(async () => {
mq = await createTestInstance({}, {
... | Akryum/moquerie | 213 | Effortlessly mock your entire API with simple configuration and a beautiful UI - or create a fake REST API in seconds | TypeScript | Akryum | Guillaume Chau | |
playgrounds/playground/src/generated/graphql.ts | TypeScript | import { GraphQLResolveInfo } from 'graphql';
export type Maybe<T> = T | null;
export type InputMaybe<T> = Maybe<T>;
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
export type MakeMay... | Akryum/moquerie | 213 | Effortlessly mock your entire API with simple configuration and a beautiful UI - or create a fake REST API in seconds | TypeScript | Akryum | Guillaume Chau | |
playgrounds/playground/src/index.ts | TypeScript | import { createServer } from 'node:http'
import { createYoga } from 'graphql-yoga'
import { getContext } from './context.js'
import { schema } from './schema.js'
// Create a Yoga instance with a GraphQL schema.
const yoga = createYoga({
schema,
context: getContext,
})
// Pass it into a server to hook into request... | Akryum/moquerie | 213 | Effortlessly mock your entire API with simple configuration and a beautiful UI - or create a fake REST API in seconds | TypeScript | Akryum | Guillaume Chau | |
playgrounds/playground/src/rest/other.ts | TypeScript | export interface MyObjectNotExported {
id: string
title: string
}
| Akryum/moquerie | 213 | Effortlessly mock your entire API with simple configuration and a beautiful UI - or create a fake REST API in seconds | TypeScript | Akryum | Guillaume Chau | |
playgrounds/playground/src/rest/rest.moq.ts | TypeScript | import { defineApiRoutes } from 'moquerie/mocks'
export default defineApiRoutes((router) => {
router.get('/auth/token', async ({ db }) => {
const Query = await db.Query.findFirst()
if (Query?.currentUser) {
return {
token: Query.currentUser.id,
}
}
return null
})
})
| Akryum/moquerie | 213 | Effortlessly mock your entire API with simple configuration and a beautiful UI - or create a fake REST API in seconds | TypeScript | Akryum | Guillaume Chau | |
playgrounds/playground/src/rest/types.ts | TypeScript | import type { MyObjectNotExported } from './other.js'
export interface MyObject {
id: string
name: string
count: number
}
/**
* Another object
* @restPath /foo
*/
export interface MyOtherObject {
id: string
/**
* Some useful description
*/
description?: string
otherDescription: string | undefin... | Akryum/moquerie | 213 | Effortlessly mock your entire API with simple configuration and a beautiful UI - or create a fake REST API in seconds | TypeScript | Akryum | Guillaume Chau | |
playgrounds/playground/src/schema.moq.ts | TypeScript | import { defineApiRoutes, defineResolvers, defineSchemaTransforms, defineScripts } from 'moquerie/mocks'
export default {
...defineResolvers({
Query: {
manyHellosCount: async ({ db }) => {
const query = await db.Query.findFirst()
return query?.manyHellos.length ?? 0
},
},
Mut... | Akryum/moquerie | 213 | Effortlessly mock your entire API with simple configuration and a beautiful UI - or create a fake REST API in seconds | TypeScript | Akryum | Guillaume Chau | |
playgrounds/playground/src/schema.ts | TypeScript | import type { YogaInitialContext } from 'graphql-yoga'
import type { Context } from './context.js'
import type { Resolvers } from './generated/graphql.js'
import { makeExecutableSchema } from '@graphql-tools/schema'
export const schema = makeExecutableSchema({
typeDefs: /* GraphQL */ `
type User {
id: ID!
... | Akryum/moquerie | 213 | Effortlessly mock your entire API with simple configuration and a beautiful UI - or create a fake REST API in seconds | TypeScript | Akryum | Guillaume Chau | |
playgrounds/playground/vitest.config.ts | TypeScript | import { defineConfig } from 'vitest/config'
export default defineConfig({
test: {
server: {
deps: {
external: [
/\/node_modules\//,
/graphql/,
],
},
},
},
})
| Akryum/moquerie | 213 | Effortlessly mock your entire API with simple configuration and a beautiful UI - or create a fake REST API in seconds | TypeScript | Akryum | Guillaume Chau | |
playgrounds/quick-rest/.moquerie/types/queryManager.ts | TypeScript | import type { QueryManager } from 'moquerie'
import type { Message, MyObject, User } from './resources.js'
declare module 'moquerie' {
export interface QueryManagerProxy {
Message: QueryManager<Message>
MyObject: QueryManager<MyObject>
User: QueryManager<User>
}
}
| Akryum/moquerie | 213 | Effortlessly mock your entire API with simple configuration and a beautiful UI - or create a fake REST API in seconds | TypeScript | Akryum | Guillaume Chau | |
playgrounds/quick-rest/.moquerie/types/resources.ts | TypeScript | export interface Message {
id: string
text: string
user: User
}
export interface MyObject {
id: string
count: number
title: string
}
export interface User {
id: string
email: string
messages: Message
name: string
}
| Akryum/moquerie | 213 | Effortlessly mock your entire API with simple configuration and a beautiful UI - or create a fake REST API in seconds | TypeScript | Akryum | Guillaume Chau | |
playgrounds/quick-rest/moquerie.rest.ts | TypeScript | export interface MyObject {
id: string
title: string
count: number
}
export interface User {
id: string
name: string
email: string
messages: Message[]
}
export interface Message {
id: string
text: string
user: User
}
| Akryum/moquerie | 213 | Effortlessly mock your entire API with simple configuration and a beautiful UI - or create a fake REST API in seconds | TypeScript | Akryum | Guillaume Chau | |
app.vue | Vue | <script setup>
import { codeToHtml } from 'shiki'
const code = useLocalStorage('code', '')
const debouncedCode = useDebounce(code, 1000)
const { data, error, status } = useFetch('/api/analyze', {
method: 'POST',
body: computed(() => ({
code: debouncedCode.value
})),
})
const rendered = computedAsync(async... | Akryum/vue-component-meta-explorer | 0 | Vue | Akryum | Guillaume Chau | ||
nuxt.config.ts | TypeScript | // https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
modules: [
'@vueuse/nuxt',
'@nuxt/ui'
],
compatibilityDate: '2024-04-03',
devtools: { enabled: false },
ssr: false,
hooks: {
'prerender:routes' ({ routes }) {
routes.clear() // Do not generate any rout... | Akryum/vue-component-meta-explorer | 0 | Vue | Akryum | Guillaume Chau | ||
server/api/analyze.post.ts | TypeScript |
import { createChecker } from 'vue-component-meta'
import { defineEventHandler, readBody } from 'h3'
import process from 'node:process'
import path from 'node:path'
import fs from 'node:fs'
const checker = createChecker(
// Write your tsconfig path
path.join(process.cwd(), 'tsconfig.json'),
{
forceUseTs: tr... | Akryum/vue-component-meta-explorer | 0 | Vue | Akryum | Guillaume Chau | ||
backup.sh | Shell | #!/bin/bash
# This script backs up the high scores file from production with ssh.
# You can run this as a cron job, for example.
set -e
if [ $# -ne 1 ]; then
echo "Usage: $0 <dest-dir>" >&2
exit 2
fi
mkdir -vp "$1"
cd "$1"
delete_older_than=$(date +'%Y-%m-%d' -d '90 days ago')
compress_older_than=$(date +'... | Akuli/catris | 2 | The classic game of falling blocks, but with online multiplayer | Rust | Akuli | ||
catris-client.sh | Shell | #!/bin/bash
set -e -o pipefail
export LANG=C
if [ $# != 1 ] || ! [[ "$1" =~ ^wss?://[^/] ]]; then
echo "Usage: $0 <websocket-url>" >&2
exit 2
fi
ws_or_wss_url="$1"
# Parse:
# ws://hostname
# ws://hostname/
# ws://hostname/bla/bla/bla
#
# and these variations:
# wss:// instead of ws://
# hostname:123... | Akuli/catris | 2 | The classic game of falling blocks, but with online multiplayer | Rust | Akuli | ||
deploy1.sh | Shell | #!/bin/bash
set -e -o pipefail
function info() {
echo ""
echo "========= $1 ========="
echo ""
}
info "Check Git status"
# should be:
# - on main branch
# - version number modified into Cargo.toml, not "git add"ed yet
# - working directory can contain untracked files (they are ignored)
# - no othe... | Akuli/catris | 2 | The classic game of falling blocks, but with online multiplayer | Rust | Akuli | ||
deploy2.sh | Shell | #!/bin/bash
set -e -o pipefail
function info() {
echo ""
echo "========= $1 ========="
echo ""
}
info "Check Git status"
# should be:
# - on main branch
# - working directory can contain untracked files (they are ignored)
# - no added or not-added changes to files tracked with Git
LANG=C git status ... | Akuli/catris | 2 | The classic game of falling blocks, but with online multiplayer | Rust | Akuli | ||
index.html | HTML | <!DOCTYPE html>
<!-- This file makes GitHub Pages redirect from https://akuli.github.io/catris to my server. -->
<html>
<head>
<meta http-equiv="refresh" content="0; url='https://catris.net/'" />
</head>
<body>
Click <a href="https://catris.net/">here</a> to play.
</body>
</html>
| Akuli/catris | 2 | The classic game of falling blocks, but with online multiplayer | Rust | Akuli | ||
multiplayer-tester.py | Python | # quick and dirty python script for testing changes locally:
# - connects 3 clients to catris simultaneously
# - joins all clients to the same lobby and same game
# - lets you play as one of the clients
#
# does NOT work on windows, let me know if you want to develop this on windows
import os
import select
import... | Akuli/catris | 2 | The classic game of falling blocks, but with online multiplayer | Rust | Akuli | ||
src/client.rs | Rust | use crate::connection::Receiver;
use crate::escapes::KeyPress;
use crate::escapes::TerminalType;
use crate::lobby;
use crate::lobby::Lobbies;
use crate::lobby::Lobby;
use crate::render::RenderBuffer;
use crate::render::RenderData;
use std::collections::HashSet;
use std::io;
use std::io::ErrorKind;
use std::sync::Arc;
u... | Akuli/catris | 2 | The classic game of falling blocks, but with online multiplayer | Rust | Akuli | ||
src/connection.rs | Rust | use crate::escapes::parse_key_press;
use crate::escapes::KeyPress;
use crate::ip_tracker::ForgetClientOnDrop;
use crate::ip_tracker::IpTracker;
use futures_util::stream::SplitSink;
use futures_util::stream::SplitStream;
use futures_util::SinkExt;
use futures_util::StreamExt;
use std::collections::VecDeque;
use std::env... | Akuli/catris | 2 | The classic game of falling blocks, but with online multiplayer | Rust | Akuli | ||
src/escapes.rs | Rust | use std::fmt::Write;
#[derive(Debug, Copy, Clone, PartialEq)]
pub enum TerminalType {
Ansi, // Modern terminals https://en.wikipedia.org/wiki/ANSI_escape_code
VT52, // Older devices https://en.wikipedia.org/wiki/VT52
}
impl TerminalType {
// Location of cursor after clearing depends on the terminal mode.
... | Akuli/catris | 2 | The classic game of falling blocks, but with online multiplayer | Rust | Akuli | ||
src/game_logic/blocks.rs | Rust | use crate::escapes::Color;
use crate::game_logic::BlockRelativeCoords;
use crate::game_logic::PlayerPoint;
use crate::render::RenderBuffer;
use rand::distributions::Distribution;
use rand::distributions::WeightedIndex;
use rand::seq::SliceRandom;
use rand::Rng;
#[derive(Copy, Clone, Debug)]
enum DrillDirection {
U... | Akuli/catris | 2 | The classic game of falling blocks, but with online multiplayer | Rust | Akuli | ||
src/game_logic/game.rs | Rust | use crate::escapes::Color;
use crate::escapes::KeyPress;
use crate::game_logic::blocks::BlockType;
use crate::game_logic::blocks::FallingBlock;
use crate::game_logic::blocks::SquareContent;
use crate::game_logic::player::BlockOrTimer;
use crate::game_logic::player::Player;
use crate::game_logic::BlockRelativeCoords;
us... | Akuli/catris | 2 | The classic game of falling blocks, but with online multiplayer | Rust | Akuli | ||
src/game_logic/mod.rs | Rust | // This module contains pure game logic. IO and async are done elsewhere.
pub mod blocks;
pub mod game;
pub mod player;
#[cfg(test)]
mod test;
// PlayerPoint numbers must be big, they don't wrap around in ring mode
pub type PlayerPoint = (i32, i32); // player-specific in ring mode, (0,1) = downwards
pub type WorldPoi... | Akuli/catris | 2 | The classic game of falling blocks, but with online multiplayer | Rust | Akuli | ||
src/game_logic/player.rs | Rust | use crate::game_logic::blocks::FallingBlock;
use crate::game_logic::game::wrap_around;
use crate::game_logic::game::Mode;
use crate::game_logic::game::RING_OUTER_RADIUS;
use crate::game_logic::PlayerPoint;
use crate::game_logic::WorldPoint;
use crate::lobby::ClientInfo;
#[derive(Debug)]
pub enum BlockOrTimer {
Blo... | Akuli/catris | 2 | The classic game of falling blocks, but with online multiplayer | Rust | Akuli | ||
src/game_logic/test.rs | Rust | use crate::escapes::Color;
use crate::escapes::KeyPress;
use crate::escapes::TerminalType;
use crate::game_logic::blocks::BlockType;
use crate::game_logic::blocks::FallingBlock;
use crate::game_logic::blocks::Shape;
use crate::game_logic::blocks::SquareContent;
use crate::game_logic::game::Game;
use crate::game_logic::... | Akuli/catris | 2 | The classic game of falling blocks, but with online multiplayer | Rust | Akuli | ||
src/game_wrapper.rs | Rust | use crate::escapes::Color;
use crate::game_logic::game::Game;
use crate::game_logic::WorldPoint;
use crate::high_scores::add_result_and_get_high_scores;
use crate::high_scores::read_all_high_scores;
use crate::high_scores::AllHighScores;
use crate::high_scores::GameResult;
use crate::high_scores::HighScoresForGame;
use... | Akuli/catris | 2 | The classic game of falling blocks, but with online multiplayer | Rust | Akuli | ||
src/high_scores.rs | Rust | use crate::game_logic::game::Mode;
use chrono::DateTime;
use chrono::Utc;
use std::collections::HashMap;
use std::fs;
use std::io::BufRead;
use std::io::BufReader;
use std::io::ErrorKind;
use std::io::Seek;
use std::io::SeekFrom;
use std::io::Write;
use std::time::Duration;
// https://users.rust-lang.org/t/convert-box... | Akuli/catris | 2 | The classic game of falling blocks, but with online multiplayer | Rust | Akuli | ||
src/ingame_ui.rs | Rust | use crate::client::Client;
use crate::escapes::Color;
use crate::escapes::TerminalType;
use crate::game_logic::blocks::FallingBlock;
use crate::game_logic::game::Game;
use crate::game_logic::game::Mode;
use crate::game_logic::game::BOTTLE_MAP;
use crate::game_logic::game::RING_MAP;
use crate::game_logic::game::RING_OUT... | Akuli/catris | 2 | The classic game of falling blocks, but with online multiplayer | Rust | Akuli | ||
src/ip_tracker.rs | Rust | use crate::client::log_for_client;
use std::collections::HashMap;
use std::collections::VecDeque;
use std::io;
use std::io::ErrorKind;
use std::net::IpAddr;
use std::sync::Arc;
use std::sync::Mutex;
use std::time::Instant;
pub struct IpTracker {
recent_ips: VecDeque<(Instant, IpAddr)>,
client_counts_by_ip: Has... | Akuli/catris | 2 | The classic game of falling blocks, but with online multiplayer | Rust | Akuli | ||
src/lobby.rs | Rust | use crate::client::log_for_client;
use crate::game_logic::game::Game;
use crate::game_logic::game::Mode;
use crate::game_wrapper;
use crate::game_wrapper::GameWrapper;
use rand::Rng;
use std::collections::HashMap;
use std::sync::Arc;
use std::sync::Mutex;
use std::sync::Weak;
use tokio::sync::watch;
use weak_table::Wea... | Akuli/catris | 2 | The classic game of falling blocks, but with online multiplayer | Rust | Akuli | ||
src/main.rs | Rust | #[macro_use(lazy_static)]
extern crate lazy_static;
use crate::client::log_for_client;
use crate::client::Client;
use crate::connection::get_websocket_proxy_ip;
use crate::connection::initialize_connection;
use crate::connection::Receiver;
use crate::connection::Sender;
use crate::escapes::KeyPress;
use crate::escapes... | Akuli/catris | 2 | The classic game of falling blocks, but with online multiplayer | Rust | Akuli | ||
src/render.rs | Rust | use crate::escapes::Color;
use crate::escapes::TerminalType;
use std::sync::Arc;
use tokio::sync::Notify;
pub struct RenderBuffer {
pub terminal_type: TerminalType,
pub width: usize,
pub height: usize,
chars: Vec<Vec<char>>,
colors: Vec<Vec<Color>>,
}
impl RenderBuffer {
pub fn new(terminal_ty... | Akuli/catris | 2 | The classic game of falling blocks, but with online multiplayer | Rust | Akuli |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.