spacestatus

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SpaceStatusCreated = iota
	SpaceStatusDeletionPending
	SpaceStatusDeletionStarted
	SpaceStatusDeleted
)
View Source
const CName = "coordinator.spacestatus"

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangeVerifier

type ChangeVerifier interface {
	Verify(rawDelete *treechangeproto.RawTreeChangeWithId, identity crypto.PubKey, peerId string) (err error)
}

type Config

type Config struct {
	RunSeconds         int `yaml:"runSeconds"`
	DeletionPeriodDays int `yaml:"deletionPeriodDays"`
}

type DelSender

type DelSender interface {
	Delete(ctx context.Context, spaceId string, raw *treechangeproto.RawTreeChangeWithId) (err error)
}

type SpaceDeleter

type SpaceDeleter interface {
	Run(spaces *mongo.Collection, delSender DelSender)
	Close()
}

type SpaceStatus

type SpaceStatus interface {
	NewStatus(ctx context.Context, spaceId string, identity, oldIdentity crypto.PubKey) (err error)
	ChangeStatus(ctx context.Context, spaceId string, change StatusChange) (entry StatusEntry, err error)
	Status(ctx context.Context, spaceId string, pubKey crypto.PubKey) (entry StatusEntry, err error)
	app.ComponentRunnable
}

func New

func New() SpaceStatus

type StatusChange

type StatusChange struct {
	DeletionPayload *treechangeproto.RawTreeChangeWithId
	Identity        crypto.PubKey
	Status          int
	PeerId          string
}

type StatusEntry

type StatusEntry struct {
	SpaceId           string `bson:"_id"`
	Identity          string `bson:"identity"`
	OldIdentity       string `bson:"oldIdentity"`
	DeletionPayload   []byte `bson:"deletionPayload"`
	DeletionTimestamp int64  `bson:"deletionTimestamp"`
	Status            int    `bson:"status"`
}

Jump to

Keyboard shortcuts

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