repo stringlengths 6 47 | file_url stringlengths 77 269 | file_path stringlengths 5 186 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-07 08:35:43 2026-01-07 08:55:24 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/wit/list.go | wit/list.go | package wit
// List represents a WIT [list type], which is an ordered vector of an arbitrary type.
// It implements the [Node], [ABI], and [TypeDefKind] interfaces.
//
// [list type]: https://component-model.bytecodealliance.org/design/wit.html#lists
type List struct {
_typeDefKind
Type Type
}
// Size returns the [... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/wit/record.go | wit/record.go | package wit
// Record represents a WIT [record type], akin to a struct.
// It implements the [Node], [ABI], and [TypeDefKind] interfaces.
//
// [record type]: https://github.com/WebAssembly/component-model/blob/main/design/mvp/WIT.md#item-record-bag-of-named-fields
type Record struct {
_typeDefKind
Fields []Field
}
... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/wit/type.go | wit/type.go | package wit
import (
"fmt"
"iter"
"unsafe"
)
// TypeOwner is the interface implemented by any type that can own a TypeDef,
// currently [World] and [Interface].
type TypeOwner interface {
Node
AllFunctions() iter.Seq[*Function]
WITPackage() *Package
isTypeOwner()
}
type _typeOwner struct{}
func (_typeOwner) ... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/wit/stability.go | wit/stability.go | package wit
import (
"github.com/coreos/go-semver/semver"
)
// Stability represents the version or feature-gated stability of a given feature.
type Stability interface {
Node
isStability()
Versioned() bool
}
// _stability is an embeddable type that conforms to the [Stability] interface.
type _stability struct{}
... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/wit/variant.go | wit/variant.go | package wit
// Variant represents a WIT [variant type], a tagged/discriminated union.
// A variant type declares one or more cases. Each case has a name and, optionally,
// a type of data associated with that case.
// It implements the [Node], [ABI], and [TypeDefKind] interfaces.
//
// [variant type]: https://componen... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/wit/resource.go | wit/resource.go | package wit
// Resource represents a WIT [resource type].
// It implements the [Node], [ABI], and [TypeDefKind] interfaces.
//
// [resource type]: https://github.com/WebAssembly/component-model/blob/main/design/mvp/WIT.md#item-resource
type Resource struct{ _typeDefKind }
// Size returns the [ABI byte size] for [Reso... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/wit/world.go | wit/world.go | package wit
import (
"iter"
"go.bytecodealliance.org/wit/iterate"
"go.bytecodealliance.org/wit/ordered"
)
// A World represents all of the imports and exports of a [WebAssembly component].
// It implements the [Node] and [TypeOwner] interfaces.
//
// [WebAssembly component]: https://github.com/WebAssembly/compone... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/wit/ident_test.go | wit/ident_test.go | package wit
import (
"reflect"
"testing"
"github.com/coreos/go-semver/semver"
)
func TestIdent(t *testing.T) {
tests := []struct {
s string
want Ident
wantErr bool
}{
{"wasi:io", Ident{Namespace: "wasi", Package: "io"}, false},
{"wasi:io@0.2.0", Ident{Namespace: "wasi", Package: "io", Version... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/wit/enum.go | wit/enum.go | package wit
// Enum represents a WIT [enum type], which is a [Variant] without associated data.
// The equivalent in Go is a set of const identifiers declared with iota.
// It implements the [Node], [ABI], and [TypeDefKind] interfaces.
//
// [enum type]: https://component-model.bytecodealliance.org/design/wit.html#enu... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/wit/package.go | wit/package.go | package wit
import (
"strings"
"go.bytecodealliance.org/wit/ordered"
)
// Package represents a [WIT package] within a [Resolve].
// It implements the [Node] interface.
//
// A Package is a collection of [Interface] and [World] values. Additionally,
// a Package contains a unique identifier that affects generated c... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/wit/codec.go | wit/codec.go | package wit
import (
"io"
"github.com/coreos/go-semver/semver"
"go.bytecodealliance.org/internal/codec"
"go.bytecodealliance.org/internal/codec/json"
)
// DecodeJSON decodes JSON from r into a [Resolve] struct.
// It returns any error that may occur during decoding.
func DecodeJSON(r io.Reader) (*Resolve, error)... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/wit/abi_test.go | wit/abi_test.go | package wit
import (
"fmt"
"math"
"reflect"
"testing"
)
func TestAlign(t *testing.T) {
tests := []struct {
ptr uintptr
align uintptr
want uintptr
}{
{0, 1, 0},
{0, 2, 0},
{0, 4, 0},
{0, 8, 0},
{1, 1, 1},
{1, 2, 2},
{1, 4, 4},
{1, 8, 8},
{2, 1, 2},
{2, 2, 2},
{2, 4, 4},
{2, 8, 8}... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/wit/bindgen/abi.go | wit/bindgen/abi.go | package bindgen
import (
"slices"
"go.bytecodealliance.org/wit"
)
// variantShape returns the type with the greatest size that is not a bool.
// If there are multiple types with the same size, it returns
// the first type that contains a pointer.
func variantShape(types []wit.Type) wit.Type {
if len(types) == 0 {... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/wit/bindgen/testdata_test.go | wit/bindgen/testdata_test.go | // TODO: remove this once TinyGo adds runtime.Frame.Entry and reflect.StringHeader.Len is type int
//go:build !tinygo
package bindgen
import (
"flag"
"go/token"
"io/fs"
"os"
"os/exec"
"path"
"path/filepath"
"strings"
"sync"
"testing"
"golang.org/x/tools/go/packages"
"go.bytecodealliance.org/internal/cod... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/wit/bindgen/names_test.go | wit/bindgen/names_test.go | package bindgen
import "testing"
func TestGoName(t *testing.T) {
tests := []struct {
name string
want string
exported string
}{
{"canonical-ABI", "canonicalABI", "CanonicalABI"},
{"cabi", "cabi", "CABI"},
{"datetime", "dateTime", "DateTime"},
{"fast-api", "fastAPI", "FastAPI"},
{"fast-API", ... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/wit/bindgen/names.go | wit/bindgen/names.go | package bindgen
import (
"strings"
"unicode"
"go.bytecodealliance.org/internal/go/gen"
)
// GoPackageName generates a Go local package name (e.g. "json").
func GoPackageName(name string) string {
return strings.Map(func(c rune) rune {
if notLetterDigit(c) {
return -1
}
return c
}, strings.ToLower(name)... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/wit/bindgen/docs.go | wit/bindgen/docs.go | package bindgen
import (
"strings"
"go.bytecodealliance.org/internal/go/gen"
)
func formatDocComments(s string, indent bool) string {
return gen.FormatDocComments(processMarkdown(s), indent)
}
func processMarkdown(s string) string {
var lines []string
var indent bool
for _, line := range strings.Split(s, "\n"... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/wit/bindgen/generator.go | wit/bindgen/generator.go | // Package bindgen generates Go source code from a fully-resolved WIT package.
// It generates one or more Go packages, with functions, types, constants, and variables,
// along with the associated code to lift and lower Go types into Canonical ABI representation.
package bindgen
import (
"bytes"
"context"
"errors"... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | true |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/wit/bindgen/options.go | wit/bindgen/options.go | package bindgen
import (
"go.bytecodealliance.org/wit/logging"
)
// Option represents a single configuration option for this package.
type Option interface {
applyOption(*options) error
}
type optionFunc func(*options) error
func (f optionFunc) applyOption(opts *options) error {
return f(opts)
}
type options st... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/wit/bindgen/generate.go | wit/bindgen/generate.go | package bindgen
import (
"go.bytecodealliance.org/internal/go/gen"
"go.bytecodealliance.org/wit"
)
// Go generates one or more Go packages from [wit.Resolve] res.
// It returns any error that occurs during code generation.
func Go(res *wit.Resolve, opts ...Option) ([]*gen.Package, error) {
g, err := newGenerator(r... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/wit/ordered/map_test.go | wit/ordered/map_test.go | package ordered
import "testing"
func TestMap(t *testing.T) {
var m Map[int, int]
m.Set(0, 0)
m.Set(5, 5)
m.Set(1, 1)
m.Delete(5)
m.Set(2, 2)
m.Set(3, 3)
m.Set(3, 3)
m.Set(4, 4)
m.Set(5, 5)
got, want := m.Len(), 6
if got != want {
t.Errorf("m.Len(): %d, expected %d", got, want)
}
// Test values
for... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/wit/ordered/map.go | wit/ordered/map.go | package ordered
import (
"iter"
"go.bytecodealliance.org/internal/codec"
)
// Map represents an ordered map of key-value pairs.
// Use the All method to iterate over pairs in the order they were added.
// The zero value of Map is ready to use.
// Methods on Map are not safe for concurrent use and must be protected... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/wit/ordered/list.go | wit/ordered/list.go | package ordered
import "iter"
type list[K, V any] struct {
root element[K, V]
}
func (l *list[K, V]) all() iter.Seq2[K, V] {
return func(yield func(k K, v V) bool) {
next := l.root.next
for e := next; e != nil; e = next {
// Save the next element in case e is deleted from the list.
next = e.next
if !y... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/wit/logging/logging.go | wit/logging/logging.go | package logging
import (
"io"
"log"
"math"
)
// Level represents a logging level, identical to [slog.Level].
type Level int
const (
LevelDebug Level = -4
LevelInfo Level = 0
LevelWarn Level = 4
LevelError Level = 8
LevelNever Level = math.MaxInt
)
// Logger represents a simple logging interface.
type Logg... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/wit/iterate/iterate.go | wit/iterate/iterate.go | package iterate
// Done wraps yield and calls done when yield returns false.
func Done[V any](yield func(V) bool, done func()) func(V) bool {
return func(v V) bool {
if !yield(v) {
done()
return false
}
return true
}
}
// Done2 wraps yield and calls done when yield returns false.
func Done2[K, V any](yi... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/codec/encode.go | internal/codec/encode.go | //go:build ignore
package codec
type Encoder interface {
EncodeStruct(name string) StructEncoder
}
type StructEncoder interface {
EncodeField(name string, v any) error
End() error
}
type FieldsEncoder interface{}
type ElementsEncoder interface{}
type Widget struct {
Name string
}
func (w *Widget) Encode(enc ... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/codec/constraints.go | internal/codec/constraints.go | package codec
// Signed is the set of signed integer types supported by this package.
type Signed interface {
int | int8 | int16 | int32 | int64
}
// Unsigned is the set of unsigned integer types supported by this package.
type Unsigned interface {
uint | uint8 | uint16 | uint32 | uint64
}
// Integer is the set of... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/codec/decode.go | internal/codec/decode.go | package codec
import (
"encoding"
"strconv"
"unsafe"
)
// DecodeNil calls DecodeNil on v if v implements NilDecoder.
func DecodeNil(v any) error {
if v, ok := v.(NilDecoder); ok {
return v.DecodeNil()
}
return nil
}
// DecodeBool decodes a boolean value into v.
// If *v is a pointer to a bool, then a bool wi... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/codec/helpers.go | internal/codec/helpers.go | package codec
import (
"cmp"
"slices"
)
// Must ensures that the pointer at *p is non-nil.
// If *p is nil, a new value of type T will be allocated.
func Must[T any](p **T) *T {
if *p == nil {
*p = new(T)
}
return *p
}
// Slice returns an ElementDecoder for slice s.
func Slice[E comparable](s *[]E) ElementDec... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/codec/codec.go | internal/codec/codec.go | package codec
// Codec is any type that can encode or decode itself or an associated type.
type Codec any
// Resolver is the interface implemented by types that return a codec for the value at v.
// Values returned by Resolver should implement one or more encode or decode methods.
type Resolver interface {
ResolveCo... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/codec/json/decoder.go | internal/codec/json/decoder.go | package json
import (
"encoding/json"
"fmt"
"io"
"go.bytecodealliance.org/internal/codec"
)
type Decoder struct {
dec *json.Decoder
r codec.Resolvers
}
func NewDecoder(r io.Reader, resolvers ...codec.Resolver) *Decoder {
dec := json.NewDecoder(r)
dec.UseNumber()
return &Decoder{
dec: dec,
r: codec.... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/cmd/wasm-tools/main.go | internal/cmd/wasm-tools/main.go | package main
import (
"context"
"fmt"
"io/fs"
"os"
"go.bytecodealliance.org/internal/wasmtools"
)
func main() {
ctx := context.Background()
wasmTools, err := wasmtools.New(ctx)
if err != nil {
exit(err)
}
fsMap := map[string]fs.FS{
"./": os.DirFS("./"),
}
var args []string
if len(os.Args) != 0 {
... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/stringio/stringio.go | internal/stringio/stringio.go | // Package stringio contains helpers for string I/O.
package stringio
// Writer is the interface implemented by anything that can write strings,
// such as [bytes.Buffer] or [strings.Builder].
type Writer interface {
WriteString(string) (int, error)
}
// Write writes strings to w, returning the total bytes written a... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/memoize/memoize.go | internal/memoize/memoize.go | package memoize
// Function memoizes f, caching unique values of k.
// Initial calls to the resulting function will call f(k), then cache and return v.
// Subsequent calls will return the cached value for k.
func Function[F func(K) V, K comparable, V any](f F) F {
m := make(map[K]V)
return func(k K) V {
if v, ok :... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/witcli/dir_test.go | internal/witcli/dir_test.go | package witcli
import (
"errors"
"io/fs"
"os"
"path/filepath"
"runtime"
"strings"
"testing"
)
func TestFindOrCreateDirFind(t *testing.T) {
temp := t.TempDir()
dir := filepath.Join(temp, "existing")
if err := os.Mkdir(dir, os.ModeDir|os.ModePerm); err != nil {
t.Fatal(err)
}
fi, err := os.Stat(dir)
if... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/witcli/witcli.go | internal/witcli/witcli.go | package witcli
import (
"bytes"
"context"
"fmt"
"io"
"os"
"strings"
"go.bytecodealliance.org/internal/oci"
"go.bytecodealliance.org/wit"
)
// LoadWIT loads a single [wit.Resolve].
// If path is a OCI path, it pulls from the OCI registry and load WIT
// from the buffer.
// If path == "" or "-", then it reads ... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/witcli/logger.go | internal/witcli/logger.go | package witcli
import (
"os"
"go.bytecodealliance.org/wit/logging"
)
// Logger returns a [logging.Logger] that outputs to stdout.
func Logger(verbose, debug bool) logging.Logger {
level := logging.LevelWarn
if debug {
level = logging.LevelDebug
} else if verbose {
level = logging.LevelInfo
}
return loggin... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/witcli/dir.go | internal/witcli/dir.go | package witcli
import (
"errors"
"fmt"
"io/fs"
"os"
)
// FindOrCreateDir attempts to load file information for the provided path and
// the provided path does not already exist, it attempts to create the directory
// and then return the file information for it.
func FindOrCreateDir(path string) (fs.FileInfo, erro... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/go/gen/file.go | internal/go/gen/file.go | package gen
import (
"bytes"
"fmt"
"go/format"
"strings"
"go.bytecodealliance.org/internal/codec"
)
// File represents a generated file. It may be a Go file
type File struct {
// Name is the short name of the file.
// If Name ends in ".go" this file will be treated as a Go file.
Name string
// GeneratedBy ... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/go/gen/module_test.go | internal/go/gen/module_test.go | package gen
import (
"os"
"testing"
"go.bytecodealliance.org/internal/relpath"
)
func TestPackagePath(t *testing.T) {
wd, err := relpath.Getwd()
if err != nil {
t.Error(err)
}
got, err := PackagePath(wd)
if err != nil {
t.Error(err)
}
want := "go.bytecodealliance.org/internal/go/gen"
if got != want {... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/go/gen/names.go | internal/go/gen/names.go | package gen
import "go/token"
// UniqueName tests name against filters and modifies name until all filters return false.
// Use IsReserved to filter out Go keywords and predeclared identifiers.
//
// Exported names that start with a capital letter will be appended with an underscore.
// Non-exported names are prefixe... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/go/gen/file_test.go | internal/go/gen/file_test.go | package gen
import "testing"
func TestFileHasContent(t *testing.T) {
positives := []File{
{Name: "comment.go", Content: []byte("// Comment\n")},
{Name: "package_docs.go", PackageDocs: "package documentation"},
{Name: "header.go", Header: "// Header\n"},
{Name: "trailer.go", Trailer: "// Trailer\n"},
{Name:... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/go/gen/format.go | internal/go/gen/format.go | package gen
import "strings"
const (
DocCommentPrefix = "//"
LineLength = 80
)
// FormatDocComments formats documentation comment text (without // or /*)
// into multiple lines of max length LineLength, prefixed by //, suitable
// for inclusion as documentation comments in Go source code.
func FormatDocComme... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/go/gen/ident.go | internal/go/gen/ident.go | package gen
import "strings"
// Ident represents a package-level Go declaration.
type Ident struct {
Package *Package
Name string
}
// ParseSelector parses string s into a package path and short name.
// It does not validate the input or resulting values. Examples:
// "io" -> "io", "io"
// "encoding/json" -> "e... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/go/gen/module.go | internal/go/gen/module.go | package gen
import (
"errors"
"fmt"
"io"
"os"
"path"
"path/filepath"
"go.bytecodealliance.org/internal/relpath"
"golang.org/x/mod/modfile"
)
// PackagePath returns the Go module path and optional package directory path(s)
// for the given directory path dir. Returns an error if dir or its parent directories
... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/go/gen/ident_test.go | internal/go/gen/ident_test.go | package gen
import "testing"
func TestParseSelector(t *testing.T) {
tests := []struct {
s string
path string
name string
}{
{"io", "io", "io"},
{"io/fs", "io/fs", "fs"},
{"encoding/json", "encoding/json", "json"},
{"encoding/xml", "encoding/xml", "xml"},
{"encoding/xml#xml", "encoding/xml", "xml"... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/go/gen/package.go | internal/go/gen/package.go | package gen
// Package represents a Go package, containing zero or more files
// of generated code, along with zero or more declarations.
type Package struct {
// Path is the Go package path, e.g. "encoding/json"
Path string
// Name is the short Go package name, e.g. "json"
Name string
// Files is the list of G... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/go/stack/trace.go | internal/go/stack/trace.go | package stack
import (
"fmt"
"runtime"
)
func Trace() []string {
var out []string
for i := 1; i < 1024; i++ {
_, file, line, ok := runtime.Caller(i)
if !ok {
break
}
out = append(out, fmt.Sprintf("%s:%d", file, line))
}
return out
}
| go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/wasmtools/instance_tinygo.go | internal/wasmtools/instance_tinygo.go | //go:build tinygo
package wasmtools
import (
"context"
"errors"
"io"
"io/fs"
)
var errTinyGo = errors.New("wasm-tools disabled under TinyGo")
type Instance struct{}
func New(ctx context.Context) (*Instance, error) {
return &Instance{}, errTinyGo
}
func (w *Instance) Close(ctx context.Context) error {
return... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/wasmtools/instance.go | internal/wasmtools/instance.go | package wasmtools
import (
"context"
"io"
"io/fs"
)
type instance interface {
Close(ctx context.Context) error
Run(ctx context.Context, stdin io.Reader, stdout, stderr io.Writer, fsMap map[string]fs.FS, args ...string) error
}
var _ instance = &Instance{}
| go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/wasmtools/instance_other.go | internal/wasmtools/instance_other.go | //go:build !tinygo
package wasmtools
import (
"bytes"
"compress/gzip"
"context"
"crypto/rand"
_ "embed"
"fmt"
"io"
"io/fs"
"os"
"path/filepath"
"strings"
"sync"
"github.com/tetratelabs/wazero"
"github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1"
"go.bytecodealliance.org/internal/module"
)
/... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/wasm/wasm.go | internal/wasm/wasm.go | package wasm
import (
"bufio"
"io"
"go.bytecodealliance.org/internal/wasm/uleb128"
)
const (
Magic = "\x00asm"
Version1 = "\x01\x00\x00\x00"
)
// Write writes a binary [WebAssembly module] to w.
//
// [WebAssembly module]: https://webassembly.github.io/spec/core/binary/modules.html#binary-module
func Write(... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/wasm/section.go | internal/wasm/section.go | package wasm
import (
"bytes"
"go.bytecodealliance.org/internal/wasm/uleb128"
)
// SectionID represents a WebAssembly [section SectionID].
//
// [section SectionID]: https://webassembly.github.io/spec/core/binary/modules.html#sections
type SectionID uint8
const (
SectionCustom SectionID = 0
SectionType ... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/wasm/sleb128/sleb128.go | internal/wasm/sleb128/sleb128.go | // Package sleb128 reads and writes signed LEB128 integers.
package sleb128
import (
"io"
"unsafe"
)
// Read reads a signed [LEB128] value from r.
// Returns the value, number of bytes read, and/or an error.
//
// [LEB128]: https://en.wikipedia.org/wiki/LEB128
func Read(r io.ByteReader) (v int64, n int, err error) ... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/wasm/sleb128/sleb128_test.go | internal/wasm/sleb128/sleb128_test.go | package sleb128
import (
"bytes"
"math"
"testing"
)
func TestReadWrite(t *testing.T) {
tests := []int64{
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
-1, -2, -3, -4, -5, -6, -7, -8, -9, -10,
1 << 7, 1 << 8, 1 << 9,
-1 << 7, -1 << 8, -1 << 9,
math.MinInt64, math.MaxInt64,
}
for _, want := range tests {
got, b, ... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/wasm/uleb128/uleb128.go | internal/wasm/uleb128/uleb128.go | // Package uleb128 reads and writes unsigned LEB128 integers.
package uleb128
import "io"
// Read reads an unsigned [LEB128] value from r.
// Returns the value, number of bytes read, and/or an error.
//
// [LEB128]: https://en.wikipedia.org/wiki/LEB128
func Read(r io.ByteReader) (v uint64, n int, err error) {
shift ... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/wasm/uleb128/uleb128_test.go | internal/wasm/uleb128/uleb128_test.go | package uleb128
import (
"bytes"
"math"
"testing"
)
func TestReadWrite(t *testing.T) {
tests := []uint64{
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
1 << 7, 1 << 8, 1 << 9,
math.MaxUint64,
}
for _, want := range tests {
got, b, err := roundTrip(want)
if err != nil {
t.Errorf("roundTrip(%d): error: %v", want... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/oci/oci_other.go | internal/oci/oci_other.go | //go:build !wasip1 && !wasip2 && !tinygo
package oci
import (
"bytes"
"context"
"fmt"
"io"
"os"
"github.com/regclient/regclient"
"github.com/regclient/regclient/types/manifest"
"github.com/regclient/regclient/types/ref"
)
// IsOCIPath checks if a given path is an OCI path
func IsOCIPath(path string) bool {
... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/oci/oci_wasi_tinygo.go | internal/oci/oci_wasi_tinygo.go | //go:build wasip1 || wasip2 || tinygo
package oci
import (
"context"
"errors"
)
func IsOCIPath(path string) bool {
return false
}
func PullWIT(ctx context.Context, path string) ([]byte, error) {
return nil, errors.New("OCI not supported on WASI or TinyGo")
}
| go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/oci/oci_test.go | internal/oci/oci_test.go | package oci
import (
"os"
"path/filepath"
"runtime"
"strings"
"testing"
)
func TestIsOCIPath(t *testing.T) {
// Something in TinyGo’s package regexp breaks here
if runtime.Compiler == "tinygo" || strings.Contains(runtime.GOARCH, "wasm") {
return
}
// Create a temporary directory for local file path tests
... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/module/module.go | internal/module/module.go | package module
import (
"runtime/debug"
"sync"
)
// Path returns the path of the main module.
func Path() string {
build := buildInfo()
if build == nil {
return "(none)"
}
return build.Main.Path
}
// Version returns the version string of the main module.
func Version() string {
return versionString()
}
var... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/relpath/getwd_wasip1.go | internal/relpath/getwd_wasip1.go | //go:build wasip1
package relpath
import (
"io/fs"
"os"
"path/filepath"
)
// Getwd returns best-effort path to the current working directory, even on WebAssembly.
// The path may be absolute, or it may be relative, prefixed with one or more ".." segments.
func Getwd() (string, error) {
var path string
var targe... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/relpath/relpath.go | internal/relpath/relpath.go | package relpath
import (
"io/fs"
"path/filepath"
"runtime"
)
// Abs returns a best-effort absolute representation of path.
// The returned path may be relative on platforms such as WebAssembly.
// If the path is not absolute it will be joined with the current
// working directory to turn it into an absolute path.
... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/relpath/getwd_other.go | internal/relpath/getwd_other.go | //go:build !wasip1
package relpath
import "os"
// Getwd returns best-effort path to the current working directory, even on WebAssembly.
// The path may be absolute, or it may be relative, prefixed with one or more ".." segments.
func Getwd() (string, error) {
return os.Getwd()
}
| go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
bytecodealliance/go-modules | https://github.com/bytecodealliance/go-modules/blob/55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1/internal/relpath/relpath_test.go | internal/relpath/relpath_test.go | package relpath
import (
"path/filepath"
"testing"
)
func TestAbs(t *testing.T) {
path, err := Abs(".")
if err != nil {
t.Error(err)
}
t.Logf("Abs: %s", path)
if got, want := filepath.Base(path), "relpath"; got != want {
t.Errorf("Abs: got base %s, expected %s", got, want)
}
path, err = Abs("..")
if er... | go | Apache-2.0 | 55a8715c694fb4bbe75c269ffd4a0ca14c80c6f1 | 2026-01-07T09:45:48.830497Z | false |
mellium/xmpp | https://github.com/mellium/xmpp/blob/a3dd6d7ce77932826d4d1683a9bd5d884226339e/negotiator.go | negotiator.go | // Copyright 2016 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.
package xmpp
import (
"context"
"fmt"
"io"
"mellium.im/xmpp/internal/attr"
intstream "mellium.im/xmpp/internal/stream"
"mellium.im/xmpp/internal/wskey"
"mell... | go | BSD-2-Clause | a3dd6d7ce77932826d4d1683a9bd5d884226339e | 2026-01-07T09:45:51.690808Z | false |
mellium/xmpp | https://github.com/mellium/xmpp/blob/a3dd6d7ce77932826d4d1683a9bd5d884226339e/tools.go | tools.go | // Copyright 2021 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.
//go:build tools
// +build tools
package xmpp
import (
_ "golang.org/x/tools/cmd/stringer"
)
| go | BSD-2-Clause | a3dd6d7ce77932826d4d1683a9bd5d884226339e | 2026-01-07T09:45:51.690808Z | false |
mellium/xmpp | https://github.com/mellium/xmpp/blob/a3dd6d7ce77932826d4d1683a9bd5d884226339e/session_test.go | session_test.go | // Copyright 2017 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.
package xmpp_test
import (
"bytes"
"context"
"encoding/xml"
"errors"
"fmt"
"io"
"math"
"net"
"strconv"
"strings"
"testing"
"mellium.im/xmlstream"
"mell... | go | BSD-2-Clause | a3dd6d7ce77932826d4d1683a9bd5d884226339e | 2026-01-07T09:45:51.690808Z | false |
mellium/xmpp | https://github.com/mellium/xmpp/blob/a3dd6d7ce77932826d4d1683a9bd5d884226339e/session_iq.go | session_iq.go | // Copyright 2021 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.
package xmpp
import (
"context"
"encoding/xml"
"fmt"
"io"
"mellium.im/xmlstream"
"mellium.im/xmpp/internal/attr"
"mellium.im/xmpp/internal/marshal"
"mellium... | go | BSD-2-Clause | a3dd6d7ce77932826d4d1683a9bd5d884226339e | 2026-01-07T09:45:51.690808Z | false |
mellium/xmpp | https://github.com/mellium/xmpp/blob/a3dd6d7ce77932826d4d1683a9bd5d884226339e/handler_test.go | handler_test.go | // Copyright 2020 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.
package xmpp_test
import (
"encoding/xml"
"errors"
"testing"
"mellium.im/xmlstream"
"mellium.im/xmpp"
)
var errHandlerFuncSentinal = errors.New("handler test"... | go | BSD-2-Clause | a3dd6d7ce77932826d4d1683a9bd5d884226339e | 2026-01-07T09:45:51.690808Z | false |
mellium/xmpp | https://github.com/mellium/xmpp/blob/a3dd6d7ce77932826d4d1683a9bd5d884226339e/echobot_example_test.go | echobot_example_test.go | // Copyright 2018 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.
package xmpp_test
import (
"context"
"crypto/tls"
"encoding/xml"
"io"
"log"
"mellium.im/sasl"
"mellium.im/xmlstream"
"mellium.im/xmpp"
"mellium.im/xmpp/jid... | go | BSD-2-Clause | a3dd6d7ce77932826d4d1683a9bd5d884226339e | 2026-01-07T09:45:51.690808Z | false |
mellium/xmpp | https://github.com/mellium/xmpp/blob/a3dd6d7ce77932826d4d1683a9bd5d884226339e/bind_test.go | bind_test.go | // Copyright 2016 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.
package xmpp_test
import (
"bytes"
"context"
"encoding/xml"
"fmt"
"strings"
"testing"
"mellium.im/xmpp"
"mellium.im/xmpp/internal/ns"
"mellium.im/xmpp/inte... | go | BSD-2-Clause | a3dd6d7ce77932826d4d1683a9bd5d884226339e | 2026-01-07T09:45:51.690808Z | false |
mellium/xmpp | https://github.com/mellium/xmpp/blob/a3dd6d7ce77932826d4d1683a9bd5d884226339e/session_presence_test.go | session_presence_test.go | // Copyright 2021 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.
package xmpp_test
import (
"context"
"encoding/xml"
"strconv"
"testing"
"time"
"mellium.im/xmlstream"
"mellium.im/xmpp/internal/xmpptest"
"mellium.im/xmpp/s... | go | BSD-2-Clause | a3dd6d7ce77932826d4d1683a9bd5d884226339e | 2026-01-07T09:45:51.690808Z | false |
mellium/xmpp | https://github.com/mellium/xmpp/blob/a3dd6d7ce77932826d4d1683a9bd5d884226339e/sasl_test.go | sasl_test.go | // Copyright 2016 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.
package xmpp_test
import (
"bytes"
"context"
"encoding/xml"
"strings"
"testing"
"mellium.im/sasl"
"mellium.im/xmpp"
"mellium.im/xmpp/internal/ns"
"mellium.... | go | BSD-2-Clause | a3dd6d7ce77932826d4d1683a9bd5d884226339e | 2026-01-07T09:45:51.690808Z | false |
mellium/xmpp | https://github.com/mellium/xmpp/blob/a3dd6d7ce77932826d4d1683a9bd5d884226339e/features.go | features.go | // Copyright 2016 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.
package xmpp
import (
"context"
"encoding/xml"
"errors"
"fmt"
"io"
"mellium.im/xmlstream"
"mellium.im/xmpp/internal/decl"
"mellium.im/xmpp/internal/ns"
int... | go | BSD-2-Clause | a3dd6d7ce77932826d4d1683a9bd5d884226339e | 2026-01-07T09:45:51.690808Z | false |
mellium/xmpp | https://github.com/mellium/xmpp/blob/a3dd6d7ce77932826d4d1683a9bd5d884226339e/bind.go | bind.go | // Copyright 2016 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.
package xmpp
import (
"context"
"encoding/xml"
"fmt"
"io"
"mellium.im/xmlstream"
"mellium.im/xmpp/internal/attr"
"mellium.im/xmpp/internal/ns"
"mellium.im/x... | go | BSD-2-Clause | a3dd6d7ce77932826d4d1683a9bd5d884226339e | 2026-01-07T09:45:51.690808Z | false |
mellium/xmpp | https://github.com/mellium/xmpp/blob/a3dd6d7ce77932826d4d1683a9bd5d884226339e/sasl_integration_test.go | sasl_integration_test.go | // Copyright 2020 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.
//go:build integration
// +build integration
package xmpp_test
import (
"context"
"crypto/tls"
"testing"
"mellium.im/sasl"
"mellium.im/xmpp"
"mellium.im/xmpp... | go | BSD-2-Clause | a3dd6d7ce77932826d4d1683a9bd5d884226339e | 2026-01-07T09:45:51.690808Z | false |
mellium/xmpp | https://github.com/mellium/xmpp/blob/a3dd6d7ce77932826d4d1683a9bd5d884226339e/error_test.go | error_test.go | // Copyright 2020 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.
package xmpp
// Errors used in the SASL package that are needed in tests (but should not be
// exported outside of testing).
var (
ErrNoMechanisms = errNoMecha... | go | BSD-2-Clause | a3dd6d7ce77932826d4d1683a9bd5d884226339e | 2026-01-07T09:45:51.690808Z | false |
mellium/xmpp | https://github.com/mellium/xmpp/blob/a3dd6d7ce77932826d4d1683a9bd5d884226339e/session_presence.go | session_presence.go | // Copyright 2021 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.
package xmpp
import (
"context"
"encoding/xml"
"fmt"
"mellium.im/xmlstream"
"mellium.im/xmpp/internal/attr"
"mellium.im/xmpp/internal/marshal"
"mellium.im/xm... | go | BSD-2-Clause | a3dd6d7ce77932826d4d1683a9bd5d884226339e | 2026-01-07T09:45:51.690808Z | false |
mellium/xmpp | https://github.com/mellium/xmpp/blob/a3dd6d7ce77932826d4d1683a9bd5d884226339e/session_iq_test.go | session_iq_test.go | // Copyright 2024 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.
package xmpp_test
import (
"context"
"encoding/xml"
"testing"
"mellium.im/xmlstream"
"mellium.im/xmpp/internal/xmpptest"
"mellium.im/xmpp/ping"
"mellium.im/x... | go | BSD-2-Clause | a3dd6d7ce77932826d4d1683a9bd5d884226339e | 2026-01-07T09:45:51.690808Z | false |
mellium/xmpp | https://github.com/mellium/xmpp/blob/a3dd6d7ce77932826d4d1683a9bd5d884226339e/session_message_test.go | session_message_test.go | // Copyright 2021 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.
package xmpp_test
import (
"context"
"encoding/xml"
"strconv"
"testing"
"time"
"mellium.im/xmlstream"
"mellium.im/xmpp/internal/xmpptest"
"mellium.im/xmpp/s... | go | BSD-2-Clause | a3dd6d7ce77932826d4d1683a9bd5d884226339e | 2026-01-07T09:45:51.690808Z | false |
mellium/xmpp | https://github.com/mellium/xmpp/blob/a3dd6d7ce77932826d4d1683a9bd5d884226339e/sasl.go | sasl.go | // Copyright 2016 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.
package xmpp
import (
"context"
"encoding/base64"
"encoding/xml"
"errors"
"io"
"mellium.im/sasl"
"mellium.im/xmlstream"
"mellium.im/xmpp/internal/ns"
"mell... | go | BSD-2-Clause | a3dd6d7ce77932826d4d1683a9bd5d884226339e | 2026-01-07T09:45:51.690808Z | false |
mellium/xmpp | https://github.com/mellium/xmpp/blob/a3dd6d7ce77932826d4d1683a9bd5d884226339e/conn.go | conn.go | // Copyright 2018 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.
package xmpp
import (
"context"
"crypto/tls"
"io"
"net"
"time"
)
var _ tlsConn = (*teeConn)(nil)
var _ tlsConn = (*conn)(nil)
type tlsConn interface {
Connec... | go | BSD-2-Clause | a3dd6d7ce77932826d4d1683a9bd5d884226339e | 2026-01-07T09:45:51.690808Z | false |
mellium/xmpp | https://github.com/mellium/xmpp/blob/a3dd6d7ce77932826d4d1683a9bd5d884226339e/sessionstate_string.go | sessionstate_string.go | // Code generated by "stringer -type=SessionState"; DO NOT EDIT.
package xmpp
import "strconv"
const (
_SessionState_name_0 = "SecureAuthn"
_SessionState_name_1 = "Ready"
_SessionState_name_2 = "Received"
_SessionState_name_3 = "OutputStreamClosed"
_SessionState_name_4 = "InputStreamClosed"
_SessionState_name_... | go | BSD-2-Clause | a3dd6d7ce77932826d4d1683a9bd5d884226339e | 2026-01-07T09:45:51.690808Z | false |
mellium/xmpp | https://github.com/mellium/xmpp/blob/a3dd6d7ce77932826d4d1683a9bd5d884226339e/session_message.go | session_message.go | // Copyright 2021 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.
package xmpp
import (
"context"
"encoding/xml"
"fmt"
"mellium.im/xmlstream"
"mellium.im/xmpp/internal/attr"
"mellium.im/xmpp/internal/marshal"
"mellium.im/xm... | go | BSD-2-Clause | a3dd6d7ce77932826d4d1683a9bd5d884226339e | 2026-01-07T09:45:51.690808Z | false |
mellium/xmpp | https://github.com/mellium/xmpp/blob/a3dd6d7ce77932826d4d1683a9bd5d884226339e/session.go | session.go | // Copyright 2016 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.
//go:generate go run -tags=tools golang.org/x/tools/cmd/stringer -type=SessionState
package xmpp
import (
"context"
"crypto/tls"
"encoding/xml"
"errors"
"fmt"
... | go | BSD-2-Clause | a3dd6d7ce77932826d4d1683a9bd5d884226339e | 2026-01-07T09:45:51.690808Z | false |
mellium/xmpp | https://github.com/mellium/xmpp/blob/a3dd6d7ce77932826d4d1683a9bd5d884226339e/starttls_test.go | starttls_test.go | // Copyright 2016 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.
package xmpp_test
import (
"bytes"
"context"
"crypto/tls"
"encoding/xml"
"fmt"
"io"
"strings"
"testing"
"mellium.im/xmpp"
"mellium.im/xmpp/internal/ns"
"... | go | BSD-2-Clause | a3dd6d7ce77932826d4d1683a9bd5d884226339e | 2026-01-07T09:45:51.690808Z | false |
mellium/xmpp | https://github.com/mellium/xmpp/blob/a3dd6d7ce77932826d4d1683a9bd5d884226339e/starttls.go | starttls.go | // Copyright 2016 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.
package xmpp
import (
"context"
"crypto/tls"
"encoding/xml"
"fmt"
"io"
"mellium.im/xmlstream"
"mellium.im/xmpp/internal/ns"
)
// StartTLS returns a new stre... | go | BSD-2-Clause | a3dd6d7ce77932826d4d1683a9bd5d884226339e | 2026-01-07T09:45:51.690808Z | false |
mellium/xmpp | https://github.com/mellium/xmpp/blob/a3dd6d7ce77932826d4d1683a9bd5d884226339e/handler.go | handler.go | // Copyright 2016 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.
package xmpp
import (
"encoding/xml"
"mellium.im/xmlstream"
)
// A Handler triggers events or responds to incoming elements in an XML stream.
type Handler interf... | go | BSD-2-Clause | a3dd6d7ce77932826d4d1683a9bd5d884226339e | 2026-01-07T09:45:51.690808Z | false |
mellium/xmpp | https://github.com/mellium/xmpp/blob/a3dd6d7ce77932826d4d1683a9bd5d884226339e/export_test.go | export_test.go | // Copyright 2019 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.
package xmpp
// Error values that have been exported only for tests in the xmpp_test package
// to compare against.
var (
ErrNotStart = errNotStart
)
| go | BSD-2-Clause | a3dd6d7ce77932826d4d1683a9bd5d884226339e | 2026-01-07T09:45:51.690808Z | false |
mellium/xmpp | https://github.com/mellium/xmpp/blob/a3dd6d7ce77932826d4d1683a9bd5d884226339e/send_test.go | send_test.go | // Copyright 2019 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.
package xmpp_test
import (
"bytes"
"context"
"crypto/rand"
"encoding/xml"
"errors"
"strconv"
"testing"
"time"
"mellium.im/xmlstream"
"mellium.im/xmpp"
"m... | go | BSD-2-Clause | a3dd6d7ce77932826d4d1683a9bd5d884226339e | 2026-01-07T09:45:51.690808Z | false |
mellium/xmpp | https://github.com/mellium/xmpp/blob/a3dd6d7ce77932826d4d1683a9bd5d884226339e/doc.go | doc.go | // Copyright 2014 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.
// Package xmpp provides functionality from the Extensible Messaging and
// Presence Protocol, sometimes known as "Jabber".
//
// This module is subdivided into sever... | go | BSD-2-Clause | a3dd6d7ce77932826d4d1683a9bd5d884226339e | 2026-01-07T09:45:51.690808Z | false |
mellium/xmpp | https://github.com/mellium/xmpp/blob/a3dd6d7ce77932826d4d1683a9bd5d884226339e/x509/x509.go | x509/x509.go | // Copyright 2017 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.
//
// Some code code in this file was copied from the Go crypto/x509 package:
//
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is g... | go | BSD-2-Clause | a3dd6d7ce77932826d4d1683a9bd5d884226339e | 2026-01-07T09:45:51.690808Z | false |
mellium/xmpp | https://github.com/mellium/xmpp/blob/a3dd6d7ce77932826d4d1683a9bd5d884226339e/x509/x509_test.go | x509/x509_test.go | // Copyright 2017 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.
package x509_test
import (
cryptox509 "crypto/x509"
"encoding/pem"
"fmt"
"testing"
"mellium.im/xmpp/x509"
)
type crtTest struct {
crtData string
srvNames ... | go | BSD-2-Clause | a3dd6d7ce77932826d4d1683a9bd5d884226339e | 2026-01-07T09:45:51.690808Z | false |
mellium/xmpp | https://github.com/mellium/xmpp/blob/a3dd6d7ce77932826d4d1683a9bd5d884226339e/pubsub/retract.go | pubsub/retract.go | // Copyright 2021 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.
package pubsub
import (
"context"
"encoding/xml"
"mellium.im/xmlstream"
"mellium.im/xmpp"
"mellium.im/xmpp/stanza"
)
// Delete removes an item from the pubsub... | go | BSD-2-Clause | a3dd6d7ce77932826d4d1683a9bd5d884226339e | 2026-01-07T09:45:51.690808Z | false |
mellium/xmpp | https://github.com/mellium/xmpp/blob/a3dd6d7ce77932826d4d1683a9bd5d884226339e/pubsub/create.go | pubsub/create.go | // Copyright 2021 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.
package pubsub
import (
"context"
"encoding/xml"
"mellium.im/xmlstream"
"mellium.im/xmpp"
"mellium.im/xmpp/form"
"mellium.im/xmpp/stanza"
)
// CreateNode add... | go | BSD-2-Clause | a3dd6d7ce77932826d4d1683a9bd5d884226339e | 2026-01-07T09:45:51.690808Z | false |
mellium/xmpp | https://github.com/mellium/xmpp/blob/a3dd6d7ce77932826d4d1683a9bd5d884226339e/pubsub/pubsub.go | pubsub/pubsub.go | // Copyright 2021 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.
package pubsub
import (
"context"
"encoding/xml"
"mellium.im/xmlstream"
"mellium.im/xmpp"
"mellium.im/xmpp/stanza"
)
type publishResponse struct {
XMLName xm... | go | BSD-2-Clause | a3dd6d7ce77932826d4d1683a9bd5d884226339e | 2026-01-07T09:45:51.690808Z | false |
mellium/xmpp | https://github.com/mellium/xmpp/blob/a3dd6d7ce77932826d4d1683a9bd5d884226339e/pubsub/fetch.go | pubsub/fetch.go | // Copyright 2021 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.
package pubsub
import (
"context"
"encoding/xml"
"strconv"
"mellium.im/xmlstream"
"mellium.im/xmpp"
"mellium.im/xmpp/paging"
"mellium.im/xmpp/stanza"
)
// Q... | go | BSD-2-Clause | a3dd6d7ce77932826d4d1683a9bd5d884226339e | 2026-01-07T09:45:51.690808Z | false |
mellium/xmpp | https://github.com/mellium/xmpp/blob/a3dd6d7ce77932826d4d1683a9bd5d884226339e/pubsub/conditions.go | pubsub/conditions.go | // Code generated by "genpubsub"; DO NOT EDIT.
package pubsub
import (
"encoding/xml"
)
// Condition is the underlying cause of a pubsub error.
type Condition uint32
// Valid pubsub Conditions.
const (
CondNone Condition = iota
CondClosedNode // closed-node
CondConfigRequ... | go | BSD-2-Clause | a3dd6d7ce77932826d4d1683a9bd5d884226339e | 2026-01-07T09:45:51.690808Z | false |
mellium/xmpp | https://github.com/mellium/xmpp/blob/a3dd6d7ce77932826d4d1683a9bd5d884226339e/pubsub/integration_test.go | pubsub/integration_test.go | // Copyright 2021 The Mellium Contributors.
// Use of this source code is governed by the BSD 2-clause
// license that can be found in the LICENSE file.
//go:build integration
// +build integration
package pubsub_test
import (
"context"
"crypto/tls"
"encoding/xml"
"strconv"
"testing"
"mellium.im/sasl"
"melli... | go | BSD-2-Clause | a3dd6d7ce77932826d4d1683a9bd5d884226339e | 2026-01-07T09:45:51.690808Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.