repomgr

package
v0.0.0-...-45ae864 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EvtKindCreateRecord = EventKind("createRecord")
	EvtKindUpdateRecord = EventKind("updateRecord")
	EvtKindDeleteRecord = EventKind("deleteRecord")
	EvtKindInitActor    = EventKind("initActor")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ActorInfo

type ActorInfo struct {
	Did         string
	Handle      string
	DisplayName string
	DeclRefCid  string
	Type        string
}

type EventKind

type EventKind string

type RepoEvent

type RepoEvent struct {
	User      uint
	OldRoot   cid.Cid
	NewRoot   cid.Cid
	RepoSlice []byte
	PDS       uint
	Ops       []RepoOp
}

type RepoHead

type RepoHead struct {
	gorm.Model
	Usr  uint `gorm:"uniqueIndex"`
	Root string
}

type RepoManager

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

func NewRepoManager

func NewRepoManager(db *gorm.DB, cs *carstore.CarStore) *RepoManager

func (*RepoManager) BatchWrite

func (rm *RepoManager) BatchWrite(ctx context.Context, user uint, writes []*atproto.RepoBatchWrite_Input_Writes_Elem) error

func (*RepoManager) CreateRecord

func (rm *RepoManager) CreateRecord(ctx context.Context, user uint, collection string, rec cbg.CBORMarshaler) (string, cid.Cid, error)

func (*RepoManager) DeleteRecord

func (rm *RepoManager) DeleteRecord(ctx context.Context, user uint, collection, rkey string) error

func (*RepoManager) GetProfile

func (rm *RepoManager) GetProfile(ctx context.Context, uid uint) (*apibsky.ActorProfile, error)

func (*RepoManager) GetRecord

func (rm *RepoManager) GetRecord(ctx context.Context, user uint, collection string, rkey string, maybeCid cid.Cid) (cid.Cid, cbg.CBORMarshaler, error)

func (*RepoManager) GetRepoRoot

func (rm *RepoManager) GetRepoRoot(ctx context.Context, user uint) (cid.Cid, error)

func (*RepoManager) HandleExternalUserEvent

func (rm *RepoManager) HandleExternalUserEvent(ctx context.Context, pdsid uint, uid uint, ops []*events.RepoOp, carslice []byte) error

func (*RepoManager) InitNewActor

func (rm *RepoManager) InitNewActor(ctx context.Context, user uint, handle, did, displayname string, declcid, actortype string) error

func (*RepoManager) ReadRepo

func (rm *RepoManager) ReadRepo(ctx context.Context, user uint, fromcid cid.Cid, w io.Writer) error

func (*RepoManager) SetEventHandler

func (rm *RepoManager) SetEventHandler(cb func(context.Context, *RepoEvent))

func (*RepoManager) UpdateRecord

func (rm *RepoManager) UpdateRecord(ctx context.Context, user uint, collection, rkey string, rec cbg.CBORMarshaler) (cid.Cid, error)

type RepoOp

type RepoOp struct {
	Kind       EventKind
	Collection string
	Rkey       string
	RecCid     cid.Cid
	Record     any
	ActorInfo  *ActorInfo
}

Jump to

Keyboard shortcuts

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