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 |
|---|---|---|---|---|---|---|---|---|
jesseduffield/lazydocker | https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/go.opentelemetry.io/otel/internal/global/handler.go | vendor/go.opentelemetry.io/otel/internal/global/handler.go | // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
package global // import "go.opentelemetry.io/otel/internal/global"
import (
"log"
"sync/atomic"
)
// ErrorHandler handles irremediable events.
type ErrorHandler interface {
// Handle handles any error deemed irremediable by an OpenTele... | go | MIT | f4fc3669ca8eb67aa350a76503397192bf26f057 | 2026-01-07T08:35:43.570558Z | false |
jesseduffield/lazydocker | https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/go.opentelemetry.io/otel/internal/global/meter.go | vendor/go.opentelemetry.io/otel/internal/global/meter.go | // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
package global // import "go.opentelemetry.io/otel/internal/global"
import (
"container/list"
"sync"
"sync/atomic"
"go.opentelemetry.io/otel/metric"
"go.opentelemetry.io/otel/metric/embedded"
)
// meterProvider is a placeholder for a... | go | MIT | f4fc3669ca8eb67aa350a76503397192bf26f057 | 2026-01-07T08:35:43.570558Z | false |
jesseduffield/lazydocker | https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go | vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go | // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
/*
Package baggage provides base types and functionality to store and retrieve
baggage in Go context. This package exists because the OpenTracing bridge to
OpenTelemetry needs to synchronize state whenever baggage for a context is
modified a... | go | MIT | f4fc3669ca8eb67aa350a76503397192bf26f057 | 2026-01-07T08:35:43.570558Z | false |
jesseduffield/lazydocker | https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/go.opentelemetry.io/otel/internal/baggage/context.go | vendor/go.opentelemetry.io/otel/internal/baggage/context.go | // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
package baggage // import "go.opentelemetry.io/otel/internal/baggage"
import "context"
type baggageContextKeyType int
const baggageKey baggageContextKeyType = iota
// SetHookFunc is a callback called when storing baggage in the context.
... | go | MIT | f4fc3669ca8eb67aa350a76503397192bf26f057 | 2026-01-07T08:35:43.570558Z | false |
jesseduffield/lazydocker | https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go | vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go | // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
/*
Package attribute provide several helper functions for some commonly used
logic of processing attributes.
*/
package attribute // import "go.opentelemetry.io/otel/internal/attribute"
import (
"reflect"
)
// BoolSliceValue converts a bo... | go | MIT | f4fc3669ca8eb67aa350a76503397192bf26f057 | 2026-01-07T08:35:43.570558Z | false |
jesseduffield/lazydocker | https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/go.opentelemetry.io/otel/propagation/baggage.go | vendor/go.opentelemetry.io/otel/propagation/baggage.go | // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
package propagation // import "go.opentelemetry.io/otel/propagation"
import (
"context"
"go.opentelemetry.io/otel/baggage"
)
const baggageHeader = "baggage"
// Baggage is a propagator that supports the W3C Baggage format.
//
// This pr... | go | MIT | f4fc3669ca8eb67aa350a76503397192bf26f057 | 2026-01-07T08:35:43.570558Z | false |
jesseduffield/lazydocker | https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/go.opentelemetry.io/otel/propagation/doc.go | vendor/go.opentelemetry.io/otel/propagation/doc.go | // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
/*
Package propagation contains OpenTelemetry context propagators.
OpenTelemetry propagators are used to extract and inject context data from and
into messages exchanged by applications. The propagator supported by this
package is the W3C T... | go | MIT | f4fc3669ca8eb67aa350a76503397192bf26f057 | 2026-01-07T08:35:43.570558Z | false |
jesseduffield/lazydocker | https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/go.opentelemetry.io/otel/propagation/trace_context.go | vendor/go.opentelemetry.io/otel/propagation/trace_context.go | // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
package propagation // import "go.opentelemetry.io/otel/propagation"
import (
"context"
"encoding/hex"
"fmt"
"strings"
"go.opentelemetry.io/otel/trace"
)
const (
supportedVersion = 0
maxVersion = 254
traceparentHeader = "t... | go | MIT | f4fc3669ca8eb67aa350a76503397192bf26f057 | 2026-01-07T08:35:43.570558Z | false |
jesseduffield/lazydocker | https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/go.opentelemetry.io/otel/propagation/propagation.go | vendor/go.opentelemetry.io/otel/propagation/propagation.go | // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
package propagation // import "go.opentelemetry.io/otel/propagation"
import (
"context"
"net/http"
)
// TextMapCarrier is the storage medium used by a TextMapPropagator.
type TextMapCarrier interface {
// DO NOT CHANGE: any modification... | go | MIT | f4fc3669ca8eb67aa350a76503397192bf26f057 | 2026-01-07T08:35:43.570558Z | false |
jesseduffield/lazydocker | https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/go.opentelemetry.io/otel/attribute/kv.go | vendor/go.opentelemetry.io/otel/attribute/kv.go | // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
package attribute // import "go.opentelemetry.io/otel/attribute"
import (
"fmt"
)
// KeyValue holds a key and value pair.
type KeyValue struct {
Key Key
Value Value
}
// Valid returns if kv is a valid OpenTelemetry attribute.
func (k... | go | MIT | f4fc3669ca8eb67aa350a76503397192bf26f057 | 2026-01-07T08:35:43.570558Z | false |
jesseduffield/lazydocker | https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/go.opentelemetry.io/otel/attribute/type_string.go | vendor/go.opentelemetry.io/otel/attribute/type_string.go | // Code generated by "stringer -type=Type"; DO NOT EDIT.
package attribute
import "strconv"
func _() {
// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
var x [1]struct{}
_ = x[INVALID-0]
_ = x[BOOL-1]
_ = x[INT64-... | go | MIT | f4fc3669ca8eb67aa350a76503397192bf26f057 | 2026-01-07T08:35:43.570558Z | false |
jesseduffield/lazydocker | https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/go.opentelemetry.io/otel/attribute/filter.go | vendor/go.opentelemetry.io/otel/attribute/filter.go | // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
package attribute // import "go.opentelemetry.io/otel/attribute"
// Filter supports removing certain attributes from attribute sets. When
// the filter returns true, the attribute will be kept in the filtered
// attribute set. When the filt... | go | MIT | f4fc3669ca8eb67aa350a76503397192bf26f057 | 2026-01-07T08:35:43.570558Z | false |
jesseduffield/lazydocker | https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/go.opentelemetry.io/otel/attribute/iterator.go | vendor/go.opentelemetry.io/otel/attribute/iterator.go | // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
package attribute // import "go.opentelemetry.io/otel/attribute"
// Iterator allows iterating over the set of attributes in order, sorted by
// key.
type Iterator struct {
storage *Set
idx int
}
// MergeIterator supports iterating ov... | go | MIT | f4fc3669ca8eb67aa350a76503397192bf26f057 | 2026-01-07T08:35:43.570558Z | false |
jesseduffield/lazydocker | https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/go.opentelemetry.io/otel/attribute/set.go | vendor/go.opentelemetry.io/otel/attribute/set.go | // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
package attribute // import "go.opentelemetry.io/otel/attribute"
import (
"cmp"
"encoding/json"
"reflect"
"slices"
"sort"
)
type (
// Set is the representation for a distinct attribute set. It manages an
// immutable set of attribut... | go | MIT | f4fc3669ca8eb67aa350a76503397192bf26f057 | 2026-01-07T08:35:43.570558Z | false |
jesseduffield/lazydocker | https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/go.opentelemetry.io/otel/attribute/value.go | vendor/go.opentelemetry.io/otel/attribute/value.go | // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
package attribute // import "go.opentelemetry.io/otel/attribute"
import (
"encoding/json"
"fmt"
"reflect"
"strconv"
"go.opentelemetry.io/otel/internal"
"go.opentelemetry.io/otel/internal/attribute"
)
//go:generate stringer -type=Typ... | go | MIT | f4fc3669ca8eb67aa350a76503397192bf26f057 | 2026-01-07T08:35:43.570558Z | false |
jesseduffield/lazydocker | https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/go.opentelemetry.io/otel/attribute/doc.go | vendor/go.opentelemetry.io/otel/attribute/doc.go | // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
// Package attribute provides key and value attributes.
package attribute // import "go.opentelemetry.io/otel/attribute"
| go | MIT | f4fc3669ca8eb67aa350a76503397192bf26f057 | 2026-01-07T08:35:43.570558Z | false |
jesseduffield/lazydocker | https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/go.opentelemetry.io/otel/attribute/key.go | vendor/go.opentelemetry.io/otel/attribute/key.go | // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
package attribute // import "go.opentelemetry.io/otel/attribute"
// Key represents the key part in key-value pairs. It's a string. The
// allowed character set in the key depends on the use of the key.
type Key string
// Bool creates a Key... | go | MIT | f4fc3669ca8eb67aa350a76503397192bf26f057 | 2026-01-07T08:35:43.570558Z | false |
jesseduffield/lazydocker | https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/go.opentelemetry.io/otel/attribute/encoder.go | vendor/go.opentelemetry.io/otel/attribute/encoder.go | // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
package attribute // import "go.opentelemetry.io/otel/attribute"
import (
"bytes"
"sync"
"sync/atomic"
)
type (
// Encoder is a mechanism for serializing an attribute set into a specific
// string representation that supports caching,... | go | MIT | f4fc3669ca8eb67aa350a76503397192bf26f057 | 2026-01-07T08:35:43.570558Z | false |
jesseduffield/lazydocker | https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/attribute_group.go | vendor/go.opentelemetry.io/otel/semconv/v1.20.0/attribute_group.go | // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
// Code generated from semantic convention specification. DO NOT EDIT.
package semconv // import "go.opentelemetry.io/otel/semconv/v1.20.0"
import "go.opentelemetry.io/otel/attribute"
// Describes HTTP attributes.
const (
// HTTPMethodKe... | go | MIT | f4fc3669ca8eb67aa350a76503397192bf26f057 | 2026-01-07T08:35:43.570558Z | true |
jesseduffield/lazydocker | https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/trace.go | vendor/go.opentelemetry.io/otel/semconv/v1.20.0/trace.go | // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
// Code generated from semantic convention specification. DO NOT EDIT.
package semconv // import "go.opentelemetry.io/otel/semconv/v1.20.0"
import "go.opentelemetry.io/otel/attribute"
// The shared attributes used to report a single excep... | go | MIT | f4fc3669ca8eb67aa350a76503397192bf26f057 | 2026-01-07T08:35:43.570558Z | true |
jesseduffield/lazydocker | https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/http.go | vendor/go.opentelemetry.io/otel/semconv/v1.20.0/http.go | // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
package semconv // import "go.opentelemetry.io/otel/semconv/v1.20.0"
// HTTP scheme attributes.
var (
HTTPSchemeHTTP = HTTPSchemeKey.String("http")
HTTPSchemeHTTPS = HTTPSchemeKey.String("https")
)
| go | MIT | f4fc3669ca8eb67aa350a76503397192bf26f057 | 2026-01-07T08:35:43.570558Z | false |
jesseduffield/lazydocker | https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/resource.go | vendor/go.opentelemetry.io/otel/semconv/v1.20.0/resource.go | // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
// Code generated from semantic convention specification. DO NOT EDIT.
package semconv // import "go.opentelemetry.io/otel/semconv/v1.20.0"
import "go.opentelemetry.io/otel/attribute"
// The web browser in which the application represente... | go | MIT | f4fc3669ca8eb67aa350a76503397192bf26f057 | 2026-01-07T08:35:43.570558Z | true |
jesseduffield/lazydocker | https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/event.go | vendor/go.opentelemetry.io/otel/semconv/v1.20.0/event.go | // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
// Code generated from semantic convention specification. DO NOT EDIT.
package semconv // import "go.opentelemetry.io/otel/semconv/v1.20.0"
import "go.opentelemetry.io/otel/attribute"
// This semantic convention defines the attributes use... | go | MIT | f4fc3669ca8eb67aa350a76503397192bf26f057 | 2026-01-07T08:35:43.570558Z | false |
jesseduffield/lazydocker | https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/exception.go | vendor/go.opentelemetry.io/otel/semconv/v1.20.0/exception.go | // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
package semconv // import "go.opentelemetry.io/otel/semconv/v1.20.0"
const (
// ExceptionEventName is the name of the Span event representing an exception.
ExceptionEventName = "exception"
)
| go | MIT | f4fc3669ca8eb67aa350a76503397192bf26f057 | 2026-01-07T08:35:43.570558Z | false |
jesseduffield/lazydocker | https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/doc.go | vendor/go.opentelemetry.io/otel/semconv/v1.20.0/doc.go | // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
// Package semconv implements OpenTelemetry semantic conventions.
//
// OpenTelemetry semantic conventions are agreed standardized naming
// patterns for OpenTelemetry things. This package represents the conventions
// as of the v1.20.0 vers... | go | MIT | f4fc3669ca8eb67aa350a76503397192bf26f057 | 2026-01-07T08:35:43.570558Z | false |
jesseduffield/lazydocker | https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/schema.go | vendor/go.opentelemetry.io/otel/semconv/v1.20.0/schema.go | // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
package semconv // import "go.opentelemetry.io/otel/semconv/v1.20.0"
// SchemaURL is the schema URL that matches the version of the semantic conventions
// that this package defines. Semconv packages starting from v1.4.0 must declare
// non... | go | MIT | f4fc3669ca8eb67aa350a76503397192bf26f057 | 2026-01-07T08:35:43.570558Z | false |
jesseduffield/lazydocker | https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/metric.go | vendor/go.opentelemetry.io/otel/semconv/v1.24.0/metric.go | // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
// Code generated from semantic convention specification. DO NOT EDIT.
package semconv // import "go.opentelemetry.io/otel/semconv/v1.24.0"
const (
// DBClientConnectionsUsage is the metric conforming to the
// "db.client.connections.us... | go | MIT | f4fc3669ca8eb67aa350a76503397192bf26f057 | 2026-01-07T08:35:43.570558Z | true |
jesseduffield/lazydocker | https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/attribute_group.go | vendor/go.opentelemetry.io/otel/semconv/v1.24.0/attribute_group.go | // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
// Code generated from semantic convention specification. DO NOT EDIT.
package semconv // import "go.opentelemetry.io/otel/semconv/v1.24.0"
import "go.opentelemetry.io/otel/attribute"
// Describes FaaS attributes.
const (
// FaaSInvokedN... | go | MIT | f4fc3669ca8eb67aa350a76503397192bf26f057 | 2026-01-07T08:35:43.570558Z | true |
jesseduffield/lazydocker | https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/trace.go | vendor/go.opentelemetry.io/otel/semconv/v1.24.0/trace.go | // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
// Code generated from semantic convention specification. DO NOT EDIT.
package semconv // import "go.opentelemetry.io/otel/semconv/v1.24.0"
import "go.opentelemetry.io/otel/attribute"
// Operations that access some remote service.
const (... | go | MIT | f4fc3669ca8eb67aa350a76503397192bf26f057 | 2026-01-07T08:35:43.570558Z | true |
jesseduffield/lazydocker | https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/resource.go | vendor/go.opentelemetry.io/otel/semconv/v1.24.0/resource.go | // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
// Code generated from semantic convention specification. DO NOT EDIT.
package semconv // import "go.opentelemetry.io/otel/semconv/v1.24.0"
import "go.opentelemetry.io/otel/attribute"
// A cloud environment (e.g. GCP, Azure, AWS).
const (... | go | MIT | f4fc3669ca8eb67aa350a76503397192bf26f057 | 2026-01-07T08:35:43.570558Z | true |
jesseduffield/lazydocker | https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/event.go | vendor/go.opentelemetry.io/otel/semconv/v1.24.0/event.go | // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
// Code generated from semantic convention specification. DO NOT EDIT.
package semconv // import "go.opentelemetry.io/otel/semconv/v1.24.0"
import "go.opentelemetry.io/otel/attribute"
// This event represents an occurrence of a lifecycle ... | go | MIT | f4fc3669ca8eb67aa350a76503397192bf26f057 | 2026-01-07T08:35:43.570558Z | false |
jesseduffield/lazydocker | https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/exception.go | vendor/go.opentelemetry.io/otel/semconv/v1.24.0/exception.go | // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
package semconv // import "go.opentelemetry.io/otel/semconv/v1.24.0"
const (
// ExceptionEventName is the name of the Span event representing an exception.
ExceptionEventName = "exception"
)
| go | MIT | f4fc3669ca8eb67aa350a76503397192bf26f057 | 2026-01-07T08:35:43.570558Z | false |
jesseduffield/lazydocker | https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/doc.go | vendor/go.opentelemetry.io/otel/semconv/v1.24.0/doc.go | // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
// Package semconv implements OpenTelemetry semantic conventions.
//
// OpenTelemetry semantic conventions are agreed standardized naming
// patterns for OpenTelemetry things. This package represents the v1.24.0
// version of the OpenTelemet... | go | MIT | f4fc3669ca8eb67aa350a76503397192bf26f057 | 2026-01-07T08:35:43.570558Z | false |
jesseduffield/lazydocker | https://github.com/jesseduffield/lazydocker/blob/f4fc3669ca8eb67aa350a76503397192bf26f057/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/schema.go | vendor/go.opentelemetry.io/otel/semconv/v1.24.0/schema.go | // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
package semconv // import "go.opentelemetry.io/otel/semconv/v1.24.0"
// SchemaURL is the schema URL that matches the version of the semantic conventions
// that this package defines. Semconv packages starting from v1.4.0 must declare
// non... | go | MIT | f4fc3669ca8eb67aa350a76503397192bf26f057 | 2026-01-07T08:35:43.570558Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/cmd/memos/main.go | cmd/memos/main.go | package main
import (
"context"
"fmt"
"log/slog"
"net/http"
"os"
"os/signal"
"syscall"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/usememos/memos/internal/profile"
"github.com/usememos/memos/internal/version"
"github.com/usememos/memos/server"
"github.com/usememos/memos/store"
"github... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/storage/s3/s3.go | plugin/storage/s3/s3.go | package s3
import (
"context"
"io"
"time"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/credentials"
"github.com/aws/aws-sdk-go-v2/feature/s3/manager"
"github.com/aws/aws-sdk-go-v2/service/s3"
"github.com/pkg/errors"
storepb "github.com/usememos/memo... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/httpgetter/html_meta_test.go | plugin/httpgetter/html_meta_test.go | package httpgetter
import (
"errors"
"testing"
"github.com/stretchr/testify/require"
)
func TestGetHTMLMeta(t *testing.T) {
tests := []struct {
urlStr string
htmlMeta HTMLMeta
}{}
for _, test := range tests {
metadata, err := GetHTMLMeta(test.urlStr)
require.NoError(t, err)
require.Equal(t, test.ht... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/httpgetter/image.go | plugin/httpgetter/image.go | package httpgetter
import (
"errors"
"io"
"net/http"
"net/url"
"strings"
)
type Image struct {
Blob []byte
Mediatype string
}
func GetImage(urlStr string) (*Image, error) {
if _, err := url.Parse(urlStr); err != nil {
return nil, err
}
response, err := http.Get(urlStr)
if err != nil {
return nil... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/httpgetter/util.go | plugin/httpgetter/util.go | package httpgetter
import (
"mime"
"net/http"
)
func getMediatype(response *http.Response) (string, error) {
contentType := response.Header.Get("content-type")
mediatype, _, err := mime.ParseMediaType(contentType)
if err != nil {
return "", err
}
return mediatype, nil
}
| go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/httpgetter/http_getter.go | plugin/httpgetter/http_getter.go | package httpgetter
| go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/httpgetter/html_meta.go | plugin/httpgetter/html_meta.go | package httpgetter
import (
"fmt"
"io"
"net"
"net/http"
"net/url"
"github.com/pkg/errors"
"golang.org/x/net/html"
"golang.org/x/net/html/atom"
)
var ErrInternalIP = errors.New("internal IP addresses are not allowed")
var httpClient = &http.Client{
CheckRedirect: func(req *http.Request, via []*http.Request)... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/filter/parser.go | plugin/filter/parser.go | package filter
import (
"time"
"github.com/pkg/errors"
exprv1 "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
)
func buildCondition(expr *exprv1.Expr, schema Schema) (Condition, error) {
switch v := expr.ExprKind.(type) {
case *exprv1.Expr_CallExpr:
return buildCallCondition(v.CallExpr, schema)
cas... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/filter/render.go | plugin/filter/render.go | package filter
import (
"fmt"
"strings"
"github.com/pkg/errors"
)
type renderer struct {
schema Schema
dialect DialectName
placeholderOffset int
placeholderCounter int
args []any
}
type renderResult struct {
sql string
trivial bool
unsatisfiable bool
... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/filter/engine.go | plugin/filter/engine.go | package filter
import (
"context"
"fmt"
"strings"
"sync"
"github.com/google/cel-go/cel"
"github.com/pkg/errors"
)
// Engine parses CEL filters into a dialect-agnostic condition tree.
type Engine struct {
schema Schema
env *cel.Env
}
// NewEngine builds a new Engine for the provided schema.
func NewEngine... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/filter/ir.go | plugin/filter/ir.go | package filter
// Condition represents a boolean expression derived from the CEL filter.
type Condition interface {
isCondition()
}
// LogicalOperator enumerates the supported logical operators.
type LogicalOperator string
const (
LogicalAnd LogicalOperator = "AND"
LogicalOr LogicalOperator = "OR"
)
// LogicalC... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/filter/helpers.go | plugin/filter/helpers.go | package filter
import (
"context"
"fmt"
)
// AppendConditions compiles the provided filters and appends the resulting SQL fragments and args.
func AppendConditions(ctx context.Context, engine *Engine, filters []string, dialect DialectName, where *[]string, args *[]any) error {
for _, filterStr := range filters {
... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/filter/schema.go | plugin/filter/schema.go | package filter
import (
"fmt"
"time"
"github.com/google/cel-go/cel"
"github.com/google/cel-go/common/types"
"github.com/google/cel-go/common/types/ref"
)
// DialectName enumerates supported SQL dialects.
type DialectName string
const (
DialectSQLite DialectName = "sqlite"
DialectMySQL DialectName = "mys... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/idp/idp.go | plugin/idp/idp.go | package idp
type IdentityProviderUserInfo struct {
Identifier string
DisplayName string
Email string
AvatarURL string
}
| go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/idp/oauth2/oauth2.go | plugin/idp/oauth2/oauth2.go | // Package oauth2 is the plugin for OAuth2 Identity Provider.
package oauth2
import (
"context"
"encoding/json"
"fmt"
"io"
"log/slog"
"net/http"
"github.com/pkg/errors"
"golang.org/x/oauth2"
"github.com/usememos/memos/plugin/idp"
storepb "github.com/usememos/memos/proto/gen/store"
)
// IdentityProvider re... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/idp/oauth2/oauth2_test.go | plugin/idp/oauth2/oauth2_test.go | package oauth2
import (
"context"
"encoding/json"
"fmt"
"io"
"net/http"
"net/http/httptest"
"net/url"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/usememos/memos/plugin/idp"
storepb "github.com/usememos/memos/proto/gen/store"
)
func TestNewIdentityProv... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/cron/parser.go | plugin/cron/parser.go | package cron
import (
"math"
"strconv"
"strings"
"time"
"github.com/pkg/errors"
)
// Configuration options for creating a parser. Most options specify which
// fields should be included, while others enable features. If a field is not
// included the parser will assume a default value. These options do not chan... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/cron/constantdelay.go | plugin/cron/constantdelay.go | package cron
import "time"
// ConstantDelaySchedule represents a simple recurring duty cycle, e.g. "Every 5 minutes".
// It does not support jobs more frequent than once a second.
type ConstantDelaySchedule struct {
Delay time.Duration
}
// Every returns a crontab Schedule that activates once every duration.
// Del... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/cron/cron.go | plugin/cron/cron.go | package cron
import (
"context"
"sort"
"sync"
"time"
)
// Cron keeps track of any number of entries, invoking the associated func as
// specified by the schedule. It may be started, stopped, and the entries may
// be inspected while running.
type Cron struct {
entries []*Entry
chain Chain
stop chan ... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/cron/option.go | plugin/cron/option.go | package cron
import (
"time"
)
// Option represents a modification to the default behavior of a Cron.
type Option func(*Cron)
// WithLocation overrides the timezone of the cron instance.
func WithLocation(loc *time.Location) Option {
return func(c *Cron) {
c.location = loc
}
}
// WithSeconds overrides the pars... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/cron/spec.go | plugin/cron/spec.go | package cron
import "time"
// SpecSchedule specifies a duty cycle (to the second granularity), based on a
// traditional crontab specification. It is computed initially and stored as bit sets.
type SpecSchedule struct {
Second, Minute, Hour, Dom, Month, Dow uint64
// Override location for this schedule.
Location ... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/cron/chain_test.go | plugin/cron/chain_test.go | //nolint:all
package cron
import (
"io"
"log"
"reflect"
"sync"
"testing"
"time"
)
func appendingJob(slice *[]int, value int) Job {
var m sync.Mutex
return FuncJob(func() {
m.Lock()
*slice = append(*slice, value)
m.Unlock()
})
}
func appendingWrapper(slice *[]int, value int) JobWrapper {
return func(j... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/cron/option_test.go | plugin/cron/option_test.go | //nolint:all
package cron
import (
"log"
"strings"
"testing"
"time"
)
func TestWithLocation(t *testing.T) {
c := New(WithLocation(time.UTC))
if c.location != time.UTC {
t.Errorf("expected UTC, got %v", c.location)
}
}
func TestWithParser(t *testing.T) {
var parser = NewParser(Dow)
c := New(WithParser(pars... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/cron/parser_test.go | plugin/cron/parser_test.go | //nolint:all
package cron
import (
"reflect"
"strings"
"testing"
"time"
)
var secondParser = NewParser(Second | Minute | Hour | Dom | Month | DowOptional | Descriptor)
func TestRange(t *testing.T) {
zero := uint64(0)
ranges := []struct {
expr string
min, max uint
expected uint64
err string
}{... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/cron/chain.go | plugin/cron/chain.go | package cron
import (
"errors"
"fmt"
"runtime"
"sync"
"time"
)
// JobWrapper decorates the given Job with some behavior.
type JobWrapper func(Job) Job
// Chain is a sequence of JobWrappers that decorates submitted jobs with
// cross-cutting behaviors like logging or synchronization.
type Chain struct {
wrapper... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/cron/spec_test.go | plugin/cron/spec_test.go | //nolint:all
package cron
import (
"strings"
"testing"
"time"
)
func TestActivation(t *testing.T) {
tests := []struct {
time, spec string
expected bool
}{
// Every fifteen minutes.
{"Mon Jul 9 15:00 2012", "0/15 * * * *", true},
{"Mon Jul 9 15:45 2012", "0/15 * * * *", true},
{"Mon Jul 9 15:40 2012... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/cron/cron_test.go | plugin/cron/cron_test.go | //nolint:all
package cron
import (
"bytes"
"fmt"
"log"
"strings"
"sync"
"sync/atomic"
"testing"
"time"
)
// Many tests schedule a job for every second, and then wait at most a second
// for it to run. This amount is just slightly larger than 1 second to
// compensate for a few milliseconds of runtime.
const ... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/cron/logger.go | plugin/cron/logger.go | package cron
import (
"io"
"log"
"os"
"strings"
"time"
)
// DefaultLogger is used by Cron if none is specified.
var DefaultLogger = PrintfLogger(log.New(os.Stdout, "cron: ", log.LstdFlags))
// DiscardLogger can be used by callers to discard all log messages.
var DiscardLogger = PrintfLogger(log.New(io.Discard, ... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/cron/constantdelay_test.go | plugin/cron/constantdelay_test.go | //nolint:all
package cron
import (
"testing"
"time"
)
func TestConstantDelayNext(t *testing.T) {
tests := []struct {
time string
delay time.Duration
expected string
}{
// Simple cases
{"Mon Jul 9 14:45 2012", 15*time.Minute + 50*time.Nanosecond, "Mon Jul 9 15:00 2012"},
{"Mon Jul 9 14:59 2012",... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/scheduler/parser.go | plugin/scheduler/parser.go | package scheduler
import (
"strconv"
"strings"
"time"
"github.com/pkg/errors"
)
// Schedule represents a parsed cron expression.
type Schedule struct {
seconds fieldMatcher // 0-59 (optional, for 6-field format)
minutes fieldMatcher // 0-59
hours fieldMatcher // 0-23
days fieldMatcher // 1-31
month... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/scheduler/job_test.go | plugin/scheduler/job_test.go | package scheduler
import (
"context"
"testing"
)
func TestJobDefinition(t *testing.T) {
callCount := 0
job := &Job{
Name: "test-job",
Handler: func(_ context.Context) error {
callCount++
return nil
},
}
if job.Name != "test-job" {
t.Errorf("expected name 'test-job', got %s", job.Name)
}
// Tes... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/scheduler/middleware.go | plugin/scheduler/middleware.go | package scheduler
import (
"context"
"time"
"github.com/pkg/errors"
)
// Middleware wraps a JobHandler to add cross-cutting behavior.
type Middleware func(JobHandler) JobHandler
// Chain combines multiple middleware into a single middleware.
// Middleware are applied in the order they're provided (left to right)... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/scheduler/job.go | plugin/scheduler/job.go | package scheduler
import (
"context"
"github.com/pkg/errors"
)
// JobHandler is the function signature for scheduled job handlers.
// The context passed to the handler will be canceled if the scheduler is shutting down.
type JobHandler func(ctx context.Context) error
// Job represents a scheduled task.
type Job s... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/scheduler/middleware_test.go | plugin/scheduler/middleware_test.go | package scheduler
import (
"context"
"errors"
"sync/atomic"
"testing"
)
func TestMiddlewareChaining(t *testing.T) {
var order []string
mw1 := func(next JobHandler) JobHandler {
return func(ctx context.Context) error {
order = append(order, "before-1")
err := next(ctx)
order = append(order, "after-1"... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/scheduler/parser_test.go | plugin/scheduler/parser_test.go | package scheduler
import (
"testing"
"time"
)
func TestParseCronExpression(t *testing.T) {
tests := []struct {
name string
expr string
wantErr bool
}{
// Standard 5-field format
{"every minute", "* * * * *", false},
{"hourly", "0 * * * *", false},
{"daily midnight", "0 0 * * *", false},
{"we... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/scheduler/scheduler_test.go | plugin/scheduler/scheduler_test.go | package scheduler
import (
"context"
"fmt"
"strings"
"sync"
"sync/atomic"
"testing"
"time"
)
func TestSchedulerCreation(t *testing.T) {
s := New()
if s == nil {
t.Fatal("New() returned nil")
}
}
func TestSchedulerWithTimezone(t *testing.T) {
s := New(WithTimezone("America/New_York"))
if s == nil {
t.... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/scheduler/example_test.go | plugin/scheduler/example_test.go | package scheduler_test
import (
"context"
"fmt"
"log/slog"
"os"
"time"
"github.com/usememos/memos/plugin/scheduler"
)
// Example demonstrates basic scheduler usage.
func Example_basic() {
s := scheduler.New()
s.Register(&scheduler.Job{
Name: "hello",
Schedule: "*/5 * * * *", // Every 5 minutes... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/scheduler/integration_test.go | plugin/scheduler/integration_test.go | package scheduler_test
import (
"context"
"errors"
"fmt"
"strings"
"sync"
"sync/atomic"
"testing"
"time"
"github.com/usememos/memos/plugin/scheduler"
)
// TestRealWorldScenario tests a realistic multi-job scenario.
func TestRealWorldScenario(t *testing.T) {
var (
quickJobCount atomic.Int32
hourlyJobCo... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/scheduler/scheduler.go | plugin/scheduler/scheduler.go | package scheduler
import (
"context"
"sync"
"time"
"github.com/pkg/errors"
)
// Scheduler manages scheduled jobs.
type Scheduler struct {
jobs map[string]*registeredJob
jobsMu sync.RWMutex
timezone *time.Location
middleware Middleware
running bool
runningMu sync.RWMutex
stopCh chan str... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/scheduler/doc.go | plugin/scheduler/doc.go | // Package scheduler provides a GitHub Actions-inspired cron job scheduler.
//
// Features:
// - Standard cron expression syntax (5-field and 6-field formats)
// - Timezone-aware scheduling
// - Middleware pattern for cross-cutting concerns (logging, metrics, recovery)
// - Graceful shutdown with context cancel... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/webhook/webhook.go | plugin/webhook/webhook.go | package webhook
import (
"bytes"
"encoding/json"
"io"
"log/slog"
"net/http"
"time"
"github.com/pkg/errors"
v1pb "github.com/usememos/memos/proto/gen/api/v1"
)
var (
// timeout is the timeout for webhook request. Default to 30 seconds.
timeout = 30 * time.Second
)
type WebhookRequestPayload struct {
// T... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/webhook/webhook_test.go | plugin/webhook/webhook_test.go | package webhook
| go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/email/client.go | plugin/email/client.go | package email
import (
"crypto/tls"
"net/smtp"
"github.com/pkg/errors"
)
// Client represents an SMTP email client.
type Client struct {
config *Config
}
// NewClient creates a new email client with the given configuration.
func NewClient(config *Config) *Client {
return &Client{
config: config,
}
}
// val... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/email/config.go | plugin/email/config.go | package email
import (
"fmt"
"github.com/pkg/errors"
)
// Config represents the SMTP configuration for email sending.
// These settings should be provided by the self-hosted instance administrator.
type Config struct {
// SMTPHost is the SMTP server hostname (e.g., "smtp.gmail.com")
SMTPHost string
// SMTPPort ... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/email/client_test.go | plugin/email/client_test.go | package email
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestNewClient(t *testing.T) {
config := &Config{
SMTPHost: "smtp.example.com",
SMTPPort: 587,
SMTPUsername: "user@example.com",
SMTPPassword: "password",
FromEmail: "noreply@example.com",
FromName: "Test App",
... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/email/email.go | plugin/email/email.go | package email
import (
"log/slog"
"github.com/pkg/errors"
)
// Send sends an email synchronously.
// Returns an error if the email fails to send.
func Send(config *Config, message *Message) error {
if config == nil {
return errors.New("email configuration is required")
}
if message == nil {
return errors.Ne... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/email/config_test.go | plugin/email/config_test.go | package email
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestConfigValidation(t *testing.T) {
tests := []struct {
name string
config *Config
wantErr bool
}{
{
name: "valid config",
config: &Config{
SMTPHost: "smtp.gmail.com",
SMTPPort: 587,
SMTPUsername: ... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/email/doc.go | plugin/email/doc.go | // Package email provides SMTP email sending functionality for self-hosted Memos instances.
//
// This package is designed for self-hosted environments where instance administrators
// configure their own SMTP servers. It follows industry-standard patterns used by
// platforms like GitHub, GitLab, and Discourse.
//
// ... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/email/message.go | plugin/email/message.go | package email
import (
"errors"
"fmt"
"strings"
"time"
)
// Message represents an email message to be sent.
type Message struct {
To []string // Required: recipient email addresses
Cc []string // Optional: carbon copy recipients
Bcc []string // Optional: blind carbon copy recipients
Subject stri... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/email/message_test.go | plugin/email/message_test.go | package email
import (
"strings"
"testing"
)
func TestMessageValidation(t *testing.T) {
tests := []struct {
name string
msg Message
wantErr bool
}{
{
name: "valid message",
msg: Message{
To: []string{"user@example.com"},
Subject: "Test Subject",
Body: "Test Body",
},
... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/email/email_test.go | plugin/email/email_test.go | package email
import (
"testing"
"time"
"github.com/stretchr/testify/assert"
"golang.org/x/sync/errgroup"
)
func TestSend(t *testing.T) {
config := &Config{
SMTPHost: "smtp.example.com",
SMTPPort: 587,
FromEmail: "test@example.com",
}
message := &Message{
To: []string{"recipient@example.com"},... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/markdown/markdown_test.go | plugin/markdown/markdown_test.go | package markdown
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestNewService(t *testing.T) {
svc := NewService()
assert.NotNil(t, svc)
}
func TestValidateContent(t *testing.T) {
svc := NewService()
tests := []struct {
name string
content string
... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/markdown/markdown.go | plugin/markdown/markdown.go | package markdown
import (
"bytes"
"strings"
"github.com/yuin/goldmark"
gast "github.com/yuin/goldmark/ast"
"github.com/yuin/goldmark/extension"
east "github.com/yuin/goldmark/extension/ast"
"github.com/yuin/goldmark/parser"
"github.com/yuin/goldmark/text"
mast "github.com/usememos/memos/plugin/markdown/ast"... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/markdown/renderer/markdown_renderer.go | plugin/markdown/renderer/markdown_renderer.go | package renderer
import (
"bytes"
"fmt"
"strings"
gast "github.com/yuin/goldmark/ast"
east "github.com/yuin/goldmark/extension/ast"
mast "github.com/usememos/memos/plugin/markdown/ast"
)
// MarkdownRenderer renders goldmark AST back to markdown text.
type MarkdownRenderer struct {
buf *bytes.Buffer
}
// New... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/markdown/renderer/markdown_renderer_test.go | plugin/markdown/renderer/markdown_renderer_test.go | package renderer
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/yuin/goldmark"
"github.com/yuin/goldmark/extension"
"github.com/yuin/goldmark/parser"
"github.com/yuin/goldmark/text"
"github.com/usememos/memos/plugin/markdown/extensions"
)
func TestM... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/markdown/extensions/tag.go | plugin/markdown/extensions/tag.go | package extensions
import (
"github.com/yuin/goldmark"
"github.com/yuin/goldmark/parser"
"github.com/yuin/goldmark/util"
mparser "github.com/usememos/memos/plugin/markdown/parser"
)
type tagExtension struct{}
// TagExtension is a goldmark extension for #tag syntax.
var TagExtension = &tagExtension{}
// Extend ... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/markdown/ast/tag.go | plugin/markdown/ast/tag.go | package ast
import (
gast "github.com/yuin/goldmark/ast"
)
// TagNode represents a #tag in the markdown AST.
type TagNode struct {
gast.BaseInline
// Tag name without the # prefix
Tag []byte
}
// KindTag is the NodeKind for TagNode.
var KindTag = gast.NewNodeKind("Tag")
// Kind returns KindTag.
func (*TagNode)... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/markdown/parser/tag_test.go | plugin/markdown/parser/tag_test.go | package parser
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/yuin/goldmark/parser"
"github.com/yuin/goldmark/text"
mast "github.com/usememos/memos/plugin/markdown/ast"
)
func TestTagParser(t *testing.T) {
tests := []struct {
name string
i... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/plugin/markdown/parser/tag.go | plugin/markdown/parser/tag.go | package parser
import (
"unicode"
"unicode/utf8"
gast "github.com/yuin/goldmark/ast"
"github.com/yuin/goldmark/parser"
"github.com/yuin/goldmark/text"
mast "github.com/usememos/memos/plugin/markdown/ast"
)
const (
// MaxTagLength defines the maximum number of runes allowed in a tag.
MaxTagLength = 100
)
ty... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/store/memo.pb.go | proto/gen/store/memo.pb.go | // Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc (unknown)
// source: store/memo.proto
package store
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sy... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/store/attachment.pb.go | proto/gen/store/attachment.pb.go | // Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc (unknown)
// source: store/attachment.proto
package store
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
timestamppb "google.g... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/store/idp.pb.go | proto/gen/store/idp.pb.go | // Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc (unknown)
// source: store/idp.proto
package store
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "syn... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/store/user_setting.pb.go | proto/gen/store/user_setting.pb.go | // Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc (unknown)
// source: store/user_setting.proto
package store
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
timestamppb "google... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | true |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/store/activity.pb.go | proto/gen/store/activity.pb.go | // Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc (unknown)
// source: store/activity.proto
package store
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/store/instance_setting.pb.go | proto/gen/store/instance_setting.pb.go | // Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc (unknown)
// source: store/instance_setting.proto
package store
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflec... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
usememos/memos | https://github.com/usememos/memos/blob/e75862de31b65f90007d771fd623e1d23261b2c6/proto/gen/store/inbox.pb.go | proto/gen/store/inbox.pb.go | // Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.11
// protoc (unknown)
// source: store/inbox.proto
package store
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "s... | go | MIT | e75862de31b65f90007d771fd623e1d23261b2c6 | 2026-01-07T08:35:43.552360Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.