mapping

package
v1.64.1 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package mapping turns index rows into the protos and structs the rest of goback speaks. The generated mapper asserts against Mapper, which would be an import cycle if the interface lived in package sql.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base

func Base(p string) []byte

Base is the name component of a stored path.

func KeyID

func KeyID(stored *string) []byte

KeyID is a stored commit key id: nil when the commit records none, empty but not nil when it records a plain commit.

func Nanos

func Nanos(t *time.Time) int64

Nanos is a stored time in nanoseconds since the Unix epoch, 0 for none.

func NodeType

func NodeType(t uint32) proto.NodeType

NodeType is a stored node type.

func Open

func Open(validUntil *time.Time) bool

Open is whether a version has no end yet.

func Owner

func Owner(stored string) []byte

Owner is a stored user or group name, which an encrypted store keeps sealed.

func Ref

func Ref(hash []byte) *proto.Ref

Ref wraps a stored hash, nil for none.

func SetState

func SetState(s set.State) proto.SetState

SetState is a stored set state as policies record it.

func Sum

func Sum(hash []byte) [proto.HashSize]byte

Sum is a stored hash as an index record sum.

Types

type Mapper

type Mapper interface {
	// field:Timestamp method:"Unix"
	// field:ReceivedAtNs from:"ReceivedAt" method:"UnixNano"
	// field:Tree using:"Ref"
	// field:BackupSet from:"Edges.Set.Name"
	// field:Parent using:"Ref"
	// field:KeyId from:"KeyID" using:"KeyID"
	Commit(in *ent.CommitRow) *proto.Commit

	// field:Stat from:"."
	// field:Ref using:"Ref"
	TreeNode(in *ent.File) *proto.TreeNode

	// field:Name from:"Path" using:"Base"
	// field:User using:"Owner"
	// field:Group using:"Owner"
	// field:Type using:"NodeType"
	FileInfo(in *ent.File) *proto.FileInfo

	// field:Ref using:"Ref"
	// field:Target using:"Ref"
	// field:ReceivedAtNs from:"ReceivedAt" method:"UnixNano"
	Pin(in *ent.Pin) *proto.PinInfo

	// field:Set from:"BackupSet"
	// field:Restore from:"RestoreRef" using:"Ref"
	// field:Started from:"StartedAt"
	Session(in *ent.Session) *backup.Session

	// field:Name from:"ID"
	// field:Session from:"SessionID"
	// field:Created from:"CreatedAt"
	Archive(in *ent.Archive) pack.ArchiveInfo

	// field:Archive from:"ArchiveID"
	// field:Record from:"."
	Location(in *ent.Object) pack.IndexLocation

	// field:Sum from:"Ref" using:"Sum"
	// field:Offset from:"Start"
	Record(in *ent.Object) pack.IndexRecord

	Set(in *ent.Set) index.SetInfo

	// field:Commit from:"."
	// field:Ref using:"Ref"
	// field:Files from:"FileCount"
	CommitDetail(in *ent.CommitRow) index.CommitDetail

	// field:Ref using:"Ref"
	// field:Commit from:"."
	// field:Size from:"."
	// field:DeletedAtNs from:"DeletedAt" using:"Nanos"
	// field:ExpiresAtNs from:"ExpiresAt" using:"Nanos"
	TrashedCommit(in *ent.CommitRow) *proto.TrashedCommit

	// field:LogicalBytes from:"LogicalSize"
	// field:Files from:"FileCount"
	CommitSize(in *ent.CommitRow) *proto.CommitSize

	// field:Node from:"."
	// field:From from:"ValidFrom"
	Version(in *ent.File) index.Version

	// field:Ref using:"Ref"
	// field:Set from:"-"
	// field:Open from:"ValidUntil" using:"Open"
	FilePath(in *ent.File) backup.FilePath

	// field:WritePolicy from:"Policy"
	// field:WritePolicyVersion from:"PolicyVersion"
	// field:KeyAcknowledgedAtNs from:"KeyAcknowledgedAt" using:"Nanos"
	// field:DefaultRetention from:"RetentionPolicy"
	// field:HoldDays from:"-"
	StoreScope(in *ent.Settings) *proto.StoreScope

	// field:SetId from:"ID"
	// field:Retention from:"RetentionPolicy"
	// field:State using:"SetState"
	// field:ClosedAtNs from:"-"
	SetScope(in *ent.Set) *proto.SetScope
}

mapper:generate

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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