spacestatus

package
v0.3.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 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

View Source
var (
	ErrStatusExists = errors.New("space status exists")
)

Functions

This section is empty.

Types

type ChangeVerifier

type ChangeVerifier interface {
	Verify(change StatusChange) (err error)
}

type Config

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

type Deleter added in v0.3.0

type Deleter func(ctx context.Context, spaceId string) (err error)

type SpaceDeleter

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

type SpaceStatus

type SpaceStatus interface {
	NewStatus(ctx context.Context, spaceId string, identity, oldIdentity crypto.PubKey, force bool) (err error)
	ChangeStatus(ctx context.Context, 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 {
	DeletionPayloadType coordinatorproto.DeletionPayloadType
	DeletionPayload     []byte
	DeletionPayloadId   string
	Identity            crypto.PubKey
	Status              int
	PeerId              string
	SpaceId             string
	NetworkId           string
}

type StatusEntry

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

Directories

Path Synopsis
Package mock_spacestatus is a generated GoMock package.
Package mock_spacestatus is a generated GoMock package.

Jump to

Keyboard shortcuts

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