repomgr

package
v0.0.0-...-feceb36 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0, MIT Imports: 29 Imported by: 20

Documentation

Index

Constants

View Source
const (
	EvtKindCreateRecord = EventKind("create")
	EvtKindUpdateRecord = EventKind("update")
	EvtKindDeleteRecord = EventKind("delete")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ActorInfo

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

type EventKind

type EventKind string

type KeyManager

type KeyManager interface {
	VerifyUserSignature(context.Context, string, []byte, []byte) error
	SignForUser(context.Context, string, []byte) ([]byte, error)
}

type RepoEvent

type RepoEvent struct {
	User      models.Uid
	OldRoot   *cid.Cid
	NewRoot   cid.Cid
	Since     *string
	Rev       string
	RepoSlice []byte
	PDS       uint
	Ops       []RepoOp
}

type RepoHead

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

type RepoManager

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

func NewRepoManager

func NewRepoManager(cs carstore.CarStore, kmgr KeyManager) *RepoManager

func (*RepoManager) BatchWrite

func (rm *RepoManager) BatchWrite(ctx context.Context, user models.Uid, writes []*atproto.RepoApplyWrites_Input_Writes_Elem) error

func (*RepoManager) CarStore

func (rm *RepoManager) CarStore() carstore.CarStore

func (*RepoManager) CheckRepoSig

func (rm *RepoManager) CheckRepoSig(ctx context.Context, r *repo.Repo, expdid string) error

func (*RepoManager) CreateRecord

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

func (*RepoManager) DeleteRecord

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

func (*RepoManager) GetProfile

func (rm *RepoManager) GetProfile(ctx context.Context, uid models.Uid) (*bsky.ActorProfile, error)

func (*RepoManager) GetRecord

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

func (*RepoManager) GetRecordProof

func (rm *RepoManager) GetRecordProof(ctx context.Context, user models.Uid, collection string, rkey string) (cid.Cid, []blocks.Block, error)

func (*RepoManager) GetRepoRev

func (rm *RepoManager) GetRepoRev(ctx context.Context, user models.Uid) (string, error)

func (*RepoManager) GetRepoRoot

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

func (*RepoManager) HandleExternalUserEvent

func (rm *RepoManager) HandleExternalUserEvent(ctx context.Context, pdsid uint, uid models.Uid, did string, since *string, nrev string, carslice []byte, ops []*atproto.SyncSubscribeRepos_RepoOp) error

func (*RepoManager) ImportNewRepo

func (rm *RepoManager) ImportNewRepo(ctx context.Context, user models.Uid, repoDid string, r io.Reader, rev *string) error

func (*RepoManager) InitNewActor

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

func (*RepoManager) ReadRepo

func (rm *RepoManager) ReadRepo(ctx context.Context, user models.Uid, since string, w io.Writer) error

func (*RepoManager) ResetRepo

func (rm *RepoManager) ResetRepo(ctx context.Context, uid models.Uid) error

technically identical to TakeDownRepo, for now

func (*RepoManager) SetEventHandler

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

func (*RepoManager) TakeDownRepo

func (rm *RepoManager) TakeDownRepo(ctx context.Context, uid models.Uid) error

func (*RepoManager) UpdateRecord

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

func (*RepoManager) VerifyRepo

func (rm *RepoManager) VerifyRepo(ctx context.Context, uid models.Uid) 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