spacestatus

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: MIT Imports: 18 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"`
	SpaceLimit         int `yaml:"spaceLimit"`
}

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, spaceType SpaceType, 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 SpaceType added in v0.3.2

type SpaceType int
const (
	SpaceTypePersonal SpaceType = iota
	SpaceTypeTech
	SpaceTypeRegular
)

func VerifySpaceHeader added in v0.3.2

func VerifySpaceHeader(identity crypto.PubKey, headerBytes []byte) (spaceType SpaceType, err error)

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"`
	Type                SpaceType `bson:"type"`
}

Directories

Path Synopsis
Code generated by MockGen.
Code generated by MockGen.

Jump to

Keyboard shortcuts

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