core

package module
v0.0.0-...-2d53558 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2026 License: MIT Imports: 7 Imported by: 3 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package core - core types like ID and Path.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidID = errors.New("invalid id format")
View Source
var ErrNotFound = errors.New("not found")

Functions

This section is empty.

Types

type ID

type ID struct {
	// contains filtered or unexported fields
}

func NewID

func NewID(code string) ID

func ParseID

func ParseID(s string) (ID, error)

ParseID parses a string into an ID.

func (ID) Compare

func (id ID) Compare(other ID) int

Compare returns -1 if id < other, 0 if id == other, 1 if id > other. IDs are compared lexicographically, which matches byte-order comparison because the encoding preserves sort order.

func (ID) Equal

func (id ID) Equal(other ID) bool

Equal returns true if this ID equals the other ID

func (ID) IsEmpty

func (id ID) IsEmpty() bool

IsEmpty returns true if the ID has no value set.

func (ID) MarshalText

func (id ID) MarshalText() ([]byte, error)

func (*ID) Scan

func (id *ID) Scan(src any) error

Scan implements sql.Scanner for SQL retrieval (reads from text)

func (ID) String

func (id ID) String() string

func (*ID) UnmarshalText

func (id *ID) UnmarshalText(data []byte) error

func (ID) Value

func (id ID) Value() (driver.Value, error)

Value implements driver.Valuer for SQL storage (stores as text)

type Page

type Page[T any] struct {
	Items  []T
	Cursor string
}

type PageReq

type PageReq struct {
	Limit  int
	Cursor string
}

type Path

type Path string

func (Path) Contains

func (p Path) Contains(other Path) bool

Contains reports whether p equals or is an ancestor of other. An empty path contains nothing.

func (Path) Parent

func (p Path) Parent() Path

func (Path) Root

func (p Path) Root() string

Root returns the first segment of the path, or "" if empty.

func (Path) Segments

func (p Path) Segments() []string

Segments returns all path segments.

func (Path) Valid

func (p Path) Valid() error

Source Files

  • core.go
  • id.go

Directories

Path Synopsis
Package assert - lightweight test assertion helpers.
Package assert - lightweight test assertion helpers.
Package config reads an app's config into a struct from three sources, each overriding the one before: TOML files, the environment, and key=value pairs from a command-line flag.
Package config reads an app's config into a struct from three sources, each overriding the one before: TOML files, the environment, and key=value pairs from a command-line flag.
Package dbi - database abstraction with transaction management and pagination helpers.
Package dbi - database abstraction with transaction management and pagination helpers.
Package envelope - envelope encryption of secrets at rest.
Package envelope - envelope encryption of secrets at rest.
Package iam - identity and access management interfaces for users, sessions, roles, grants, and tenants.
Package iam - identity and access management interfaces for users, sessions, roles, grants, and tenants.
Package metrics - in-process counters, gauges, and histograms with a bounded series count.
Package metrics - in-process counters, gauges, and histograms with a bounded series count.
Package secret refers to secrets by name and keeps their values from leaking.
Package secret refers to secrets by name and keeps their values from leaking.
secretfile
Package secretfile implements secret.Store as an encrypted file.
Package secretfile implements secret.Store as an encrypted file.
Package sessions - cookie sessions backed by a hashed-secret store.
Package sessions - cookie sessions backed by a hashed-secret store.
Package throttle - token bucket rate limiting.
Package throttle - token bucket rate limiting.
Package tokens - temporary token storage with expiration.
Package tokens - temporary token storage with expiration.
Package tracelog renders request-grouped logs as traces.
Package tracelog renders request-grouped logs as traces.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL