revision

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RevisionID

func RevisionID(data []byte) string

Types

type Metadata

type Metadata struct {
	ID          string    `json:"id"`
	ParentID    string    `json:"parent_id,omitempty"`
	ParentIDs   []string  `json:"parent_ids,omitempty"`
	ContentHash string    `json:"content_hash"`
	CreatedAt   time.Time `json:"created_at"`
}

type PeerAck

type PeerAck struct {
	Fingerprint    string    `json:"fingerprint"`
	RevisionID     string    `json:"revision_id"`
	AcknowledgedAt time.Time `json:"acknowledged_at"`
}

type State

type State struct {
	CurrentRevisionID  string `json:"current_revision_id"`
	CurrentContentHash string `json:"current_content_hash"`
}

type Store

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

func New

func New() (*Store, error)

func (*Store) Ancestors

func (s *Store) Ancestors(projectID, revisionID string, limit int) ([]string, error)

func (*Store) Current

func (s *Store) Current(projectID string) (*State, error)

func (*Store) HasRevision

func (s *Store) HasRevision(projectID, revisionID string) (bool, error)

func (*Store) LoadPeerAcks

func (s *Store) LoadPeerAcks(projectID string) (map[string]PeerAck, error)

func (*Store) LoadRevision

func (s *Store) LoadRevision(projectID, revisionID string, key [32]byte) ([]byte, error)

func (*Store) MarkCurrent

func (s *Store) MarkCurrent(projectID, revisionID string, data []byte) error

func (*Store) MarkPeerAck

func (s *Store) MarkPeerAck(projectID, fingerprint, revisionID string) error

func (*Store) Metadata

func (s *Store) Metadata(projectID, revisionID string) (*Metadata, error)

func (*Store) NearestCommonAncestor

func (s *Store) NearestCommonAncestor(projectID, currentRevisionID string, candidates []string) (string, error)

func (*Store) PeerAck

func (s *Store) PeerAck(projectID, fingerprint string) (*PeerAck, error)

func (*Store) SaveRevision

func (s *Store) SaveRevision(projectID, revisionID, parentID string, data []byte, key [32]byte) (*Metadata, error)

func (*Store) SaveRevisionWithParents

func (s *Store) SaveRevisionWithParents(projectID, revisionID string, parentIDs []string, data []byte, key [32]byte) (*Metadata, error)

func (*Store) SyncCurrent

func (s *Store) SyncCurrent(projectID string, data []byte, key [32]byte) (*Metadata, error)

Jump to

Keyboard shortcuts

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