repo

package
v0.0.0-...-6df1bcc Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidSignature = fmt.Errorf("commit signature is not valid")
View Source
var ErrZeroBlocks = fmt.Errorf("zero blocks found")

Functions

func AutoMigrate

func AutoMigrate(db *gorm.DB) error

func ExtractRecords

func ExtractRecords(ctx context.Context, b io.Reader, signingKey string) (map[string]json.RawMessage, error)

func GetLang

func GetLang(ctx context.Context, value json.RawMessage) ([]string, time.Time, error)

func GetRev

func GetRev(ctx context.Context, b io.Reader) (string, error)

Types

type BadRecord

type BadRecord struct {
	ID        models.ID `gorm:"primarykey"`
	CreatedAt time.Time
	PDS       models.ID `gorm:"index"`
	Cursor    int64
	Error     string
	Content   []byte
}

type Record

type Record struct {
	ID         models.ID `gorm:"primarykey"`
	CreatedAt  time.Time
	UpdatedAt  time.Time       `gorm:"autoUpdateTime:false"`
	Repo       models.ID       `gorm:"index:idx_repo_record_key,unique,priority:1;not null;index:idx_repo_rev"`
	Collection string          `gorm:"index:idx_repo_record_key,unique,priority:2;not null"`
	Rkey       string          `gorm:"index:idx_repo_record_key,unique,priority:3"`
	AtRev      string          `gorm:"index:idx_repo_rev"`
	Content    json.RawMessage `gorm:"type:JSONB"`
	Deleted    bool            `gorm:"default:false"`
}

type Repo

type Repo struct {
	ID                    models.ID `gorm:"primarykey"`
	CreatedAt             time.Time
	UpdatedAt             time.Time
	PDS                   models.ID `` /* 297-byte string literal not displayed */
	DID                   string    `gorm:"uniqueIndex;column:did"`
	LastIndexedRev        string    `` /* 185-byte string literal not displayed */
	FirstRevSinceReset    string
	LastFirehoseRev       string
	FirstCursorSinceReset int64 `gorm:"index:indexed_count,priority:2"`
	TombstonedAt          time.Time
	LastIndexAttempt      time.Time
	LastError             string
	FailedAttempts        int `gorm:"default:0"`
	LastKnownKey          string
}

func EnsureExists

func EnsureExists(ctx context.Context, db *gorm.DB, did string) (*Repo, bool, error)

type SignatureValidator

type SignatureValidator func(digest []byte, sig []byte) (bool, error)

Jump to

Keyboard shortcuts

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