datastore

package
v7.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DriverSqlite   = "sqlite3"
	DriverMysql    = "mysql"
	DriverPostgres = "postgres"
)

Supported database drivers.

View Source
const MainForgeID = 1

MainForgeID is the ID of the forge a single-forge installation uses. Rows written before multi-forge support may carry an unset forge_id; they belong to this forge.

View Source
const (
	// SecondsPerDay represents the number of seconds in 24 hours.
	SecondsPerDay = 24 * 60 * 60 // 86400 seconds
)

Variables

View Source
var (
	ErrNoTokenProvided    = errors.New("please provide a token")
	ErrNoHostnameProvided = errors.New("please provide a hostname")
)
View Source
var ErrCacheNotFound = fmt.Errorf("cache entry not found")

ErrCacheNotFound is returned when a cache entry is not found.

Functions

func GetMaintenanceSizeInfo

func GetMaintenanceSizeInfo() (beforeSize, afterSize, spaceSaved int64)

GetMaintenanceSizeInfo returns the size info from the last maintenance operation.

func HashAccessToken

func HashAccessToken(token string) string

HashAccessToken creates a SHA256 hash of a token for storage.

func NewEngine

func NewEngine(opts *store.Opts) (store.Store, error)

func SupportedDriver

func SupportedDriver(driver string) bool

Types

type ErrorRepoNotExist

type ErrorRepoNotExist struct {
	RepoID int64
}

func (ErrorRepoNotExist) Error

func (e ErrorRepoNotExist) Error() string

func (ErrorRepoNotExist) Unwrap

func (ErrorRepoNotExist) Unwrap() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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