storage

package
v0.40.7 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const LocalInstallID = "local"

Variables

View Source
var (
	ErrScopeUserRequired   = errors.New("speechkit storage: user scope is required")
	ErrScopeTenantRequired = errors.New("speechkit storage: tenant scope is required")
)

Functions

func NormalizeBackendName

func NormalizeBackendName(name string) string

func NormalizeIdentifier

func NormalizeIdentifier(value string) string

func WithScope

func WithScope(ctx context.Context, scope Scope) context.Context

Types

type BackendInfo

type BackendInfo struct {
	Name         string       `json:"name"`
	DisplayName  string       `json:"displayName,omitempty"`
	ScopePolicy  ScopePolicy  `json:"scopePolicy"`
	Capabilities Capabilities `json:"capabilities"`
}

type Capabilities

type Capabilities struct {
	Scopes       bool `json:"scopes"`
	AudioAssets  bool `json:"audioAssets"`
	FullText     bool `json:"fullText"`
	Embeddings   bool `json:"embeddings"`
	VectorSearch bool `json:"vectorSearch"`
}

type Config

type Config struct {
	Backend      string
	DefaultScope Scope
	ScopePolicy  ScopePolicy
	Options      map[string]string
}

type Factory

type Factory[T any] func(Config) (T, error)

type Registry

type Registry[T any] struct {
	// contains filtered or unexported fields
}

func NewRegistry

func NewRegistry[T any]() *Registry[T]

func (*Registry[T]) RegisterBackend

func (r *Registry[T]) RegisterBackend(name string, factory Factory[T]) error

type Scope

type Scope struct {
	InstallID string            `json:"installId,omitempty"`
	DeviceID  string            `json:"deviceId,omitempty"`
	UserID    string            `json:"userId,omitempty"`
	TenantID  string            `json:"tenantId,omitempty"`
	Labels    map[string]string `json:"labels,omitempty"`
}

func NormalizeScope

func NormalizeScope(scope Scope) Scope

func ScopeFromContext

func ScopeFromContext(ctx context.Context) Scope

func (Scope) Key

func (s Scope) Key() string

type ScopePolicy

type ScopePolicy string
const (
	ScopeOptional       ScopePolicy = "optional"
	ScopeUserRequired   ScopePolicy = "user-required"
	ScopeTenantRequired ScopePolicy = "tenant-required"
)

func (ScopePolicy) Validate

func (p ScopePolicy) Validate(scope Scope) error

Jump to

Keyboard shortcuts

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